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/postgres/postgreslistactivequeries/postgreslistactivequeries.go:90
RunSQL(context.Context, string, []any) (any, error)
}
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"`
}
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 := parameters.Parameters{
parameters.NewStringParameter("min_duration", "Optional: Only show queries running at least this long (e.g., '1 minute', '1 second', '2 seconds').", parameters.WithStringDefault("1 minute")),
parameters.NewStringParameter("exclude_application_names", "Optional: A comma-separated list of application names to exclude from the query results. This is useful for filtering out queries from specific applications (e.g., 'psql', 'pgAdmin', 'DBeaver'). The match is case-sensitive. Whitespace around commas and names is automatically handled. If this parameter is omitted, no applications are excluded.", parameters.WithStringDefault("")),
parameters.NewIntParameter("limit", "Optional: The maximum number of rows to return.", parameters.WithIntDefault(50)),
}
paramManifest := allParameters.Manifest()
return Tool{
BaseTool: tools.NewBaseTool(
cfg,
tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewReadOnlyAnnotations),
tools.Manifest{Description: cfg.Description, Parameters: paramManifest, AuthRequired: cfg.AuthRequired},
allParameters,
),
}, nil
}
View on GitHub (pinned to 8cc6e09de2)
Solutions
- Add a non-empty 'description' field to the tool entry in tools.yaml
- Describe what the tool does so the LLM can select it appropriately
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/tools/postgres/postgreslistactivequeries/postgreslistactivequeries.go:90 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/45878ed31cb45b41.
Report an issue: GitHub.