googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

Thrown by Config.Initialize when the cloudhealthcare-get-fhir-resource tool has an empty Description. Every tool must describe itself for MCP clients; missing descriptions fail initialization immediately.

Source

Thrown at internal/tools/cloudhealthcare/cloudhealthcaregetfhirresource/cloudhealthcaregetfhirresource.go:72

}

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

	params := buildParams(false)
	return Tool{
		BaseTool: tools.NewBaseTool(
			cfg,
			tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewReadOnlyAnnotations),
			tools.Manifest{Description: cfg.Description, Parameters: params.Manifest(), AuthRequired: cfg.AuthRequired},
			params,
		),
	}, nil
}

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

type Tool struct {
	tools.BaseTool[Config]

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a non-empty description to the tool YAML
  2. Set cfg.Description before calling Initialize
  3. Fail fast with config validation at startup

Example fix

# before
kind: cloud-healthcare-get-fhir-resource
# after
kind: cloud-healthcare-get-fhir-resource
description: Retrieves a FHIR resource from a Cloud Healthcare FHIR store
Defensive patterns

Strategy: validation

Validate before calling

if cfg.Description == "" {
    return fmt.Errorf("description missing for tool %q", cfg.Name)
}

Prevention

When it happens

Trigger: Calling Initialize on a Config where Description is "" (omitted in YAML or unset in code).

Common situations: YAML tool entries missing the description field; programmatic Config construction leaving Description zero-valued; automation emitting empty strings.

Related errors


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