{"record":{"id":"23ad19467aadb890","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-23ad19","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/lookerdeleteagent/lookerdeleteagent.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\tparams := parameters.Parameters{agentIdParameter}\n\n\tannotations := &tools.ToolAnnotations{}\n\tif cfg.Annotations != nil {\n\t\t*annotations = *cfg.Annotations\n\t}\n\treadOnlyHint := false\n\tdestructiveHint := true\n\tannotations.ReadOnlyHint = &readOnlyHint\n\tannotations.DestructiveHint = &destructiveHint\n\n\treturn Tool{\n\t\tBaseTool: tools.NewBaseTool(\n\t\t\tcfg,\n\t\t\tannotations,","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookerdeleteagent/lookerdeleteagent.go#L53-L89","documentation":"Initialize for the looker-deleteagent tool validates that the Config carries a non-empty Description. The description populates the tool's MCP manifest for LLM clients; an empty description means the tool definition is invalid and initialization returns this error.","triggerScenarios":"A looker-deleteagent entry in the tools YAML lacks description or has an empty value when Initialize runs during server startup or config parsing.","commonSituations":"Hand-written config missing the description key; templated config where the variable was empty; bulk-edited YAML where descriptions were dropped.","solutions":["Add a non-empty description field to the looker-deleteagent tool entry","Check the rendered config to ensure the description didn't resolve to empty","Set Description when building lookerdeleteagent.Config programmatically"],"exampleFix":"# before\ntools:\n  delete-agent:\n    kind: looker-delete-agent\n    source: my-looker\n# after\ntools:\n  delete-agent:\n    kind: looker-delete-agent\n    source: my-looker\n    description: Deletes a Looker agent by ID","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(cfg.Description) == \"\" {\n    return fmt.Errorf(\"looker-delete-agent requires a description\")\n}","typeGuard":"func validDescription(cfg lookerdeleteagent.Config) bool {\n    return strings.TrimSpace(cfg.Description) != \"\"\n}","tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), \"description is required\") {\n        // populate cfg.Description and retry\n    }\n    return err\n}","preventionTips":["Always set description in tool YAML entries","Fail fast with a config linter on empty descriptions","Give template variables for description non-empty defaults","Verify rendered configs in CI before deployment"],"tags":["go","looker","tool-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"}