{"record":{"id":"b8b69d2ed0ba3257","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-b8b69d","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/lookerdeleteprojectdirectory/lookerdeleteprojectdirectory.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\")\n\tdirectoryPathParameter := parameters.NewStringParameter(\"directory_path\", \"The path to delete in the project\")\n\tparams := parameters.Parameters{projectIdParameter, directoryPathParameter}\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.NewDestructiveAnnotations),\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":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookerdeleteprojectdirectory/lookerdeleteprojectdirectory.go#L54-L90","documentation":"Config.Initialize for looker-delete-projectdirectory rejects configs whose description (from the embedded tools.ConfigBase) is empty. A description is mandatory to build the MCP tool manifest, so Initialize fails fast with this error when parsing the tool config.","triggerScenarios":"A looker-delete-projectdirectory tool block in the YAML lacking the `description` key or having it set to an empty string (including an unset env placeholder).","commonSituations":"Minimal hand-written configs omitting description; templating rendering an empty description; misspelled YAML key like `descriptions:`.","solutions":["Add a non-empty `description:` to the looker-delete-projectdirectory tool definition.","Verify the key is spelled `description` and resolves to non-empty (check env substitutions).","Lint generated configs to require a description per tool before server startup."],"exampleFix":"# before\ntools:\n  delete-dir:\n    kind: looker-delete-projectdirectory\n    source: my-looker\n\n# after\ntools:\n  delete-dir:\n    kind: looker-delete-projectdirectory\n    source: my-looker\n    description: Deletes a file or directory from a Looker project","handlingStrategy":"validation","validationCode":"// pre-flight check on decoded tool config\nif cfg.Description == \"\" {\n\treturn fmt.Errorf(\"tool %q must define a non-empty `description` field\", cfg.Name)\n}","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n\treturn fmt.Errorf(\"invalid looker-delete-projectdirectory config: %w (add a `description` field)\", err)\n}","preventionTips":["Always ship a `description:` line with each looker-delete-projectdirectory tool.","Lint YAML configs (schema or CI check) to reject tools missing description.","Ensure env-substituted descriptions do not expand to empty strings.","Spell the key exactly as `description`."],"tags":["go","looker","config-validation","missing-field","yaml"],"backgroundTag":"missing-required-argument","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"}