{"record":{"id":"95d65b7d9be6b159","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-95d65b","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/lookergetprojectfiles/lookergetprojectfiles.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\tprojectIdParameter := parameters.NewStringParameter(\"project_id\", \"The id of the project containing the files\")\n\tallParameters := parameters.Parameters{projectIdParameter}\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: allParameters.Manifest(), AuthRequired: cfg.AuthRequired},\n\t\t\tallParameters,\n\t\t),\n\t}, nil\n}\n\n// validate interface\nvar _ tools.Tool = Tool{}","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/looker/lookergetprojectfiles/lookergetprojectfiles.go#L53-L89","documentation":"LookerGetProjectFiles.Config.Initialize validates that a non-empty description was supplied, because the description becomes the tool's LLM-facing manifest text. When Config.Description is empty, Initialize returns this error and the tool is not created. It is a YAML/config validation failure at load time.","triggerScenarios":"A tools.yaml entry of kind looker-get-project-files omits the `description` field (or sets it to an empty string), causing Config.Initialize to fail while the toolbox config is being loaded.","commonSituations":"Hand-writing tool configs and skipping description because it seems optional; templated config generation that leaves description blank; upgrading from an older config format where description was defaulted.","solutions":["Add a descriptive `description:` string to the looker-get-project-files tool entry in your YAML.","Write the description from the calling agent's perspective (what the tool does, when to use it).","Re-run the toolbox; if it still fails, check that the tool name in the error matches the entry you edited."],"exampleFix":"// before\ntools:\n  get-project-files:\n    kind: looker-get-project-files\n    source: my-looker\n// after\ntools:\n  get-project-files:\n    kind: looker-get-project-files\n    source: my-looker\n    description: Lists all files in a given Looker project","handlingStrategy":"validation","validationCode":"// Pre-load YAML and assert required tool fields\nvar raw map[string]map[string]any\nyaml.Unmarshal(cfgBytes, &raw)\nfor name, t := range raw[\"tools\"] {\n    if t[\"kind\"] == \"looker-get-project-files\" {\n        desc, _ := t[\"description\"].(string)\n        if desc == \"\" {\n            return fmt.Errorf(\"tool %q (looker-get-project-files) is missing a non-empty description\", name)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"tool, err := toolCfg.Initialize(ctx)\nif err != nil && strings.Contains(err.Error(), \"description is required\") {\n    return fmt.Errorf(\"config error: add a 'description' to tool %q in your YAML: %w\", toolCfg.Name, err)\n}","preventionTips":["Always include description for every tool entry; treat it as mandatory even if some kinds tolerate empty.","Write descriptions from the agent's perspective to double as documentation.","Lint tools.yaml in CI for empty required fields before deploying."],"tags":["go","looker","config","validation"],"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"}