{"record":{"id":"97ed28a5c4f1c8e2","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-97ed28","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/cloudstoragedownloadobject/cloudstoragedownloadobject.go","lineNumber":76,"sourceCode":"\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\tDestinationDir   *string                `yaml:\"destination_dir,omitempty\"`\n\tOverwrite        *bool                  `yaml:\"overwrite,omitempty\"`\n}\n\n// validate interface\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\tif cfg.DestinationDir != nil {\n\t\tif *cfg.DestinationDir == \"\" {\n\t\t\treturn nil, fmt.Errorf(\"destination_dir cannot be empty for tool %q\", cfg.Name)\n\t\t}\n\t\tif _, err := cloudstoragecommon.ValidateLocalPath(*cfg.DestinationDir); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"destination_dir is invalid for tool %q: %w\", cfg.Name, err)\n\t\t}\n\t}\n\n\tobjectParam := parameters.NewStringParameter(objectKey, \"Full object name (path) within the bucket, e.g. 'path/to/file.txt'.\")\n\tdestinationDesc := \"Absolute local filesystem path where the object will be written. Relative paths and paths containing '..' are rejected.\"\n\tif cfg.DestinationDir != nil {\n\t\tdestinationDesc = \"Relative path under the configured destination_dir where the object will be written. Absolute paths and paths that escape destination_dir are rejected.\"\n\t}","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudstorage/cloudstoragedownloadobject/cloudstoragedownloadobject.go#L58-L94","documentation":"Configuration-time validation in Initialize: the cloudstorage-download-object tool entry in tools.yaml has no description. Toolbox refuses to register tools without a description because it is what the LLM sees in the tool manifest.","triggerScenarios":"tools.yaml defines a cloudstorage-download-object tool with no description field or description: \"\".","commonSituations":"Omitting description when adding the download tool to an existing config; YAML keys mis-nested under a different tool; generating configs programmatically without setting Description.","solutions":["Add a meaningful description field to the tool config","Check that the description is correctly indented inside the tool's YAML mapping","If using Go Config structs, set Description before Initialize"],"exampleFix":"// before\ntools:\n  download-object:\n    kind: cloudstorage-download-object\n    source: my-gcs\n    destination_dir: /tmp\n// after\ntools:\n  download-object:\n    kind: cloudstorage-download-object\n    source: my-gcs\n    description: Download an object from Cloud Storage to a local directory\n    destination_dir: /tmp","handlingStrategy":"validation","validationCode":"if cfg.Description == \"\" {\n    return errors.New(\"download-object: description is required\")\n}","typeGuard":null,"tryCatchPattern":"if err := startToolbox(); err != nil {\n    if strings.Contains(err.Error(), \"description is required\") {\n        // add description to tools.yaml\n    }\n    log.Fatal(err)\n}","preventionTips":["Add description whenever adding a new tool block","CI-lint tools.yaml for required fields","Review YAML nesting after copy-paste"],"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"}