googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

The cloudhealthcare-get-dataset tool requires a non-empty description in its Config. Initialize rejects empty descriptions because the description is surfaced to LLM clients in the MCP manifest; without it the tool would be unusable/undocumented. The error names the offending tool via cfg.Name.

Source

Thrown at internal/tools/cloudhealthcare/cloudhealthcaregetdataset/cloudhealthcaregetdataset.go:67

}

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)
	}

	allParameters := parameters.Parameters{}

	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{}

type Tool struct {

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a non-empty description to the cloudhealthcare-get-dataset tool entry in tools.yaml.
  2. Verify YAML indentation so description is inside the tool mapping.
  3. Set ConfigBase Description when constructing Config in Go code.
  4. Restart the toolbox after the config fix.

Example fix

# before
tools:
  get-dataset:
    kind: cloudhealthcare-get-dataset
    source: my-healthcare

# after
tools:
  get-dataset:
    kind: cloudhealthcare-get-dataset
    source: my-healthcare
    description: Retrieves a Cloud Healthcare dataset by name.
Defensive patterns

Strategy: validation

Validate before calling

if cfg.Name == "" || cfg.Description == "" {
	return errors.New("cloudhealthcare-get-dataset config needs non-empty name and description")
}

Type guard

null

Try / catch

tool, err := cfg.Initialize(ctx)
if err != nil {
	// description errors are config bugs; surface a fix hint, don't retry
	return nil, fmt.Errorf("tool config invalid: %w", err)
}

Prevention

When it happens

Trigger: Config.Initialize(ctx) is called (directly or through toolbox startup parsing tools.yaml) for a cloudhealthcare-get-dataset tool whose description field is missing or empty.

Common situations: tools.yaml omits the description key for the tool; YAML indentation places description in the wrong block; programmatically built Config leaves Description unset; empty string supplied expecting a default.

Related errors


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