{"record":{"id":"ba9cd2609c38f156","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-ba9cd2","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/lookercreateprojectfile/lookercreateprojectfile.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 containing the files\")\n\tfilePathParameter := parameters.NewStringParameter(\"file_path\", \"The path of the file within the project\")\n\tfileContentParameter := parameters.NewStringParameter(\"file_content\", \"The content of the file\")\n\tparams := parameters.Parameters{projectIdParameter, filePathParameter, fileContentParameter}\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.NewWriteAnnotations),\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","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookercreateprojectfile/lookercreateprojectfile.go#L54-L90","documentation":"Initialize for the looker-create-projectfile tool validates that the Config has a non-empty Description before constructing the tool. The description is required because it is surfaced to LLM clients through the MCP manifest. An empty description means the tool definition is incomplete, so initialization aborts with this error.","triggerScenarios":"Loading a tools YAML where a looker-create-projectfile entry omits the description field or sets it to \"\" and then calling Initialize (during server startup or config load).","commonSituations":"Hand-written YAML missing the description key; description lost after copying a tool block; templated configs where a variable resolved to an empty string.","solutions":["Add a non-empty description field to the looker-create-projectfile tool entry in the YAML config","Validate the rendered config (e.g. print or lint it) to ensure the description value is not empty","Update code that constructs lookercreateprojectfile.Config programmatically to set Description"],"exampleFix":"# before\nvpnTools:\n  create-file:\n    kind: looker-create-projectfile\n    source: my-looker\n# after\nvpnTools:\n  create-file:\n    kind: looker-create-projectfile\n    source: my-looker\n    description: Creates a new file within a Looker project","handlingStrategy":"validation","validationCode":"if cfg.Name != \"\" && cfg.Description == \"\" {\n    return fmt.Errorf(\"tool %q is missing required description\", cfg.Name)\n}","typeGuard":"func hasDescription(cfg lookercreateprojectfile.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        // supply cfg.Description and retry\n    }\n    return err\n}","preventionTips":["Include description in every tool block in the tools YAML","Add a config lint step that fails fast on empty tool descriptions","Avoid optional template variables for descriptions without defaults","Review rendered config before deploying"],"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"}