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
- Add a non-empty `description` to the mongodb-aggregate tool entry
- Validate tool configs at generation time (fail fast on empty description)
- 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
- Include description in every mongodb tool definition
- Add YAML schema validation (kind, source, description required) to CI
- Validate locally before deploying
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
- description is required for tool %q
- description is required for tool %q
- description is required for tool %q
- description is required for tool %q
- description is required for tool %q
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/45be66873e8d8a91.
Report an issue: GitHub.