googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

The cloudstorage-get-bucket-metadata tool requires a non-empty description; Config.Initialize returns this error when cfg.Description is empty. Descriptions are surfaced to the LLM via MCP so they are mandatory for every tool.

Source

Thrown at internal/tools/cloudstorage/cloudstoragegetbucketmetadata/cloudstoragegetbucketmetadata.go:69

}

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"`
	Bucket           *string                `yaml:"bucket,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)
	}
	if cfg.Bucket != nil && *cfg.Bucket == "" {
		return nil, fmt.Errorf("bucket cannot be empty for tool %q", cfg.Name)
	}

	allParameters := parameters.Parameters{}
	if cfg.Bucket == nil {
		allParameters = append(allParameters, parameters.NewStringParameter(bucketKey, "Name of the Cloud Storage bucket to inspect."))
	}

	return Tool{
		BaseTool: tools.NewBaseTool(
			cfg,
			tools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewReadOnlyAnnotations),
			tools.Manifest{Description: cfg.Description, Parameters: allParameters.Manifest(), AuthRequired: cfg.AuthRequired},
			allParameters,
		),
	}, nil

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a meaningful `description` field to the tool config.
  2. Ensure templated configs actually substitute a non-empty description.
  3. Run config validation before server startup to catch missing fields early.

Example fix

# before
get_bucket_metadata:
  kind: cloudstorage-get-bucket-metadata
  source: my-gcs-source
# after
get_bucket_metadata:
  kind: cloudstorage-get-bucket-metadata
  source: my-gcs-source
  description: Fetches metadata for a Cloud Storage bucket.
Defensive patterns

Strategy: validation

Validate before calling

if strings.TrimSpace(cfg.Description) == "" {
    return errors.New("description is required for tool " + cfg.Name)
}

Prevention

When it happens

Trigger: Initializing a cloudstorage-get-bucket-metadata tool with `description` omitted or set to "" in the YAML config (or programmatically via Config struct).

Common situations: Minimal/hand-written tool configs missing the description field; empty string after templating; schemas from older toolbox versions lacking required fields.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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