{"record":{"id":"b4513b4312aca6e3","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-b4513b","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/cloudstoragedeleteobject/cloudstoragedeleteobject.go","lineNumber":71,"sourceCode":"}\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\tBucket           *string                `yaml:\"bucket,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\tif cfg.Bucket != nil && *cfg.Bucket == \"\" {\n\t\treturn nil, fmt.Errorf(\"bucket cannot be empty for tool %q\", cfg.Name)\n\t}\n\n\tobjectParam := parameters.NewStringParameter(objectKey, \"Full object name (path) within the bucket, e.g. 'path/to/file.txt'.\")\n\tallParameters := parameters.Parameters{}\n\tif cfg.Bucket == nil {\n\t\tallParameters = append(allParameters, parameters.NewStringParameter(bucketKey, \"Name of the Cloud Storage bucket containing the object to delete.\"))\n\t}\n\tallParameters = append(allParameters, objectParam)\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,","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudstorage/cloudstoragedeleteobject/cloudstoragedeleteobject.go#L53-L89","documentation":"Config.Initialize for cloudstorage-delete-object requires a non-empty description field. Descriptions are surfaced to the LLM as the tool's documentation in the MCP manifest, so an empty one is treated as a misconfiguration and initialization fails.","triggerScenarios":"Declaring a cloudstorage-delete-object tool in tools.yaml without the description field, or with description: \"\".","commonSituations":"Minimal configs copied from examples that omit description; YAML indentation mistakes placing description under the wrong key; programmatic Config construction leaving Description unset.","solutions":["Add a non-empty description field to the tool entry in tools.yaml","Check YAML indentation so description lands inside the tool config, not a sibling key","If constructing Config in Go, set cfg.Description before calling Initialize"],"exampleFix":"// before\ntools:\n  delete-object:\n    kind: cloudstorage-delete-object\n    source: my-gcs\n// after\ntools:\n  delete-object:\n    kind: cloudstorage-delete-object\n    source: my-gcs\n    description: Delete an object from a Cloud Storage bucket","handlingStrategy":"validation","validationCode":"if cfg.Description == \"\" {\n    return fmt.Errorf(\"tool %q: description is required\", cfg.Name)\n}","typeGuard":null,"tryCatchPattern":"if err := startToolbox(); err != nil {\n    if strings.Contains(err.Error(), \"description is required\") {\n        // fix tools.yaml and retry\n    }\n    log.Fatal(err)\n}","preventionTips":["Include description on every tool entry; treat it as mandatory","Lint tools.yaml in CI for required keys","Never leave YAML values blank"],"tags":["go","mcp-toolbox","configuration","validation"],"backgroundTag":"missing-required-argument","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"}