{"record":{"id":"ac0dd4100c35bf50","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-ac0dd4","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/cloudstoragelistbuckets/cloudstoragelistbuckets.go","lineNumber":79,"sourceCode":"type 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\tProject          *string                `yaml:\"project,omitempty\"`\n\tPrefix           *string                `yaml:\"prefix,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\n\tmaxResultsParam := parameters.NewIntParameter(maxResultsKey, \"Maximum number of buckets to return per page. A value of 0 uses the API default (1000); negative values and values above 1000 are rejected.\", parameters.WithIntDefault(0))\n\tpageTokenParam := parameters.NewStringParameter(pageTokenKey, \"A previously-returned page token for retrieving the next page of results.\", parameters.WithStringDefault(\"\"))\n\tallParameters := parameters.Parameters{}\n\tif cfg.Project == nil {\n\t\tallParameters = append(allParameters, parameters.NewStringParameter(projectKey, \"Project ID to list buckets in. When empty, the source's configured project is used.\", parameters.WithStringDefault(\"\")))\n\t}\n\tif cfg.Prefix == nil {\n\t\tallParameters = append(allParameters, parameters.NewStringParameter(prefixKey, \"Filter results to buckets whose names begin with this prefix.\", parameters.WithStringDefault(\"\")))\n\t}\n\tallParameters = append(allParameters, maxResultsParam, pageTokenParam)\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":61,"sourceCodeEnd":97,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudstorage/cloudstoragelistbuckets/cloudstoragelistbuckets.go#L61-L97","documentation":"cloudstorage-list-buckets requires a non-empty description; Config.Initialize returns this error when cfg.Description is empty. The description is mandatory for all toolbox tools since it is exposed to the LLM client.","triggerScenarios":"Initializing a cloudstorage-list-buckets tool with `description` omitted or set to \"\".","commonSituations":"Minimal YAML configs missing the field; empty value after templating; older config formats predating stricter validation.","solutions":["Add a `description` field to the tool config.","Ensure template substitution yields a non-empty string.","Validate configs before server start."],"exampleFix":"# before\nlist_buckets:\n  kind: cloudstorage-list-buckets\n  source: my-gcs\n# after\nlist_buckets:\n  kind: cloudstorage-list-buckets\n  source: my-gcs\n  description: Lists Cloud Storage buckets in the configured project.","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":["Include description in every tool definition snippet","Use lint rules requiring the description field","Check templated configs for empty substitutions"],"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"}