{"record":{"id":"f4b0297fdfdf8aae","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-f4b029","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/cloudhealthcare/cloudhealthcaregetdataset/cloudhealthcaregetdataset.go","lineNumber":67,"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\tallParameters := parameters.Parameters{}\n\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{}\n\ntype Tool struct {","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudhealthcare/cloudhealthcaregetdataset/cloudhealthcaregetdataset.go#L49-L85","documentation":"The cloudhealthcare-get-dataset tool requires a non-empty description in its Config. Initialize rejects empty descriptions because the description is surfaced to LLM clients in the MCP manifest; without it the tool would be unusable/undocumented. The error names the offending tool via cfg.Name.","triggerScenarios":"Config.Initialize(ctx) is called (directly or through toolbox startup parsing tools.yaml) for a cloudhealthcare-get-dataset tool whose description field is missing or empty.","commonSituations":"tools.yaml omits the description key for the tool; YAML indentation places description in the wrong block; programmatically built Config leaves Description unset; empty string supplied expecting a default.","solutions":["Add a non-empty description to the cloudhealthcare-get-dataset tool entry in tools.yaml.","Verify YAML indentation so description is inside the tool mapping.","Set ConfigBase Description when constructing Config in Go code.","Restart the toolbox after the config fix."],"exampleFix":"# before\ntools:\n  get-dataset:\n    kind: cloudhealthcare-get-dataset\n    source: my-healthcare\n\n# after\ntools:\n  get-dataset:\n    kind: cloudhealthcare-get-dataset\n    source: my-healthcare\n    description: Retrieves a Cloud Healthcare dataset by name.","handlingStrategy":"validation","validationCode":"if cfg.Name == \"\" || cfg.Description == \"\" {\n\treturn errors.New(\"cloudhealthcare-get-dataset config needs non-empty name and description\")\n}","typeGuard":"null","tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n\t// description errors are config bugs; surface a fix hint, don't retry\n\treturn nil, fmt.Errorf(\"tool config invalid: %w\", err)\n}","preventionTips":["Include description in every tool definition in tools.yaml.","Check indentation when editing YAML by hand.","Schema-validate tools.yaml before deploy.","Never pass \"\" for description expecting defaults."],"tags":["go","cloud-healthcare","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"}