googleapis/mcp-toolbox · error

description is required for tool %q

Error message

description is required for tool %q

What it means

Firestore add-documents tool configuration validation: Config.Initialize rejects the tool when its description is empty. Descriptions are required because they are published in the tool manifest consumed by MCP/LLM clients. The tool name is included in the message.

Source

Thrown at internal/tools/firestore/firestoreadddocuments/firestoreadddocuments.go:71

}

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"`
}

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

	// Create parameters
	collectionPathParameter := parameters.NewStringParameter(
		collectionPathKey,
		"The relative path of the collection where the document will be added to (e.g., 'users' or 'users/userId/posts'). Note: This is a relative path, NOT an absolute path like 'projects/{project_id}/databases/{database_id}/documents/...'",
	)

	documentDataParameter := parameters.NewMapParameter(
		documentDataKey,
		`The document data in Firestore's native JSON format. Each field must be wrapped with a type indicator:
- Strings: {"stringValue": "text"}
- Integers: {"integerValue": "123"} or {"integerValue": 123}
- Doubles: {"doubleValue": 123.45}
- Booleans: {"booleanValue": true}
- Timestamps: {"timestampValue": "2025-01-07T10:00:00Z"}
- GeoPoints: {"geoPointValue": {"latitude": 34.05, "longitude": -118.24}}
- Arrays: {"arrayValue": {"values": [{"stringValue": "item1"}, {"integerValue": "2"}]}}

View on GitHub (pinned to 8cc6e09de2)

Solutions

  1. Add a meaningful non-empty 'description' to the tool config.
  2. Verify any ${ENV_VAR} used in description is set at load time.
  3. Restart toolbox to pick up the corrected config.

Example fix

// before
  add_docs:
    kind: firestore-add-documents
    source: my-firestore
// after
  add_docs:
    kind: firestore-add-documents
    source: my-firestore
    description: Adds one or more documents to a Firestore collection.
Defensive patterns

Strategy: validation

Validate before calling

# Config lint before load
for name, t in cfg['tools'].items():
    if t.get('kind') == 'firestore-add-documents' and not t.get('description'):
        raise SystemExit(f"{name}: description required")

Try / catch

if err != nil {
    if strings.Contains(err.Error(), "description is required") {
        log.Fatalf("add description for tool: %v", err)
    }
    return err
}

Prevention

When it happens

Trigger: A firestore-add-documents tool entry in the YAML config lacks 'description' or has an empty one, and the config is loaded/initialized.

Common situations: Omitting description when adding new tools; empty substitution from environment variables; migrating configs and dropping fields.

Related errors


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