{"record":{"id":"b4efca0a73a05195","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-b4efca","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/lookeradddashboardelement/lookeradddashboardelement.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\tdashIdParameter := parameters.NewStringParameter(\"dashboard_id\", \"The id of the dashboard where this tile will exist\")\n\tparams = append(params, dashIdParameter)\n\ttitleParameter := parameters.NewStringParameter(\"title\", \"The title of the Dashboard Element\", parameters.WithStringDefault(\"\"))\n\tparams = append(params, titleParameter)\n\tvizParameter := parameters.NewMapParameter(\n\t\t\"vis_config\",\n\t\t\"The visualization config for the query\",\n\t\t\"\",\n\t\tparameters.WithMapDefault(map[string]any{}),\n\t)\n\n\tparams = append(params, vizParameter)\n\tdashFilters := parameters.NewArrayParameter(\n\t\t\"dashboard_filters\",","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookeradddashboardelement/lookeradddashboardelement.go#L54-L90","documentation":"Looker tools require a human-readable description at tool-initialization time. Config.Initialize returns this error when the Config's Description field is empty, because a tool cannot be registered with the MCP server without a description for the LLM.","triggerScenarios":"A tools.yaml entry for kind: looker-add-dashboard-element omits the description field or sets it to \"\" and the server starts, invoking Initialize.","commonSituations":"Minimal example configs copy-pasted without the description; YAML key misspelled (desc:, descrption:) leaving the field zero-valued; description removed during config cleanup; empty string after templating.","solutions":["Add a non-empty description field to the tool's YAML config, e.g. description: Adds an element to a Looker dashboard","Check for misspelled/indented YAML keys so the value actually lands in cfg.Description","If templated, ensure the template renders a non-empty string"],"exampleFix":"// before\nkind: looker-add-dashboard-element\nname: add_tile\nsource: looker-source\n// after\nkind: looker-add-dashboard-element\nname: add_tile\nsource: looker-source\ndescription: Adds a tile element to an existing Looker dashboard","handlingStrategy":"validation","validationCode":"if cfg.Description == \"\" {\n    return errors.New(\"description is required for looker tools\")\n}","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil && strings.Contains(err.Error(), \"description is required\") {\n    // add description to the tool entry in tools.yaml and reload\n    return err\n}","preventionTips":["Include a description for every tool block in tools.yaml","Validate tools.yaml with the toolbox config schema/CLI before server start","Watch for misspelled keys (desc/description) that leave the field empty"],"tags":["looker","configuration","validation","missing-field"],"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"}