googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

Configuration-time validation in Initialize: the cloudstorage-write-object tool entry in tools.yaml omits its description, which Toolbox requires for every registered tool's manifest.

Source

Thrown at internal/tools/cloudstorage/cloudstoragewriteobject/cloudstoragewriteobject.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"`
}

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'.")
	contentParam := parameters.NewStringParameter(contentKey, "Text content to write to the Cloud Storage object.")
	contentTypeParam := parameters.NewStringParameter(contentTypeKey, "MIME type to record on the written object. When empty, Cloud Storage auto-detects from the first 512 bytes of content.", parameters.WithStringDefault(""))
	allParameters := parameters.Parameters{}
	if cfg.Bucket == nil {
		allParameters = append(allParameters, parameters.NewStringParameter(bucketKey, "Name of the Cloud Storage bucket to write into."))
	}
	allParameters = append(allParameters, objectParam, contentParam, contentTypeParam)

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

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a non-empty description to the tool entry in tools.yaml
  2. Check YAML indentation so description parses as a string rather than null
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/tools/cloudstorage/cloudstoragewriteobject/cloudstoragewriteobject.go:73 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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