{"record":{"id":"8f18e1c5fc3cf9bf","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-8f18e1","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/firestoremongodb/firestoremongodbgetschema/firestoremongodbgetschema.go","lineNumber":68,"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\temptyString := \"\"\n\tcollectionParam := parameters.NewStringParameter(collectionKey, \"Optional name or path of a specific collection to get schema for. If omitted, schemas for all root collections are returned.\", parameters.WithStringDefault(emptyString))\n\tparams := parameters.Parameters{collectionParam}\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{}","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/firestoremongodb/firestoremongodbgetschema/firestoremongodbgetschema.go#L50-L86","documentation":"Every tool in MCP Toolbox must carry a non-empty description, which is exposed to LLM clients in the tool manifest. Config.Initialize returns this error at startup when a firestore-mongodb-get-schema tool is defined without a description field.","triggerScenarios":"A tools.yaml entry of type \"firestore-mongodb-get-schema\" omits the \"description\" field or sets it to an empty string; Initialize() then fails while building the tool.","commonSituations":"Hand-writing YAML and skipping the description; a templating pipeline that emits an empty description; YAML indentation mistakes that place description under the wrong key so it never unmarshals into the Config.","solutions":["Add a non-empty \"description\" field to the tool in tools.yaml.","Verify YAML indentation so \"description\" is a direct child of the tool entry, not nested under another key.","If generating configs programmatically, validate that description is non-empty before writing the YAML."],"exampleFix":"# before\nmy-tool:\n  type: firestore-mongodb-get-schema\n  source: my-src\n# after\nmy-tool:\n  type: firestore-mongodb-get-schema\n  source: my-src\n  description: Get schemas for Firestore collections via MongoDB API","handlingStrategy":"validation","validationCode":"// Pre-flight check on parsed tool config\nif tool.Description == \"\" {\n    return fmt.Errorf(\"tool %q is missing a description\", tool.Name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include a description when adding any tool block to tools.yaml","Run a YAML linter that enforces required fields on tool entries","Watch for indentation errors that silently drop the description key"],"tags":["go","config","validation"],"backgroundTag":"missing-required-config-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"}