googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

Thrown by cloudstorage-read-object Config.Initialize when the tool's description is missing or empty. The toolbox requires a description for every tool so the MCP manifest can tell the LLM what the tool does.

Source

Thrown at internal/tools/cloudstorage/cloudstoragereadobject/cloudstoragereadobject.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"`
	Bucket           *string                `yaml:"bucket,omitempty"`
}

// validate interface
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)
	}

	objectParam := parameters.NewStringParameter(objectKey, "Full object name (path) within the bucket, e.g. 'path/to/file.txt'.")
	rangeParam := parameters.NewStringParameter(rangeKey, "Optional HTTP byte range, e.g. 'bytes=0-999' (first 1000 bytes), 'bytes=-500' (last 500 bytes), or 'bytes=500-' (from byte 500 to end). Empty reads the full object.", parameters.WithStringDefault(""))
	allParameters := parameters.Parameters{}
	if cfg.Bucket == nil {
		allParameters = append(allParameters, parameters.NewStringParameter(bucketKey, "Name of the Cloud Storage bucket containing the object."))
	}
	allParameters = append(allParameters, objectParam, rangeParam)

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

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a non-empty 'description' to the tool config
  2. Verify rendered YAML contains the description if using templates/env substitution
  3. Restart the toolbox and confirm the tool loads

Example fix

// before
  read-object:
    kind: cloudstorage-read-object
    source: my-gcs
// after
  read-object:
    kind: cloudstorage-read-object
    source: my-gcs
    description: Read the contents of a Cloud Storage object, optionally by byte range
Defensive patterns

Strategy: validation

Validate before calling

if strings.TrimSpace(description) == "" {
    return errors.New("cloudstorage-read-object tool requires a non-empty description")
}

Prevention

When it happens

Trigger: A cloudstorage-read-object tool in tools.yaml lacks the 'description' field or has `description: ""`; Initialize runs during startup/config parsing.

Common situations: Omitting the description while experimenting with the read-object tool; empty template variables in generated configs; truncation when copying YAML.

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/24f7438e888e594b. Report an issue: GitHub.