googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

The cloudhealthcare-fhir-patient-search tool requires a non-empty description in its Config. Initialize validates this before constructing the Tool and returns this error when cfg.Description is empty. Descriptions are what the LLM sees in the MCP tool manifest, so the library treats a missing one as an invalid tool configuration and refuses to initialize the tool.

Source

Thrown at internal/tools/cloudhealthcare/cloudhealthcarefhirpatientsearch/cloudhealthcarefhirpatientsearch.go:91

}

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 field to the cloudhealthcare-fhir-patient-search tool entry in tools.yaml.
  2. Check YAML indentation so description sits under the tool's own mapping, not a sibling.
  3. If building Config in Go, set the Description field from tools.ConfigBase before calling Initialize.
  4. Restart the toolbox after fixing the config.

Example fix

# before
tools:
  fhir-patient-search:
    kind: cloudhealthcare-fhir-patient-search
    source: my-healthcare

# after
tools:
  fhir-patient-search:
    kind: cloudhealthcare-fhir-patient-search
    source: my-healthcare
    description: Searches for FHIR Patient resources in a Cloud Healthcare FHIR store.
Defensive patterns

Strategy: validation

Validate before calling

cfg, _ := configs.GetToolConfig("fhir-patient-search")
if cfg == nil || cfg.GetDescription() == "" {
	return errors.New("cloudhealthcare-fhir-patient-search requires a non-empty description")
}

Type guard

null

Try / catch

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

Prevention

When it happens

Trigger: Calling Config.Initialize(ctx) (or starting the toolbox with a tools.yaml that defines a cloudhealthcare-fhir-patient-search tool) where the description field is absent or set to "".

Common situations: The tool entry in tools.yaml omits the description key; YAML indentation puts description under the wrong node so it never populates the field; a programmatically constructed Config leaves Description unset; an empty string was provided thinking a default would be applied.

Related errors


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