{"record":{"id":"a45595727f15ed8f","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-a45595","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/firestoredeletedocuments/firestoredeletedocuments.go","lineNumber":69,"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\tdocumentPathsParameter := parameters.NewArrayParameter(documentPathsKey, \"Array of relative document paths to delete from Firestore (e.g., 'users/userId' or 'users/userId/posts/postId'). Note: These are relative paths, NOT absolute paths like 'projects/{project_id}/databases/{database_id}/documents/...'\", parameters.NewStringParameter(\"item\", \"Relative document path\"))\n\tparams := parameters.Parameters{documentPathsParameter}\n\n\treturn Tool{\n\t\tBaseTool: tools.NewBaseTool(\n\t\t\tcfg,\n\t\t\ttools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewDestructiveAnnotations),\n\t\t\ttools.Manifest{Description: cfg.Description, Parameters: params.Manifest(), AuthRequired: cfg.AuthRequired},\n\t\t\tparams,\n\t\t),\n\t}, nil\n}\n\n// validate interface\nvar _ tools.Tool = Tool{}\n","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firestore/firestoredeletedocuments/firestoredeletedocuments.go#L51-L87","documentation":"Firestore delete-documents tool configuration validation: Config.Initialize rejects the tool when its description is empty. The description is mandatory for the LLM-facing tool manifest, and the error names the offending tool.","triggerScenarios":"Declaring a firestore-delete-documents tool without a non-empty 'description' field in the tools YAML and initializing the config.","commonSituations":"Hand-written configs missing description; templated or env-substituted descriptions resolving to empty string; bulk-generated configs omitting required fields.","solutions":["Add a non-empty 'description' field to the tool config.","Ensure env substitutions for description produce a non-empty value.","Restart the toolbox after updating the config."],"exampleFix":"// before\n  delete_docs:\n    kind: firestore-delete-documents\n    source: my-firestore\n// after\n  delete_docs:\n    kind: firestore-delete-documents\n    source: my-firestore\n    description: Deletes documents from Firestore by relative document paths.","handlingStrategy":"validation","validationCode":"# Pre-flight validation\nif not tools_cfg['delete_docs'].get('description'):\n    raise SystemExit(\"delete_docs: description is required\")","typeGuard":null,"tryCatchPattern":"if err := cfg.Initialize(ctx); err != nil {\n    if strings.Contains(err.Error(), \"description is required\") {\n        err = fmt.Errorf(\"tools.yaml fix needed: %w\", err)\n    }\n    return err\n}","preventionTips":["Include descriptions for all tool entries.","Lint configs for required fields automatically.","Avoid blank env-substituted descriptions.","Reload and test config after every edit."],"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"}