{"record":{"id":"ef1294b99fdf6146","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-ef1294","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/lookergetconnectionschemas/lookergetconnectionschemas.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\tconnParameter := parameters.NewStringParameter(\"conn\", \"The connection containing the schemas.\")\n\tdbParameter := parameters.NewStringParameter(\"db\", \"The optional database to search\", parameters.WithStringRequired(false))\n\tparams := parameters.Parameters{connParameter, dbParameter}\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","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookergetconnectionschemas/lookergetconnectionschemas.go#L53-L89","documentation":"Tool configs must carry a non-empty `description`; it is exposed to LLM clients in the MCP manifest. `Initialize` for looker-get-connection-schemas validates this and aborts tool creation when it is empty.","triggerScenarios":"Config.Initialize is called for a looker-get-connection-schemas tool whose `description` is missing/empty in the tools file or in the constructed Config struct.","commonSituations":"YAML entry omitted the description key; empty-string description from templated config generation; prebuilt config edited locally and description accidentally removed.","solutions":["Add `description:` with meaningful text to the tool entry in tools.yaml","Set Description before invoking Initialize when building Config programmatically","Lint the tools file so missing required fields are caught before deployment"],"exampleFix":"// before\ntools:\n  schemas:\n    kind: looker-get-connection-schemas\n    source: my-looker\n// after\ntools:\n  schemas:\n    kind: looker-get-connection-schemas\n    source: my-looker\n    description: Lists schemas available in a Looker connection.","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(cfg.Description) == \"\" {\n    return fmt.Errorf(\"tool %q requires a description\", cfg.Name)\n}","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), \"description is required\") {\n        cfg.Description = \"Lists Looker connection schemas.\"\n        tool, err = cfg.Initialize(ctx)\n    }\n    if err != nil { return err }\n}","preventionTips":["Treat description as a required field in every tool entry","Add a YAML schema/linter for tools.yaml requiring description","Review generated configs for dropped fields"],"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"}