{"record":{"id":"abb10368b9ab63cc","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-abb103","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/lookercreateviewfromtable/lookercreateviewfromtable.go","lineNumber":72,"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\tprojectIdParameter := parameters.NewStringParameter(\"project_id\", \"The id of the project to create the view in.\")\n\tconnectionParameter := parameters.NewStringParameter(\"connection\", \"The database connection name.\")\n\n\ttableDef := parameters.NewMapParameter(\"table\", \"Table definition.\", \"\")\n\ttablesParameter := parameters.NewArrayParameter(\"tables\", `The tables to generate views for.\n\t\tEach item must be a map with:\n\t\t- schema (string, required)\n\t\t- table_name (string, required)\n\t\t- primary_key (string, optional)\n\t\t- base_view (boolean, optional)\n\t\t- columns (array of objects, optional): Each object must have 'column_name' (string).`, tableDef)\n\n\tfolderNameParameter := parameters.NewStringParameter(\"folder_name\", \"The folder to place the view files in (e.g., 'views').\", parameters.WithStringDefault(\"views\"))\n\n\tparams := parameters.Parameters{projectIdParameter, connectionParameter, tablesParameter, folderNameParameter}\n","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookercreateviewfromtable/lookercreateviewfromtable.go#L54-L90","documentation":"Initialize for the looker-createviewfromtable tool requires a non-empty Description in the Config. The description is included in the tool's MCP manifest so LLM clients know when to use the tool; an empty one means the tool config is incomplete and initialization fails with this error.","triggerScenarios":"Loading config where a looker-createviewfromtable tool entry has no description field or an empty string, triggering Initialize at server startup/config load.","commonSituations":"Omitted description key in hand-edited YAML; a template variable that resolved to empty; copy-pasted tool blocks with the description stripped.","solutions":["Add a non-empty description to the looker-createviewfromtable entry in the tools YAML","Validate the final rendered config to confirm description is populated","Set Description when constructing lookercreateviewfromtable.Config in Go code"],"exampleFix":"# before\nvpnTools:\n  create-view:\n    kind: looker-create-view-from-table\n    source: my-looker\n# after\nvpnTools:\n  create-view:\n    kind: looker-create-view-from-table\n    source: my-looker\n    description: Creates a Looker view from a database table","handlingStrategy":"validation","validationCode":"if strings.TrimSpace(cfg.Description) == \"\" {\n    return fmt.Errorf(\"looker-create-view-from-table requires a description\")\n}","typeGuard":"func descriptionPresent(cfg lookercreateviewfromtable.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        // set cfg.Description and re-initialize\n    }\n    return err\n}","preventionTips":["Require description in tool YAML templates","Add CI linting for tool config completeness","Don't strip description fields when copying tool blocks","Document required fields for each tool kind"],"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"}