{"record":{"id":"e4a26e1f6fda10fb","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-e4a26e","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/cloudstoragelistobjects/cloudstoragelistobjects.go","lineNumber":81,"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\tPrefix           *string                `yaml:\"prefix,omitempty\"`\n\tDelimiter        *string                `yaml:\"delimiter,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\tmaxResultsParam := parameters.NewIntParameter(maxResultsKey, \"Maximum number of objects 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.Bucket == nil {\n\t\tallParameters = append(allParameters, parameters.NewStringParameter(bucketKey, \"Name of the Cloud Storage bucket to list objects from.\"))\n\t}\n\tif cfg.Prefix == nil {\n\t\tallParameters = append(allParameters, parameters.NewStringParameter(prefixKey, \"Filter results to objects whose names begin with this prefix.\", parameters.WithStringDefault(\"\")))\n\t}\n\tif cfg.Delimiter == nil {\n\t\tallParameters = append(allParameters, parameters.NewStringParameter(delimiterKey, \"Delimiter used to group object names (typically '/'). When set, common prefixes are returned as 'prefixes'.\", parameters.WithStringDefault(\"\")))\n\t}\n\tallParameters = append(allParameters, maxResultsParam, pageTokenParam)","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudstorage/cloudstoragelistobjects/cloudstoragelistobjects.go#L63-L99","documentation":"This error is thrown by the cloudstorage-list-objects tool's Config.Initialize when the tool's YAML config has no description set. MCP Toolbox requires every tool to have a non-empty description because it is exposed to the LLM via the MCP manifest to explain the tool's purpose. Initialize refuses to construct the tool without one.","triggerScenarios":"A tools.yaml defines a cloudstorage-list-objects tool whose config omits the 'description' field or sets it to an empty string; Initialize is called during server startup or config loading.","commonSituations":"Hand-editing tools.yaml and forgetting the description; copying a minimal example that omitted it; templating tools where an empty variable was interpolated into the description field.","solutions":["Add a non-empty 'description' field to the cloudstorage-list-objects tool config in tools.yaml","Verify the rendered YAML actually contains the description (check template/variable interpolation)","Restart/reload the toolbox server so the config is re-validated"],"exampleFix":"// before\nsources:\n  my-gcs:\n    kind: cloud-storage\ntools:\n  list-objects:\n    kind: cloudstorage-list-objects\n    source: my-gcs\n// after\nsources:\n  my-gcs:\n    kind: cloud-storage\ntools:\n  list-objects:\n    kind: cloudstorage-list-objects\n    source: my-gcs\n    description: List objects in a Cloud Storage bucket with pagination","handlingStrategy":"validation","validationCode":"func validateListObjectsConfig(name, description string) error {\n    if description == \"\" {\n        return fmt.Errorf(\"tool %q: description is required before loading tools.yaml\", name)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include a description in every tool definition in tools.yaml","Add a config linter/CI check that asserts description is non-empty for each tool","Use schema validation for tools.yaml before starting the server"],"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"}