googleapis/mcp-toolbox · error
description is required for tool %q
Error message
description is required for tool %q
What it means
postgres-execute-sql's Config.Initialize requires a non-empty Description, consistent with all tool configs. The description is required for the tool manifest exposed to MCP clients; an empty one aborts initialization immediately.
Source
Thrown at internal/tools/postgres/postgresexecutesql/postgresexecutesql.go:66
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("sql", "The sql to execute."),
}
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
}
var _ tools.Tool = Tool{}
type Tool struct {View on GitHub (pinned to 8cc6e09de2)
Solutions
- Add a non-empty description to the postgres-execute-sql tool config.
- Set cfg.Description in Go before calling Initialize.
- Check YAML indentation/key spelling so description deserializes correctly.
Example fix
# before
execute-sql:
kind: postgres-execute-sql
source: my-postgres
# after
execute-sql:
kind: postgres-execute-sql
source: my-postgres
description: Executes arbitrary SQL against the Postgres database. Defensive patterns
Strategy: validation
Validate before calling
if cfg.Description == "" {
return errors.New("postgres-execute-sql tool requires a non-empty description")
} Type guard
func hasDescription(c postgresexecutesql.Config) bool { return c.Description != "" } Try / catch
tool, err := cfg.Initialize(context.Background())
if err != nil && strings.Contains(err.Error(), "description is required") {
cfg.Description = "Execute SQL against Postgres."
tool, err = cfg.Initialize(context.Background())
} Prevention
- Include a description for every tool in tools.yaml.
- Enforce description presence with a CI config linter.
- Derive descriptions from prebuilt config examples rather than writing from scratch.
When it happens
Trigger: Initializing a postgresexecutesql.Config with Description == "" — typically a tools.yaml entry for postgres-execute-sql missing the description field.
Common situations: Omitting or misspelling description in YAML; empty-string description; building Config programmatically without setting Description; deserialization issues leaving the field zero-valued.
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
- invalid source for %q tool: source %q is not a compatible ty
- `audience` or `clientId` is required when `mcpEnabled` is tr
- `audience` is not allowed when `mcpEnabled` is false
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/8bb4581aa1a62d15.
Report an issue: GitHub.