{"record":{"id":"898a355daba60ecf","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-898a35","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/lookergetdashboard/lookergetdashboard.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\tdashboardIdParameter := parameters.NewStringParameter(\"dashboard_id\", \"The id of the dashboard to retrieve.\")\n\tparams := parameters.Parameters{\n\t\tdashboardIdParameter,\n\t}\n\n\treturn Tool{\n\t\tBaseTool: tools.NewBaseTool(\n\t\t\tcfg,\n\t\t\ttools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewReadOnlyAnnotations),\n\t\t\ttools.Manifest{Description: cfg.Description, Parameters: params.Manifest(), AuthRequired: cfg.AuthRequired},\n\t\t\tparams,\n\t\t),\n\t}, nil\n}\n\n// validate interface","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookergetdashboard/lookergetdashboard.go#L53-L89","documentation":"looker-get-dashboard's Config.Initialize rejects configs with an empty description because tool descriptions are required metadata consumed by the LLM via the MCP manifest. An empty description means the tool definition is incomplete, so initialization fails instead of producing a tool with no usable documentation.","triggerScenarios":"Calling Initialize at startup with a looker-get-dashboard tool config whose description key is missing or set to an empty string (including when templating resolves to empty).","commonSituations":"Hand-written tools.yaml missing the description; environment-variable/param substitution yielding an empty string; trimmed-down example configs; automation that generates tool blocks without descriptions.","solutions":["Add a non-empty description to the looker-get-dashboard tool entry.","Ensure templated/variable descriptions actually resolve to non-empty values at load time.","Pre-validate configs (schema or startup dry-run) to catch empty required fields.","Copy the documented looker-get-dashboard example config including its description."],"exampleFix":"# before\ntools:\n  get-dashboard:\n    kind: looker-get-dashboard\n    source: my-looker\n    description: \"\"\n# after\ntools:\n  get-dashboard:\n    kind: looker-get-dashboard\n    source: my-looker\n    description: Retrieves a Looker dashboard by its ID.","handlingStrategy":"validation","validationCode":"// pre-load validation of the YAML config\nfor name, tool := range toolsCfg {\n    if tool.Description == \"\" {\n        return fmt.Errorf(\"tool %q: description is required\", name)\n    }\n}","typeGuard":"func validDashboardToolConfig(c lookergetdashboard.Config) bool {\n    return c.Name != \"\" && c.Description != \"\"\n}","tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n    log.Fatalf(\"looker-get-dashboard config invalid: %v\", err)\n}","preventionTips":["Never omit the description field in tool definitions.","Add CI linting that rejects empty required config fields.","Check that env-based templating fills descriptions non-emptily.","Start from the documented looker-get-dashboard example."],"tags":["go","looker","config-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"}