{"record":{"id":"04321312828fff2b","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-043213","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/looker/lookerhealthanalyze/lookerhealthanalyze.go","lineNumber":76,"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\tParameters       map[string]any         `yaml:\"parameters\"`\n\tAnnotations      *tools.ToolAnnotations `yaml:\"annotations,omitempty\"`\n}\n\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\tactionParameter := parameters.NewStringParameter(\"action\", \"The analysis to run. Can be 'projects', 'models', or 'explores'.\", parameters.WithStringRequired(true))\n\tprojectParameter := parameters.NewStringParameter(\"project\", \"The Looker project to analyze (optional).\", parameters.WithStringRequired(false))\n\tmodelParameter := parameters.NewStringParameter(\"model\", \"The Looker model to analyze (optional).\", parameters.WithStringRequired(false))\n\texploreParameter := parameters.NewStringParameter(\"explore\", \"The Looker explore to analyze (optional).\", parameters.WithStringRequired(false))\n\ttimeframeParameter := parameters.NewIntParameter(\"timeframe\", \"The timeframe in days to analyze.\", parameters.WithIntDefault(90))\n\tminQueriesParameter := parameters.NewIntParameter(\"min_queries\", \"The minimum number of queries for a model or explore to be considered used.\", parameters.WithIntDefault(0))\n\n\tallParameters := parameters.Parameters{\n\t\tactionParameter,\n\t\tprojectParameter,\n\t\tmodelParameter,\n\t\texploreParameter,\n\t\ttimeframeParameter,\n\t\tminQueriesParameter,\n\t}\n","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookerhealthanalyze/lookerhealthanalyze.go#L58-L94","documentation":"Config.Initialize for the looker-health-analyze tool requires a non-empty Description field; it validates this before building parameters and fails fast with this error. The description is what the MCP server advertises to LLM clients, so an empty one makes the tool unusable. This is a configuration-time validation error, not a runtime failure.","triggerScenarios":"Declaring a looker-health-analyze tool in tools.yaml (or constructing Config in Go) without setting the description field, then calling Initialize.","commonSituations":"Hand-edited YAML where the description key was forgotten or left blank, YAML indentation issues that drop the key, or generating configs from templates that omit optional-looking fields.","solutions":["Add a non-empty description field to the looker-health-analyze tool entry in tools.yaml.","Check YAML indentation so the description is nested under the correct tool key.","Validate the config by loading the toolbox (go run . ) before deploying.","If constructing Config in code, set cfg.Description before calling Initialize."],"exampleFix":"// before (tools.yaml)\ntools:\n  my_health_analyze:\n    kind: looker-health-analyze\n    source: my-looker-instance\n// after\ntools:\n  my_health_analyze:\n    kind: looker-health-analyze\n    source: my-looker-instance\n    description: Analyzes Looker projects, models, and explores for health issues.","handlingStrategy":"validation","validationCode":"cfg := lookerhealthanalyze.Config{Name: \"my_analyze\"}\nif cfg.Description == \"\" {\n    return errors.New(\"description is required for looker-health-analyze tools\")\n}\n_, err := cfg.Initialize(context.Background())","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil && strings.Contains(err.Error(), \"description is required\") {\n    return fmt.Errorf(\"tools.yaml: add description for tool %q\", cfg.Name)\n}","preventionTips":["Always include description for every tool block in tools.yaml","Use a YAML schema/linter to enforce required fields","Copy tool entries from the official docs templates","Load the toolbox locally before deploying to catch config errors"],"tags":["go","looker","config-validation","missing-field"],"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"}