{"record":{"id":"2c2cdfc2d16950d5","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-2c2cdf","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/cloudstoragecreatebucket/cloudstoragecreatebucket.go","lineNumber":75,"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\tLocation                 *string                `yaml:\"location,omitempty\"`\n\tUniformBucketLevelAccess *bool                  `yaml:\"uniform_bucket_level_access,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\n\tbucketParam := parameters.NewStringParameter(bucketKey, \"Name of the Cloud Storage bucket to create.\")\n\tallParameters := parameters.Parameters{bucketParam}\n\tif cfg.Project == nil {\n\t\tallParameters = append(allParameters, parameters.NewStringParameter(projectKey, \"Project ID to create the bucket in. When empty, the source's configured project is used.\", parameters.WithStringDefault(\"\")))\n\t}\n\tif cfg.Location == nil {\n\t\tallParameters = append(allParameters, parameters.NewStringParameter(locationKey, \"Location for the bucket, e.g. 'US', 'EU', or 'us-central1'. Omit to use the Cloud Storage service default.\", parameters.WithStringRequired(false)))\n\t}\n\tif cfg.UniformBucketLevelAccess == nil {\n\t\tallParameters = append(allParameters, parameters.NewBooleanParameter(uniformBucketLevelAccessKey, \"Whether to enable uniform bucket-level access on the bucket.\", parameters.WithBooleanDefault(false)))\n\t}\n\n\treturn Tool{\n\t\tBaseTool: tools.NewBaseTool(\n\t\t\tcfg,\n\t\t\ttools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewDestructiveAnnotations),","sourceCodeStart":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudstorage/cloudstoragecreatebucket/cloudstoragecreatebucket.go#L57-L93","documentation":"cloud-storage-createbucket's Config.Initialize requires a non-empty description for the tool. Like all MCP tools, the description is surfaced to the LLM and is mandatory; an empty one aborts tool construction at config-load time.","triggerScenarios":"Defining a create_bucket tool in tools.yaml without the `description` field, causing Initialize to fail when the server loads the config.","commonSituations":"Omitting description while hand-authoring YAML; a code generator emitting empty strings for optional-looking fields; YAML indentation mistakes hiding the description key.","solutions":["Add a meaningful `description` to the create_bucket tool block","Validate the tools.yaml in CI before deploying","Re-run the server and confirm the tool loads without error"],"exampleFix":"// before\n- name: create_bucket\n  source: my-gcs\n// after\n- name: create_bucket\n  source: my-gcs\n  description: Creates a new Cloud Storage bucket in the given project","handlingStrategy":"validation","validationCode":"func validateCreateBucketTool(cfg map[string]any) error {\n    d, _ := cfg[\"description\"].(string)\n    if strings.TrimSpace(d) == \"\" {\n        return fmt.Errorf(\"tool %v: description is required\", cfg[\"name\"])\n    }\n    return nil\n}","typeGuard":"func hasDescription(cfg Config) bool { return cfg.Description != \"\" }","tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil && strings.Contains(err.Error(), \"description is required\") {\n    return fmt.Errorf(\"add description to create_bucket in tools.yaml: %w\", err)\n}","preventionTips":["Document each tool with a clear LLM-facing description at authoring time","CI-lint tools.yaml for mandatory fields","Keep prebuilt config blocks as canonical examples","Watch YAML indentation so description lands under the tool node"],"tags":["config","validation","yaml","cloud-storage"],"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"}