googleapis/mcp-toolbox · error
description is required for tool %q
Error message
description is required for tool %q
What it means
cloud-storage-deletebucket's Config.Initialize enforces a non-empty tool description before constructing the tool. The description is required because it is shown to LLM clients; an empty description fails config loading with this error.
Source
Thrown at internal/tools/cloudstorage/cloudstoragedeletebucket/cloudstoragedeletebucket.go:67
DeleteBucket(ctx context.Context, bucket string) (map[string]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)
}
bucketParam := parameters.NewStringParameter(bucketKey, "Name of the empty Cloud Storage bucket to delete.")
allParameters := parameters.Parameters{bucketParam}
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 delete_bucket tool config
- Run config validation/linting in CI to catch missing fields pre-deploy
- Check YAML nesting so description sits under the tool, not a sibling
Example fix
// before - name: delete_bucket source: my-gcs // after - name: delete_bucket source: my-gcs description: Deletes an empty Cloud Storage bucket by name
Defensive patterns
Strategy: validation
Validate before calling
func validateDeleteBucketTool(cfg map[string]any) error {
d, _ := cfg["description"].(string)
if strings.TrimSpace(d) == "" {
return fmt.Errorf("tool %v: description is required", cfg["name"])
}
return nil
} Type guard
func hasDescription(cfg Config) bool { return cfg.Description != "" } Try / catch
tool, err := cfg.Initialize(ctx)
if err != nil && strings.Contains(err.Error(), "description is required") {
return fmt.Errorf("add description to delete_bucket in tools.yaml: %w", err)
} Prevention
- Always include a description line when adding tool blocks
- CI schema-check tools.yaml against required fields
- Copy tool templates that include description placeholders
- Fix indentation so description parses into the tool config
When it happens
Trigger: A delete_bucket tool definition in tools.yaml missing the `description` field; Initialize runs at server startup and returns the error.
Common situations: Hand-written YAML missing description; templated configs where the description field evaluated to an empty string; indentation errors placing description under the wrong node.
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
- source_bucket cannot be empty for tool %q
- destination_bucket cannot be empty for tool %q
- description is required for tool %q
- doc %d: unexpected non-string key in input: %v
AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05).
Data as JSON: /api/errors/02f095df1b81725e.
Report an issue: GitHub.