googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

Every tool in MCP Toolbox must carry a non-empty description, which is exposed to LLM clients in the tool manifest. Config.Initialize returns this error at startup when a firestore-mongodb-get-schema tool is defined without a description field.

Source

Thrown at internal/tools/firestoremongodb/firestoremongodbgetschema/firestoremongodbgetschema.go:68

}

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

	emptyString := ""
	collectionParam := parameters.NewStringParameter(collectionKey, "Optional name or path of a specific collection to get schema for. If omitted, schemas for all root collections are returned.", parameters.WithStringDefault(emptyString))
	params := parameters.Parameters{collectionParam}

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

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a non-empty "description" field to the tool in tools.yaml.
  2. Verify YAML indentation so "description" is a direct child of the tool entry, not nested under another key.
  3. If generating configs programmatically, validate that description is non-empty before writing the YAML.

Example fix

# before
my-tool:
  type: firestore-mongodb-get-schema
  source: my-src
# after
my-tool:
  type: firestore-mongodb-get-schema
  source: my-src
  description: Get schemas for Firestore collections via MongoDB API
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight check on parsed tool config
if tool.Description == "" {
    return fmt.Errorf("tool %q is missing a description", tool.Name)
}

Prevention

When it happens

Trigger: A tools.yaml entry of type "firestore-mongodb-get-schema" omits the "description" field or sets it to an empty string; Initialize() then fails while building the tool.

Common situations: Hand-writing YAML and skipping the description; a templating pipeline that emits an empty description; YAML indentation mistakes that place description under the wrong key so it never unmarshals into the Config.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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