googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

Config.Initialize for the looker-list-gitbranches tool validates that the `description` field is non-empty before building the tool. MCP tools must expose a human-readable description to clients; an empty one means the tool spec would be incomplete, so initialization fails fast with this error naming the tool.

Source

Thrown at internal/tools/looker/lookerlistgitbranches/lookerlistgitbranches.go:71

}

type Config struct {
	tools.ConfigBase `yaml:",inline"`
	Type             string                 `yaml:"type" validate:"required"`
	Source           string                 `yaml:"source" validate:"required"`
	Annotations      *tools.ToolAnnotations `yaml:"annotations,omitempty"`
}

// validate interface
var _ tools.ToolConfig = Config{}

func (cfg Config) ToolConfigType() string {
	return resourceType
}

func (cfg Config) Initialize(context.Context) (tools.Tool, error) {
	if cfg.Description == "" {
		return nil, fmt.Errorf("description is required for tool %q", cfg.Name)
	}

	projectIdParameter := parameters.NewStringParameter("project_id", "The project_id")
	allParameters := parameters.Parameters{projectIdParameter}

	// finish tool setup
	return Tool{
		BaseTool: tools.NewBaseTool(
			cfg,
			tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewReadOnlyAnnotations),
			tools.Manifest{Description: cfg.Description, Parameters: allParameters.Manifest(), AuthRequired: cfg.AuthRequired},
			allParameters,
		),
	}, nil
}

// validate interface
var _ tools.Tool = Tool{}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a non-empty `description` field to the looker-list-gitbranches tool entry in tools.yaml.
  2. Verify YAML indentation so `description` sits at the tool level, not nested under another key.
  3. If generating configs in code, set cfg.Description before calling Initialize.

Example fix

# before (tools.yaml)
tools:
  list-branches:
    kind: looker-list-gitbranches
    source: my-looker

# after
tools:
  list-branches:
    kind: looker-list-gitbranches
    source: my-looker
    description: Lists git branches for a Looker project
Defensive patterns

Strategy: validation

Validate before calling

// Go: pre-flight check before loading config
if cfg.Description == "" {
    return fmt.Errorf("tool %q is missing required field: description", cfg.Name)
}
// Or lint the YAML offline:
// every tools.yaml tool entry must have a non-empty description key

Try / catch

tool, err := cfg.Initialize(ctx)
if err != nil && strings.Contains(err.Error(), "description is required") {
    return fmt.Errorf("tools.yaml: add a description for tool %s", cfg.Name)
}

Prevention

When it happens

Trigger: Loading a tools.yaml where a tool of kind looker-list-gitbranches omits the `description` field or sets it to an empty string, causing Config.Initialize to return this error.

Common situations: Hand-writing YAML and forgetting the description; programmatically constructing Config{} with only Name/Source set; a template or generator emitting minimal tool configs; description lost after YAML indentation mistakes put it under the wrong key.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/af8f054d1c3b8b77. Report an issue: GitHub.