{"record":{"id":"efdaa30ccfd6e087","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-efdaa3","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/lookergetconnections/lookergetconnections.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\tparams := parameters.Parameters{}\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),\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\nvar _ tools.Tool = Tool{}\n","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookergetconnections/lookergetconnections.go#L53-L89","documentation":"MCP toolbox tools require a human-readable `description` field; it is what the LLM sees in the tool manifest. `Config.Initialize` validates this eagerly and refuses to construct the tool when the description is empty.","triggerScenarios":"Calling Config.Initialize on a looker-get-connections tool whose `description` field in the tool config is absent or set to \"\".","commonSituations":"Hand-edited tools.yaml where the description line was deleted; programmatically-built Config structs that leave Description zero-valued; copy-pasting a tool entry and forgetting to fill in the description.","solutions":["Add a non-empty `description:` to the tool entry in tools.yaml","If constructing Config in Go, set cfg.Description before calling Initialize","Validate the whole config with the toolbox CLI (e.g. `toolbox --tools-file tools.yaml --prebuilt` dry run) to surface all such validation errors at once"],"exampleFix":"// before\ntools:\n  list-conns:\n    kind: looker-get-connections\n    source: my-looker\n// after\ntools:\n  list-conns:\n    kind: looker-get-connections\n    source: my-looker\n    description: Fetches Looker database connections.","handlingStrategy":"validation","validationCode":"if cfg.Description == \"\" {\n    return fmt.Errorf(\"tool %q: description must be set before Initialize\", cfg.Name)\n}\n_ = cfg.Initialize(context.Background())","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil && strings.Contains(err.Error(), \"description is required\") {\n    // fix the tool config entry and retry\n    return fmt.Errorf(\"config error for %s: %w\", cfg.Name, err)\n}","preventionTips":["Always include a `description:` line for every tool in tools.yaml","Run toolbox config validation in CI before deploying","When generating configs from templates, assert every tool has a non-empty description"],"tags":["go","looker","config-validation","missing-field"],"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"}