{"record":{"id":"e112807e68815bd5","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-e11280","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/lookerupdatedashboardelement/lookerupdatedashboardelement.go","lineNumber":72,"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 := lookercommon.GetQueryParameters()\n\n\tdashboardIdParam := parameters.NewStringParameter(\"dashboard_id\", \"The ID of the dashboard containing the element.\")\n\tparams = append(params, dashboardIdParam)\n\telementIdParam := parameters.NewStringParameter(\"dashboard_element_id\", \"The ID of the dashboard element to update.\")\n\tparams = append(params, elementIdParam)\n\ttitleParam := parameters.NewStringParameter(\"title\", \"The new title of the element.\", parameters.WithStringDefault(\"\"))\n\tparams = append(params, titleParam)\n\tvisConfigParam := parameters.NewMapParameter(\"vis_config\", \"The new visualization configuration.\", \"\", parameters.WithMapDefault(map[string]any{}))\n\tparams = append(params, visConfigParam)\n\n\tdashFilters := parameters.NewArrayParameter(\n\t\t\"dashboard_filters\",\n\t\t`An array of dashboard filters like [{\"dashboard_filter_name\": \"name\", \"field\": \"view_name.field_name\"}, ...]`,\n\t\tparameters.NewMapParameter(\n\t\t\t\"dashboard_filter\",","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookerupdatedashboardelement/lookerupdatedashboardelement.go#L54-L90","documentation":"Initialize for the looker-update-dashboard-element tool rejects configs with an empty `description`. The description is mandatory because it is exposed to MCP clients as the tool's usage documentation; registration is aborted with this error otherwise.","triggerScenarios":"A tool definition of kind looker-update-dashboard-element lacks `description:` (or it is empty string) when Initialize runs during config load.","commonSituations":"Omitting description while hand-editing tools.yaml; config generators dropping empty fields; copying a tool block and deleting the description line.","solutions":["Add a descriptive `description:` string to the tool entry","Fix the generating template so description is always emitted","Pre-validate configs for required fields before server start"],"exampleFix":"// before\ntools:\n  update_dashboard_element:\n    kind: looker-update-dashboard-element\n    source: my-looker-source\n// after\ntools:\n  update_dashboard_element:\n    kind: looker-update-dashboard-element\n    source: my-looker-source\n    description: Update a dashboard element's properties in Looker.","handlingStrategy":"validation","validationCode":"if cfg.Description == \"\" {\n    return errors.New(\"looker-update-dashboard-element tool requires a non-empty description\")\n}","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), \"description is required\") {\n        return fmt.Errorf(\"add `description` to tool %q in tools.yaml\", cfg.Name)\n    }\n    return err\n}","preventionTips":["Add a schema check in CI that every tool entry has a non-empty description","Use config templates that require description explicitly","Review diffs of tools.yaml for removed description lines"],"tags":["go","looker","config-validation","missing-field"],"backgroundTag":"missing-tool-description","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"}