googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

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.

Source

Thrown at internal/tools/cloudstorage/cloudstoragecreatebucket/cloudstoragecreatebucket.go:75

type Config struct {
	tools.ConfigBase         `yaml:",inline"`
	Type                     string                 `yaml:"type" validate:"required"`
	Source                   string                 `yaml:"source" validate:"required"`
	Annotations              *tools.ToolAnnotations `yaml:"annotations,omitempty"`
	Project                  *string                `yaml:"project,omitempty"`
	Location                 *string                `yaml:"location,omitempty"`
	UniformBucketLevelAccess *bool                  `yaml:"uniform_bucket_level_access,omitempty"`
}

var _ tools.ToolConfig = Config{}

func (cfg Config) ToolConfigType() string {
	return resourceType
}

func (cfg Config) Initialize(context.Context) (tools.Tool, error) {
	if cfg.Description == "" {
		return nil, fmt.Errorf("description is required for tool %q", cfg.Name)
	}

	bucketParam := parameters.NewStringParameter(bucketKey, "Name of the Cloud Storage bucket to create.")
	allParameters := parameters.Parameters{bucketParam}
	if cfg.Project == nil {
		allParameters = append(allParameters, parameters.NewStringParameter(projectKey, "Project ID to create the bucket in. When empty, the source's configured project is used.", parameters.WithStringDefault("")))
	}
	if cfg.Location == nil {
		allParameters = 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)))
	}
	if cfg.UniformBucketLevelAccess == nil {
		allParameters = append(allParameters, parameters.NewBooleanParameter(uniformBucketLevelAccessKey, "Whether to enable uniform bucket-level access on the bucket.", parameters.WithBooleanDefault(false)))
	}

	return Tool{
		BaseTool: tools.NewBaseTool(
			cfg,
			tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewDestructiveAnnotations),

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a meaningful `description` to the create_bucket tool block
  2. Validate the tools.yaml in CI before deploying
  3. Re-run the server and confirm the tool loads without error

Example fix

// before
- name: create_bucket
  source: my-gcs
// after
- name: create_bucket
  source: my-gcs
  description: Creates a new Cloud Storage bucket in the given project
Defensive patterns

Strategy: validation

Validate before calling

func validateCreateBucketTool(cfg map[string]any) error {
    d, _ := cfg["description"].(string)
    if strings.TrimSpace(d) == "" {
        return fmt.Errorf("tool %v: description is required", cfg["name"])
    }
    return nil
}

Type guard

func hasDescription(cfg Config) bool { return cfg.Description != "" }

Try / catch

tool, err := cfg.Initialize(ctx)
if err != nil && strings.Contains(err.Error(), "description is required") {
    return fmt.Errorf("add description to create_bucket in tools.yaml: %w", err)
}

Prevention

When it happens

Trigger: Defining a create_bucket tool in tools.yaml without the `description` field, causing Initialize to fail when the server loads the config.

Common situations: Omitting description while hand-authoring YAML; a code generator emitting empty strings for optional-looking fields; YAML indentation mistakes hiding the description key.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of googleapis/mcp-toolbox@8cc6e09de2 (2026-09-05). Data as JSON: /api/errors/2c2cdfc2d16950d5. Report an issue: GitHub.