{"record":{"id":"04692bc8feca1a8b","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-04692b","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/lookeradddashboardfilter/lookeradddashboardfilter.go","lineNumber":71,"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\tparams := parameters.Parameters{}\n\n\tdashIdParameter := parameters.NewStringParameter(\"dashboard_id\", \"The id of the dashboard where this filter will exist\")\n\tparams = append(params, dashIdParameter)\n\tnameParameter := parameters.NewStringParameter(\"name\", \"The name of the Dashboard Filter\")\n\tparams = append(params, nameParameter)\n\ttitleParameter := parameters.NewStringParameter(\"title\", \"The title of the Dashboard Filter\")\n\tparams = append(params, titleParameter)\n\tfilterTypeParameter := parameters.NewStringParameter(\"filter_type\", \"The filter_type of the Dashboard Filter: date_filter, number_filter, string_filter, field_filter (default field_filter)\", parameters.WithStringDefault(\"field_filter\"))\n\tparams = append(params, filterTypeParameter)\n\tdefaultParameter := parameters.NewStringParameter(\"default_value\", \"The default_value of the Dashboard Filter (optional)\", parameters.WithStringRequired(false))\n\tparams = append(params, defaultParameter)\n\tmodelParameter := parameters.NewStringParameter(\"model\", \"The model of a field type Dashboard Filter (required if type field)\", parameters.WithStringRequired(false))\n\tparams = append(params, modelParameter)\n\texploreParameter := parameters.NewStringParameter(\"explore\", \"The explore of a field type Dashboard Filter (required if type field)\", parameters.WithStringRequired(false))\n\tparams = append(params, exploreParameter)","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookeradddashboardfilter/lookeradddashboardfilter.go#L53-L89","documentation":"Initialize() for the looker-add-dashboard-filter tool refuses to construct the tool when the Config's Description field is empty. Tool descriptions are required so LLM clients can understand when to invoke the tool; the toolbox treats a missing description as a configuration error at startup rather than a runtime failure.","triggerScenarios":"Declaring a tool YAML/config with type looker-add-dashboard-filter but omitting the 'description' field (or setting it to an empty string), then loading it so Config.Initialize runs.","commonSituations":"Hand-written tools.yaml where the description key was forgotten; templated config generation that drops empty fields; copying a tool definition and deleting the description.","solutions":["Add a non-empty 'description' field to the tool's config block in your YAML.","Verify the Config struct unmarshalling maps your YAML key correctly to the Description field.","If generating configs programmatically, validate Description != \"\" before calling Initialize."],"exampleFix":"// before\ntools:\n  add-dashboard-filter:\n    kind: looker-add-dashboard-filter\n    source: my-looker\n// after\ntools:\n  add-dashboard-filter:\n    kind: looker-add-dashboard-filter\n    source: my-looker\n    description: Add a filter to a Looker dashboard\n","handlingStrategy":"validation","validationCode":"// Pre-validate your tools.yaml / config before loading\nif cfg.Description == \"\" {\n    return fmt.Errorf(\"tool %q needs a description\", cfg.Name)\n}","typeGuard":null,"tryCatchPattern":"if err := tool.Init(ctx); err != nil {\n    if strings.Contains(err.Error(), \"description is required\") {\n        // fix the config and retry\n    }\n}","preventionTips":["Always set description in every tool definition; lint your YAML for empty required keys.","Use JSON schema validation on tools.yaml in CI to catch missing description early.","Never generate tool configs that silently drop empty fields."],"tags":["config","validation","looker"],"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"}