{"record":{"id":"b7ad1a1b9a85f27e","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-b7ad1a","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/lookerhealthvacuum/lookerhealthvacuum.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 vacuum action to run. Can be 'models', or 'explores'.\", parameters.WithStringRequired(true))\n\tprojectParameter := parameters.NewStringParameter(\"project\", \"The Looker project to vacuum (optional).\", parameters.WithStringDefault(\"\"))\n\tmodelParameter := parameters.NewStringParameter(\"model\", \"The Looker model to vacuum (optional).\", parameters.WithStringDefault(\"\"))\n\texploreParameter := parameters.NewStringParameter(\"explore\", \"The Looker explore to vacuum (optional).\", parameters.WithStringDefault(\"\"))\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(1))\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/lookerhealthvacuum/lookerhealthvacuum.go#L58-L94","documentation":"During tool initialization, the looker-health-vuum Config requires a non-empty description. The library throws this when a tool of kind looker-health-vacuum is declared without a description field, because the description is mandatory metadata for the MCP tool manifest. Initialization aborts and the toolbox fails to start (or fails to build that tool).","triggerScenarios":"cfg.Description == \"\" when Config.Initialize runs — the tool YAML omits the description field or sets it to an empty string.","commonSituations":"Hand-written toolbox.yaml missing the description key for the looker-health-vacuum tool; templating/config generation that drops empty fields; copy-pasting a tool definition without filling in the description.","solutions":["Add a non-empty description field to the looker-health-vacuum tool definition in your config","If generating config programmatically, validate that description is set before calling Initialize","Restart/rebuild the toolbox after fixing the YAML and check startup logs for the next validation error"],"exampleFix":"// before (toolbox.yaml)\ntools:\n  vacuum:\n    kind: looker-health-vacuum\n    source: my-looker\n// after\ntools:\n  vacuum:\n    kind: looker-health-vacuum\n    source: my-looker\n    description: Runs vacuum cleanup actions on Looker models or explores","handlingStrategy":"validation","validationCode":"// pre-validate config before Initialize\nif cfg.Description == \"\" {\n\treturn errors.New(\"looker-health-vacuum tool requires a description\")\n}\nif err := yaml.Unmarshal(raw, &cfg); err != nil {\n\treturn err\n}","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil && strings.Contains(err.Error(), \"description is required\") {\n\treturn fmt.Errorf(\"config error: add 'description' to tool %q: %w\", cfg.Name, err)\n}","preventionTips":["Include a description for every tool in toolbox.yaml","Run a config linter or dry-run startup in CI to catch missing fields","Template configs should emit non-empty descriptions or fail fast"],"tags":["configuration","validation","yaml"],"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"}