{"record":{"id":"dc5f56b73117acf0","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-dc5f56","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/cloudstoragegetobjectmetadata/cloudstoragegetobjectmetadata.go","lineNumber":73,"sourceCode":"\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\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\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.\"))\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.NewReadOnlyAnnotations),\n\t\t\ttools.Manifest{Description: cfg.Description, Parameters: allParameters.Manifest(), AuthRequired: cfg.AuthRequired},\n\t\t\tallParameters,","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudstorage/cloudstoragegetobjectmetadata/cloudstoragegetobjectmetadata.go#L55-L91","documentation":"cloudstorage-get-object-metadata's Config.Initialize enforces a non-empty description, returning this error when cfg.Description is empty. Like all toolbox tools, the description is required because it tells the LLM when and how to use the tool.","triggerScenarios":"Initializing a cloudstorage-get-object-metadata tool config with `description` missing or empty string.","commonSituations":"Omitting description in hand-authored YAML; blank value after templating/env substitution; copying a config snippet that trimmed optional-looking fields.","solutions":["Add a `description` field explaining what the tool does.","Confirm templating produced a non-empty value.","Validate tool configs programmatically before starting the server."],"exampleFix":"# before\nget_object_metadata:\n  kind: cloudstorage-get-object-metadata\n  bucket: my-bucket\n# after\nget_object_metadata:\n  kind: cloudstorage-get-object-metadata\n  bucket: my-bucket\n  description: Gets metadata (size, content type) for a specific object in a GCS bucket.","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(cfg.Description) == \"\" {\n    return errors.New(\"description is required for tool \" + cfg.Name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat description as a mandatory field in tool templates","Schema-validate YAML before deployment","Fail fast in CI on missing description keys"],"tags":["go","cloudstorage","config-validation","missing-field"],"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"}