{"record":{"id":"500df0d2c53fa540","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-500df0","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/lookergetdashboards/lookergetdashboards.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\ttitleParameter := parameters.NewStringParameter(\"title\", \"The title of the dashboard.\", parameters.WithStringDefault(\"\"))\n\tdescParameter := parameters.NewStringParameter(\"desc\", \"The description of the dashboard.\", parameters.WithStringDefault(\"\"))\n\tlimitParameter := parameters.NewIntParameter(\"limit\", \"The number of dashboards to fetch. Default 100\", parameters.WithIntDefault(100))\n\toffsetParameter := parameters.NewIntParameter(\"offset\", \"The number of dashboards to skip before fetching. Default 0\", parameters.WithIntDefault(0))\n\tparams := parameters.Parameters{\n\t\ttitleParameter,\n\t\tdescParameter,\n\t\tlimitParameter,\n\t\toffsetParameter,\n\t}\n\n\t// finish tool setup\n\treturn Tool{\n\t\tBaseTool: tools.NewBaseTool(\n\t\t\tcfg,\n\t\t\ttools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewReadOnlyAnnotations),","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookergetdashboards/lookergetdashboards.go#L53-L89","documentation":"During looker-get-dashboards Config.Initialize, a guard rejects configurations whose `description` field is empty. The description becomes the tool's manifest description that MCP/LLM clients rely on, so an empty one makes the tool config invalid and initialization aborts.","triggerScenarios":"Loading a tools.yaml with a tool of kind looker-get-dashboards that has no `description` field, or building the Config in Go with Name set but Description empty and calling Initialize.","commonSituations":"Hand-edited YAML omitting the description; description indented under the wrong key; config generators/templating producing an empty string.","solutions":["Add a non-empty `description` to the looker-get-dashboards tool entry in tools.yaml.","Check YAML indentation so `description` is a child of the tool, not a sibling.","When constructing configs programmatically, set cfg.Description before calling Initialize.","Run `toolbox validate` in CI to catch missing descriptions before serving."],"exampleFix":"// before (tools.yaml)\n  get-dashboards:\n    kind: looker-get-dashboards\n    source: my-looker\n// after\n  get-dashboards:\n    kind: looker-get-dashboards\n    source: my-looker\n    description: Searches and lists Looker dashboards by title or description.","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(cfg.Description) == \"\" {\n    return errors.New(\"tool 'get-dashboards': description is required\")\n}","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n    log.Fatalf(\"invalid looker-get-dashboards config: %v\", err)\n}","preventionTips":["Give every tool entry a description in tools.yaml.","Run `toolbox validate` in CI to catch missing descriptions.","Lint YAML configs for required keys (name, kind, source, description).","Avoid generators that omit optional description fields."],"tags":["go","looker","mcp-toolbox","config-validation"],"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"}