{"record":{"id":"67e2ee27a06bb52e","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-67e2ee","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/cloudgda/cloudgda.go","lineNumber":130,"sourceCode":"\ttools.ConfigBase  `yaml:\",inline\"`\n\tType              string                 `yaml:\"type\" validate:\"required\"`\n\tSource            string                 `yaml:\"source\" validate:\"required\"`\n\tLocation          string                 `yaml:\"location\" validate:\"required\"`\n\tContext           *QueryDataContext      `yaml:\"context\" validate:\"required\"`\n\tGenerationOptions *GenerationOptions     `yaml:\"generationOptions,omitempty\"`\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// Define the parameters for the Gemini Data Analytics Query API\n\t// The query is the only input parameter.\n\tallParameters := parameters.Parameters{\n\t\tparameters.NewStringParameter(\"query\", \"A natural language formulation of a database query.\", parameters.WithStringRequired(true)),\n\t}\n\t// The input and outputs are for tool guidance, usage guidance is for multi-turn interaction.\n\tguidance := Guidance\n\tcfg.Description += \"\\n\\n\" + guidance\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: allParameters.Manifest(), AuthRequired: cfg.AuthRequired},\n\t\t\tallParameters,\n\t\t),","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudgda/cloudgda.go#L112-L148","documentation":"cloudgda.Config.Initialize validates that a non-empty description was provided before constructing the tool. In this codebase the description is user-supplied in tools.yaml (the tool does not ship a default), so an empty description makes the tool un-instantiable. The error names the offending tool via cfg.Name.","triggerScenarios":"A cloudgda tool definition in tools.yaml where the description field is missing, set to an empty string, or set to \"\" via an empty YAML anchor.","commonSituations":"Writing a minimal tools.yaml and forgetting description; a templated config where description resolves to empty; YAML key misspelled (descripton) so the field stays zero-valued.","solutions":["Add a non-empty description field to the cloudgda tool's yaml block in tools.yaml","Verify the key is spelled exactly 'description' and is not an empty string","Check that YAML anchors/overrides used to build the config do not blank the field"],"exampleFix":"// before\ntools:\n  my-gda-tool:\n    kind: cloud-gemini-data-analytics-query\n    source: my-gda-source\n// after\ntools:\n  my-gda-tool:\n    kind: cloud-gemini-data-analytics-query\n    source: my-gda-source\n    description: \"Run natural language queries against BigQuery using Gemini Data Analytics\"","handlingStrategy":"validation","validationCode":"// pre-check your tools.yaml\nfunc toolHasDescription(name string, cfg map[string]map[string]any) error {\n\tt := cfg[\"tools\"][name].(map[string]any)\n\td, _ := t[\"description\"].(string)\n\tif d == \"\" { return fmt.Errorf(\"description missing for %s\", name) }\n\treturn nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set description for every tool in tools.yaml","Run the server once locally to validate config before deploying","Don't misspell the description key"],"tags":["config","validation","cloud-gemini-data-analytics"],"backgroundTag":"missing-required-argument","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"}