googleapis/mcp-toolbox · error
description is required for tool %q
Error message
description is required for tool %q
What it means
cloudgda.Config.Initialize validates that a non-empty description was provided before constructing the tool. In this codebase the description is user-supplied in tools.yaml (the tool does not ship a default), so an empty description makes the tool un-instantiable. The error names the offending tool via cfg.Name.
Source
Thrown at internal/tools/cloudgda/cloudgda.go:130
tools.ConfigBase `yaml:",inline"`
Type string `yaml:"type" validate:"required"`
Source string `yaml:"source" validate:"required"`
Location string `yaml:"location" validate:"required"`
Context *QueryDataContext `yaml:"context" validate:"required"`
GenerationOptions *GenerationOptions `yaml:"generationOptions,omitempty"`
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)
}
// Define the parameters for the Gemini Data Analytics Query API
// The query is the only input parameter.
allParameters := parameters.Parameters{
parameters.NewStringParameter("query", "A natural language formulation of a database query.", parameters.WithStringRequired(true)),
}
// The input and outputs are for tool guidance, usage guidance is for multi-turn interaction.
guidance := Guidance
cfg.Description += "\n\n" + guidance
return Tool{
BaseTool: tools.NewBaseTool(
cfg,
tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewReadOnlyAnnotations),
tools.Manifest{Description: cfg.Description, Parameters: allParameters.Manifest(), AuthRequired: cfg.AuthRequired},
allParameters,
),View on GitHub (pinned to 8cc6e09de2)
Solutions
- Add a non-empty description field to the cloudgda tool's yaml block in tools.yaml
- Verify the key is spelled exactly 'description' and is not an empty string
- Check that YAML anchors/overrides used to build the config do not blank the field
Example fix
// before
tools:
my-gda-tool:
kind: cloud-gemini-data-analytics-query
source: my-gda-source
// after
tools:
my-gda-tool:
kind: cloud-gemini-data-analytics-query
source: my-gda-source
description: "Run natural language queries against BigQuery using Gemini Data Analytics" Defensive patterns
Strategy: validation
Validate before calling
// pre-check your tools.yaml
func toolHasDescription(name string, cfg map[string]map[string]any) error {
t := cfg["tools"][name].(map[string]any)
d, _ := t["description"].(string)
if d == "" { return fmt.Errorf("description missing for %s", name) }
return nil
} Prevention
- Always set description for every tool in tools.yaml
- Run the server once locally to validate config before deploying
- Don't misspell the description key
When it happens
Trigger: A cloudgda tool definition in tools.yaml where the description field is missing, set to an empty string, or set to "" via an empty YAML anchor.
Common situations: Writing a minimal tools.yaml and forgetting description; a templated config where description resolves to empty; YAML key misspelled (descripton) so the field stays zero-valued.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- doc %d: unexpected non-string key in input: %v
- doc %d: invalid config format at key %q: %w
- doc %d: invalid config format at key %q: expected nested for
- %s missing 'kind' field or it is not a string
- missing 'kind' field or it is not a string: %v
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/67e2ee27a06bb52e.
Report an issue: GitHub.