googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

Initialize rejects a tool configuration whose 'description' field is empty. Description is mandatory for this tool type (it feeds the LLM tool manifest), so the error fires during startup when the tools.yaml entry omits or leaves blank the 'description' key.

Source

Thrown at internal/tools/mongodb/mongodbaggregate/mongodbaggregate.go:76

	Collection              string                 `yaml:"collection"`
	CollectionAllowedValues []string               `yaml:"collectionAllowedValues"`
	PipelinePayload         string                 `yaml:"pipelinePayload" validate:"required"`
	PipelineParams          parameters.Parameters  `yaml:"pipelineParams" validate:"required"`
	Canonical               bool                   `yaml:"canonical"`
	ReadOnly                bool                   `yaml:"readOnly"`
	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 := slices.Concat(cfg.PipelineParams)

	if err := mongodbcommon.ValidateCollectionConfig(cfg.Collection, cfg.CollectionAllowedValues); err != nil {
		return nil, err
	}
	allParameters = mongodbcommon.WithRuntimeCollectionParam(cfg.Collection, cfg.CollectionAllowedValues, allParameters)

	if err := parameters.CheckDuplicateParameters(allParameters); err != nil {
		return nil, err
	}

	paramManifest := allParameters.Manifest()
	if paramManifest == nil {
		paramManifest = make([]parameters.ParameterManifest, 0)
	}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a non-empty `description` to the mongodb-aggregate tool entry
  2. Validate tool configs at generation time (fail fast on empty description)
  3. Load the config locally with `go run .` before deploying

Example fix

// before
aggregate:
  kind: mongodb-aggregate
  source: my-mongo
// after
aggregate:
  kind: mongodb-aggregate
  source: my-mongo
  description: Run an aggregation pipeline on a MongoDB collection.
Defensive patterns

Strategy: validation

Validate before calling

if cfg.Description == "" {
    return errors.New("mongodb-aggregate: description is required")
}

Prevention

When it happens

Trigger: Declaring a `mongodb-aggregate` tool in tools.yaml without a `description` or with description: "".

Common situations: Hand-written YAML missing the field; automated config generation leaving it blank; cleanup accidentally removed the description.

Related errors


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