googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

cloudstorage-get-object-metadata's Config.Initialize enforces a non-empty description, returning this error when cfg.Description is empty. Like all toolbox tools, the description is required because it tells the LLM when and how to use the tool.

Source

Thrown at internal/tools/cloudstorage/cloudstoragegetobjectmetadata/cloudstoragegetobjectmetadata.go:73

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'.")
	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)

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

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a `description` field explaining what the tool does.
  2. Confirm templating produced a non-empty value.
  3. Validate tool configs programmatically before starting the server.

Example fix

# before
get_object_metadata:
  kind: cloudstorage-get-object-metadata
  bucket: my-bucket
# after
get_object_metadata:
  kind: cloudstorage-get-object-metadata
  bucket: my-bucket
  description: Gets metadata (size, content type) for a specific object in a GCS 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-object-metadata tool config with `description` missing or empty string.

Common situations: Omitting description in hand-authored YAML; blank value after templating/env substitution; copying a config snippet that trimmed optional-looking 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/dc5f56b73117acf0. Report an issue: GitHub.