{"record":{"id":"02f095df1b81725e","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-02f095","errorCode":null,"errorMessage":"description is required for tool %q","messagePattern":"description is required for tool %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/cloudstorage/cloudstoragedeletebucket/cloudstoragedeletebucket.go","lineNumber":67,"sourceCode":"\tDeleteBucket(ctx context.Context, bucket string) (map[string]any, error)\n}\n\ntype Config struct {\n\ttools.ConfigBase `yaml:\",inline\"`\n\tType             string                 `yaml:\"type\" validate:\"required\"`\n\tSource           string                 `yaml:\"source\" validate:\"required\"`\n\tAnnotations      *tools.ToolAnnotations `yaml:\"annotations,omitempty\"`\n}\n\nvar _ tools.ToolConfig = Config{}\n\nfunc (cfg Config) ToolConfigType() string {\n\treturn resourceType\n}\n\nfunc (cfg Config) Initialize(context.Context) (tools.Tool, error) {\n\tif cfg.Description == \"\" {\n\t\treturn nil, fmt.Errorf(\"description is required for tool %q\", cfg.Name)\n\t}\n\n\tbucketParam := parameters.NewStringParameter(bucketKey, \"Name of the empty Cloud Storage bucket to delete.\")\n\tallParameters := parameters.Parameters{bucketParam}\n\n\treturn Tool{\n\t\tBaseTool: tools.NewBaseTool(\n\t\t\tcfg,\n\t\t\ttools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewDestructiveAnnotations),\n\t\t\ttools.Manifest{Description: cfg.Description, Parameters: allParameters.Manifest(), AuthRequired: cfg.AuthRequired},\n\t\t\tallParameters,\n\t\t),\n\t}, nil\n}\n\nvar _ tools.Tool = Tool{}\n\ntype Tool struct {","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudstorage/cloudstoragedeletebucket/cloudstoragedeletebucket.go#L49-L85","documentation":"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.","triggerScenarios":"A delete_bucket tool definition in tools.yaml missing the `description` field; Initialize runs at server startup and returns the error.","commonSituations":"Hand-written YAML missing description; templated configs where the description field evaluated to an empty string; indentation errors placing description under the wrong node.","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"],"exampleFix":"// before\n- name: delete_bucket\n  source: my-gcs\n// after\n- name: delete_bucket\n  source: my-gcs\n  description: Deletes an empty Cloud Storage bucket by name","handlingStrategy":"validation","validationCode":"func validateDeleteBucketTool(cfg map[string]any) error {\n    d, _ := cfg[\"description\"].(string)\n    if strings.TrimSpace(d) == \"\" {\n        return fmt.Errorf(\"tool %v: description is required\", cfg[\"name\"])\n    }\n    return nil\n}","typeGuard":"func hasDescription(cfg Config) bool { return cfg.Description != \"\" }","tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil && strings.Contains(err.Error(), \"description is required\") {\n    return fmt.Errorf(\"add description to delete_bucket in tools.yaml: %w\", err)\n}","preventionTips":["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"],"tags":["config","validation","yaml","cloud-storage"],"backgroundTag":"missing-required-config-field","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}