{"record":{"id":"7af67f34fe55e89a","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-7af67f","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/lookercreateagent/lookercreateagent.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\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\n\tcodeInterpreterParameter := parameters.NewBooleanParameter(\"code_interpreter\", \"Optional. Enables Code Interpreter for this Agent.\", parameters.WithBooleanDefault(false))\n\tparams := parameters.Parameters{nameParameter, descriptionParameter, instructionsParameter, sourcesParameter, codeInterpreterParameter}","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookercreateagent/lookercreateagent.go#L53-L89","documentation":"Config.Initialize for the lookercreateagent tool validates that the required 'description' field is set in the tool's YAML configuration before constructing the tool. Because a tool's description is what the LLM sees, the library refuses to initialize a tool without one. The error includes the configured tool name so the offending YAML block is easy to find.","triggerScenarios":"Starting the toolbox (or reloading configs) with a looker-create-agent tool entry whose 'description' key is missing or set to an empty string.","commonSituations":"Hand-editing tools.yaml and omitting the description; templating that renders an empty description; converting a tool from another kind and forgetting required fields; CI config generation dropping optional-looking fields.","solutions":["Add a non-empty 'description' field to the looker-create-agent tool definition in the config YAML.","Validate the rendered config if using templating, ensuring the description is not interpolated to \"\".","Restart/reload the toolbox and confirm the tool initializes."],"exampleFix":"# before\ntools:\n  create_agent:\n    kind: looker-create-agent\n    source: my-looker-instance\n# after\ntools:\n  create_agent:\n    kind: looker-create-agent\n    source: my-looker-instance\n    description: Creates a new Looker agent with the given name, description, and instructions.","handlingStrategy":"validation","validationCode":"// Go: pre-validate tool configs before loading\ntype toolCfg struct { Kind, Description string }\nfunc validateToolCfg(c toolCfg) error {\n    if c.Kind == \"looker-create-agent\" && strings.TrimSpace(c.Description) == \"\" {\n        return fmt.Errorf(\"looker-create-agent %q: description is required\", 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(\"config error, add the missing description field: %v\", err)\n    }\n    return err\n}","preventionTips":["Always include a meaningful description for every tool in YAML.","Lint tool configs in CI to reject empty/missing required fields.","Careful with templating: assert interpolated descriptions are non-empty.","Re-validate configs after migrating a tool to a different 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"}