{"record":{"id":"ffc19adf814fbc61","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-ffc19a","errorCode":null,"errorMessage":"description is required for tool %q","messagePattern":"description is required for tool %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/tools/firestore/firestoreadddocuments/firestoreadddocuments.go","lineNumber":71,"sourceCode":"}\n\ntype Config struct {\n\ttools.ConfigBase `yaml:\",inline\"`\n\tType             string                 `yaml:\"type\" validate:\"required\"`\n\tSource           string                 `yaml:\"source\" validate:\"required\"`\n\tAnnotations      *tools.ToolAnnotations `yaml:\"annotations,omitempty\"`\n}\n\n// validate interface\nvar _ tools.ToolConfig = Config{}\n\nfunc (cfg Config) ToolConfigType() string {\n\treturn resourceType\n}\n\nfunc (cfg Config) Initialize(context.Context) (tools.Tool, error) {\n\tif cfg.Description == \"\" {\n\t\treturn nil, fmt.Errorf(\"description is required for tool %q\", cfg.Name)\n\t}\n\n\t// Create parameters\n\tcollectionPathParameter := parameters.NewStringParameter(\n\t\tcollectionPathKey,\n\t\t\"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/...'\",\n\t)\n\n\tdocumentDataParameter := parameters.NewMapParameter(\n\t\tdocumentDataKey,\n\t\t`The document data in Firestore's native JSON format. Each field must be wrapped with a type indicator:\n- Strings: {\"stringValue\": \"text\"}\n- Integers: {\"integerValue\": \"123\"} or {\"integerValue\": 123}\n- Doubles: {\"doubleValue\": 123.45}\n- Booleans: {\"booleanValue\": true}\n- Timestamps: {\"timestampValue\": \"2025-01-07T10:00:00Z\"}\n- GeoPoints: {\"geoPointValue\": {\"latitude\": 34.05, \"longitude\": -118.24}}\n- Arrays: {\"arrayValue\": {\"values\": [{\"stringValue\": \"item1\"}, {\"integerValue\": \"2\"}]}}","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firestore/firestoreadddocuments/firestoreadddocuments.go#L53-L89","documentation":"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.","triggerScenarios":"A firestore-add-documents tool entry in the YAML config lacks 'description' or has an empty one, and the config is loaded/initialized.","commonSituations":"Omitting description when adding new tools; empty substitution from environment variables; migrating configs and dropping fields.","solutions":["Add a meaningful non-empty 'description' to the tool config.","Verify any ${ENV_VAR} used in description is set at load time.","Restart toolbox to pick up the corrected config."],"exampleFix":"// before\n  add_docs:\n    kind: firestore-add-documents\n    source: my-firestore\n// after\n  add_docs:\n    kind: firestore-add-documents\n    source: my-firestore\n    description: Adds one or more documents to a Firestore collection.","handlingStrategy":"validation","validationCode":"# Config lint before load\nfor name, t in cfg['tools'].items():\n    if t.get('kind') == 'firestore-add-documents' and not t.get('description'):\n        raise SystemExit(f\"{name}: description required\")","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if strings.Contains(err.Error(), \"description is required\") {\n        log.Fatalf(\"add description for tool: %v\", err)\n    }\n    return err\n}","preventionTips":["Never omit description in Firestore tool configs.","Verify env vars used in descriptions are set.","Automate config validation in CI.","Review diff of generated configs for dropped fields."],"tags":["firestore","config","validation"],"backgroundTag":"tool-description-required","analyzedSha":"8cc6e09de2ad7b8bffc77751799585a1401a48eb","analyzedAt":"2026-09-05T01:10:36.887Z","contentChangedAt":"2026-09-05T01:10:36.887Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}