{"record":{"id":"24f7438e888e594b","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-24f743","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/cloudstoragereadobject/cloudstoragereadobject.go","lineNumber":75,"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\trangeParam := parameters.NewStringParameter(rangeKey, \"Optional HTTP byte range, e.g. 'bytes=0-999' (first 1000 bytes), 'bytes=-500' (last 500 bytes), or 'bytes=500-' (from byte 500 to end). Empty reads the full object.\", parameters.WithStringDefault(\"\"))\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, rangeParam)\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},","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudstorage/cloudstoragereadobject/cloudstoragereadobject.go#L57-L93","documentation":"Thrown by cloudstorage-read-object Config.Initialize when the tool's description is missing or empty. The toolbox requires a description for every tool so the MCP manifest can tell the LLM what the tool does.","triggerScenarios":"A cloudstorage-read-object tool in tools.yaml lacks the 'description' field or has `description: \"\"`; Initialize runs during startup/config parsing.","commonSituations":"Omitting the description while experimenting with the read-object tool; empty template variables in generated configs; truncation when copying YAML.","solutions":["Add a non-empty 'description' to the tool config","Verify rendered YAML contains the description if using templates/env substitution","Restart the toolbox and confirm the tool loads"],"exampleFix":"// before\n  read-object:\n    kind: cloudstorage-read-object\n    source: my-gcs\n// after\n  read-object:\n    kind: cloudstorage-read-object\n    source: my-gcs\n    description: Read the contents of a Cloud Storage object, optionally by byte range","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(description) == \"\" {\n    return errors.New(\"cloudstorage-read-object tool requires a non-empty description\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always fill description when scaffolding new tools","Enforce via pre-commit config schema check","Document that description is a required field for all tools"],"tags":["go","configuration","mcp-toolbox","cloud-storage","validation"],"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"}