{"record":{"id":"7f671f1a70711e57","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-7f671f","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/cloudstoragegetbucketmetadata/cloudstoragegetbucketmetadata.go","lineNumber":69,"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\tallParameters := parameters.Parameters{}\n\tif cfg.Bucket == nil {\n\t\tallParameters = append(allParameters, parameters.NewStringParameter(bucketKey, \"Name of the Cloud Storage bucket to inspect.\"))\n\t}\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,\n\t\t),\n\t}, nil","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudstorage/cloudstoragegetbucketmetadata/cloudstoragegetbucketmetadata.go#L51-L87","documentation":"The cloudstorage-get-bucket-metadata tool requires a non-empty description; Config.Initialize returns this error when cfg.Description is empty. Descriptions are surfaced to the LLM via MCP so they are mandatory for every tool.","triggerScenarios":"Initializing a cloudstorage-get-bucket-metadata tool with `description` omitted or set to \"\" in the YAML config (or programmatically via Config struct).","commonSituations":"Minimal/hand-written tool configs missing the description field; empty string after templating; schemas from older toolbox versions lacking required fields.","solutions":["Add a meaningful `description` field to the tool config.","Ensure templated configs actually substitute a non-empty description.","Run config validation before server startup to catch missing fields early."],"exampleFix":"# before\nget_bucket_metadata:\n  kind: cloudstorage-get-bucket-metadata\n  source: my-gcs-source\n# after\nget_bucket_metadata:\n  kind: cloudstorage-get-bucket-metadata\n  source: my-gcs-source\n  description: Fetches metadata for a Cloud Storage 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":["Always include a one-line description when authoring any tool","Use a config schema validator requiring the description key","Review generated/templated configs for unfilled fields"],"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"}