googleapis/mcp-toolbox · error
description is required for tool %q
Error message
description is required for tool %q
What it means
tidb-execute-sql requires a `description` in the tool config; Initialize rejects empty descriptions before constructing the tool. The description is required because it is included in the tool manifest shown to the LLM client.
Source
Thrown at internal/tools/tidb/tidbexecutesql/tidbexecutesql.go:67
}
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)
}
sqlParameter := parameters.NewStringParameter("sql", "The sql to execute.")
allParameters := parameters.Parameters{sqlParameter}
return Tool{
BaseTool: tools.NewBaseTool(
cfg,
tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewDestructiveAnnotations),
tools.Manifest{Description: cfg.Description, Parameters: allParameters.Manifest(), AuthRequired: cfg.AuthRequired},
allParameters,
),
}, nil
}
// validate interface
var _ tools.Tool = Tool{}
View on GitHub (pinned to 8cc6e09de2)
Solutions
- Add a non-empty `description:` field to the tidb-execute-sql tool.
- Confirm indentation places description within the tool config.
- Ensure any templated description evaluates to non-empty text.
Example fix
# before kind: tidb-execute-sql source: my-tidb # after kind: tidb-execute-sql source: my-tidb description: "Run arbitrary SQL against TiDB."
Defensive patterns
Strategy: validation
Validate before calling
yq '.tools[] | select(.kind == "tidb-execute-sql") | select(.description == null or .description == "") | .name' tools.yaml
Type guard
func validTidbTool(c tidbexecutesql.Config) error {
if c.Description == "" { return errors.New("description is required") }
return nil
} Try / catch
tool, err := cfg.Initialize(ctx)
if err != nil {
log.Fatalf("tidb tool config error: %v", err)
} Prevention
- Include description in every tool definition from the start.
- CI-lint configs for mandatory fields.
- Double-check YAML indentation when a seemingly-present field is not read.
When it happens
Trigger: A `tidb-execute-sql` tool entry without `description:` or with description: ""; templated description resolving empty.
Common situations: Writing configs by hand and skipping description; YAML anchor/indent mistakes; bulk-generated configs missing the field.
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
- 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/27b80f85c6716efd.
Report an issue: GitHub.