{"record":{"id":"1ab335e79cb14685","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-1ab335","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/firestoregetdocuments/firestoregetdocuments.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 retrieve 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.NewReadOnlyAnnotations),\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/firestoregetdocuments/firestoregetdocuments.go#L51-L87","documentation":"Config.Initialize validates that every tool has a non-empty description before building the tool. Descriptions are required because they become the MCP tool metadata that LLM clients rely on. An empty string fails fast at config-load time rather than producing an undescribable tool.","triggerScenarios":"Loading a YAML/tool config where a firestore-get-documents tool declares no `description:` field (or sets it to \"\").","commonSituations":"Hand-written tool configs that omit the description key; templated configs where an env-var interpolation for the description resolved to empty.","solutions":["Add a non-empty `description:` field to the firestore-get-documents tool config.","If using environment substitution, confirm the variable (e.g., ${TOOL_DESCRIPTION}) is set and non-empty."],"exampleFix":"// before\ntools:\n  get_docs:\n    kind: firestore-get-documents\n    source: my-firestore\n// after\ntools:\n  get_docs:\n    kind: firestore-get-documents\n    source: my-firestore\n    description: Retrieve documents from Firestore by relative paths","handlingStrategy":"validation","validationCode":"for name, t := range cfg.Tools {\n\tif t.Kind == \"firestore-get-documents\" && strings.TrimSpace(t.Description) == \"\" {\n\t\treturn fmt.Errorf(\"tool %q: description is required\", name)\n\t}\n}","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n\t// missing/empty description\n\tlog.Printf(\"tool config incomplete: %v\", err)\n\treturn err\n}","preventionTips":["Always include a description for every tool in YAML; treat it as required metadata.","Lint tool configs to fail CI when `description` is absent or blank.","Avoid env-interpolated descriptions unless the variable has a non-empty default."],"tags":["firestore","config","missing-field"],"backgroundTag":"missing-description-field","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"}