{"record":{"id":"2f28dfdd2324b58f","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-2f28df","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/lookercreatedashboardlayout/lookercreatedashboardlayout.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\tdashboardIdParam := parameters.NewStringParameter(\"dashboard_id\", \"The ID of the dashboard to create the layout for.\")\n\tlabelParam := parameters.NewStringParameter(\"label\", \"The label (title) of the layout/tab.\")\n\ttypeParam := parameters.NewStringParameter(\"type\", \"The type of layout (e.g. 'newspaper', 'grid'). Defaults to 'newspaper'.\", parameters.WithStringDefault(\"newspaper\"))\n\tactiveParam := parameters.NewBooleanParameter(\"active\", \"Whether this layout should be active.\", parameters.WithBooleanDefault(false))\n\n\tparams := parameters.Parameters{\n\t\tdashboardIdParam,\n\t\tlabelParam,\n\t\ttypeParam,\n\t\tactiveParam,\n\t}\n\n\treturn Tool{\n\t\tBaseTool: tools.NewBaseTool(\n\t\t\tcfg,\n\t\t\ttools.GetAnnotationsOrDefault(cfg.Annotations, tools.NewWriteAnnotations),","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookercreatedashboardlayout/lookercreatedashboardlayout.go#L53-L89","documentation":"Config.Initialize for the lookercreatedashboardlayout tool enforces that a non-empty 'description' field is present in the tool configuration before constructing the tool. Descriptions are exposed to the LLM as the tool's usage guidance, so the library treats a missing one as an invalid configuration and aborts initialization. The configured tool name is included to locate the failing YAML entry.","triggerScenarios":"Starting or reloading the toolbox with a looker-create-dashboard-layout tool entry whose 'description' field is absent or empty.","commonSituations":"Omitting the description when hand-writing tools.yaml; config templating that renders an empty value; migrating tools between kinds without re-checking required fields.","solutions":["Add a non-empty 'description' to the looker-create-dashboard-layout tool definition.","Fix templating/rendering so the description is never interpolated to an empty string.","Restart the toolbox and confirm the tool initializes cleanly."],"exampleFix":"# before\ntools:\n  create_layout:\n    kind: looker-create-dashboard-layout\n    source: my-looker-instance\n# after\ntools:\n  create_layout:\n    kind: looker-create-dashboard-layout\n    source: my-looker-instance\n    description: Creates a new layout/tab for an existing Looker dashboard.","handlingStrategy":"validation","validationCode":"// Go: pre-flight required fields for this tool kind\ntype toolCfg struct { Kind, Description string }\nfunc validateDashboardLayoutCfg(c toolCfg) error {\n    if c.Kind == \"looker-create-dashboard-layout\" && strings.TrimSpace(c.Description) == \"\" {\n        return fmt.Errorf(\"%s requires a non-empty description\", c.Kind)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := toolbox.LoadConfig(ctx, cfgPath); err != nil {\n    if strings.Contains(err.Error(), \"description is required for tool\") {\n        log.Fatalf(\"add 'description' to the looker-create-dashboard-layout tool: %v\", err)\n    }\n    return err\n}","preventionTips":["Include a clear description for every tool entry in tools.yaml.","Add CI linting that fails on empty required config fields.","Guard templated configs so descriptions cannot render as empty.","Re-check required fields whenever changing a tool's kind."],"tags":["configuration","validation","looker","yaml"],"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"}