{"record":{"id":"e0464454e39c0df7","repo":"googleapis/mcp-toolbox","slug":"bucket-cannot-be-empty-for-tool-q-e04644","errorCode":null,"errorMessage":"bucket cannot be empty for tool %q","messagePattern":"bucket cannot be empty for tool %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/cloudstorage/cloudstoragemoveobject/cloudstoragemoveobject.go","lineNumber":75,"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}\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\tsourceObjectParam := parameters.NewStringParameter(sourceObjectKey, \"Full source object name (path) within the bucket, e.g. 'path/to/file.txt'.\")\n\tdestinationObjectParam := parameters.NewStringParameter(destinationObjectKey, \"Full destination object name (path) within the same bucket, e.g. 'path/to/file.txt'.\")\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 to move.\"))\n\t}\n\tallParameters = append(allParameters, sourceObjectParam, destinationObjectParam)\n\n\treturn Tool{\n\t\tBaseTool: tools.NewBaseTool(\n\t\t\tcfg,\n\t\t\ttools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewDestructiveAnnotations),\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":57,"sourceCodeEnd":93,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudstorage/cloudstoragemoveobject/cloudstoragemoveobject.go#L57-L93","documentation":"Thrown by cloudstorage-move-object Config.Initialize when the optional 'bucket' field is present but an empty string. Because move-object requires source and destination objects to be in the same bucket, a configured bucket must be a real bucket name; an empty one is rejected.","triggerScenarios":"tools.yaml sets `bucket: \"\"` or an empty-expanded variable for a cloudstorage-move-object tool.","commonSituations":"Missing environment variable for bucket name; clearing the bucket value intending to unset the field; YAML quoting mistakes.","solutions":["Delete the 'bucket' key from the tool config to make it a per-call parameter instead","Provide a valid non-empty bucket name in the config","Fix the env var/secret feeding the value so it is no longer empty"],"exampleFix":"// before\n  move-object:\n    kind: cloudstorage-move-object\n    source: my-gcs\n    description: Move object\n    bucket: \"\"\n// after\n  move-object:\n    kind: cloudstorage-move-object\n    source: my-gcs\n    description: Move object\n    bucket: my-bucket","handlingStrategy":"validation","validationCode":"if v, ok := cfg[\"bucket\"]; ok {\n    if s, isStr := v.(string); isStr && s == \"\" {\n        return errors.New(\"bucket configured as empty string; unset it or supply a name\")\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat empty-string env expansions as failures in your deployment pipeline","Prefer omitting optional fields over setting them to empty values","Lint tools.yaml for empty required-if-present fields"],"tags":["go","configuration","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-08T15:18:49.778Z"}