{"record":{"id":"c365d52adbed0e5e","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-c365d5","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/lookerupdateagent/lookerupdateagent.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\tagentIdParameter := parameters.NewStringParameter(\"agent_id\", \"The ID of the agent.\", parameters.WithStringDefault(\"\"))\n\tnameParameter := parameters.NewStringParameter(\"name\", \"The name of the agent.\", parameters.WithStringDefault(\"\"))\n\tdescriptionParameter := parameters.NewStringParameter(\"description\", \"The description of the agent.\", parameters.WithStringDefault(\"\"))\n\tinstructionsParameter := parameters.NewStringParameter(\"instructions\", \"The instructions (system prompt) for the agent.\", parameters.WithStringDefault(\"\"))\n\tsourcesParameter := parameters.NewArrayParameter(\n\t\t\"sources\",\n\t\t\"Optional. A list of JSON-encoded data sources for the agent (e.g., [{\\\"model\\\": \\\"my_model\\\", \\\"explore\\\": \\\"my_explore\\\"}]).\",\n\t\tparameters.NewMapParameter(\n\t\t\t\"source\",\n\t\t\t\"A JSON-encoded source object with 'model' and 'explore' keys.\",\n\t\t\t\"string\",\n\t\t),\n\t\tparameters.WithArrayRequired(false),\n\t)\n\tcodeInterpreterParameter := parameters.NewBooleanParameter(\"code_interpreter\", \"Optional. Enables Code Interpreter for this Agent.\", parameters.WithBooleanDefault(false))\n\tallParameters := parameters.Parameters{agentIdParameter, nameParameter, descriptionParameter, instructionsParameter, sourcesParameter, codeInterpreterParameter}","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookerupdateagent/lookerupdateagent.go#L53-L89","documentation":"Config.Initialize for the looker-update-agent tool validates that the tool definition includes a non-empty `description` before building parameters. The description is required because it becomes the tool's public documentation surfaced to LLM clients via MCP; without it the tool cannot be registered.","triggerScenarios":"A tools.yaml (or API-constructed) Config for kind looker-update-agent has no `description:` field or an empty string, then Initialize is invoked during server startup or config parsing.","commonSituations":"Hand-writing a tool entry and omitting description; templating that renders an empty description; migrating configs from an older format where description was optional.","solutions":["Add a non-empty `description:` to the looker-update-agent tool definition in your config","If generated, fix the template/serialization so the description field is populated","Run a config lint/pre-check that asserts every tool entry has description before calling Initialize"],"exampleFix":"// before (tools.yaml)\ntools:\n  update_agent:\n    kind: looker-update-agent\n    source: my-looker-source\n// after\ntools:\n  update_agent:\n    kind: looker-update-agent\n    source: my-looker-source\n    description: Update fields of a Looker agent by ID.","handlingStrategy":"validation","validationCode":"if cfg.Description == \"\" {\n    return errors.New(\"looker-update-agent tool requires a non-empty description\")\n}","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), \"description is required\") {\n        return fmt.Errorf(\"config error: set `description` for tool %q\", cfg.Name)\n    }\n    return err\n}","preventionTips":["Include a description line in every tool YAML template","Lint tools.yaml for required fields (name, kind, source, description) in CI","Never copy tool blocks without re-checking description"],"tags":["go","looker","config-validation","missing-field"],"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"}