{"record":{"id":"90791b2158761bba","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-90791b","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/cloudhealthcaregetdicomstore/cloudhealthcaregetdicomstore.go","lineNumber":69,"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\tparams := buildParams(false)\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: params.Manifest(), AuthRequired: cfg.AuthRequired},\n\t\t\tparams,\n\t\t),\n\t}, nil\n}\n\n// validate interface\nvar _ tools.Tool = Tool{}\n\ntype Tool struct {\n\ttools.BaseTool[Config]","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudhealthcare/cloudhealthcaregetdicomstore/cloudhealthcaregetdicomstore.go#L51-L87","documentation":"This error is thrown by Config.Initialize when a cloudhealthcare-get-dicom-store tool is defined without a non-empty description. The toolbox requires every tool to carry a human-readable description so agents/LLMs know what the tool does. Initialization fails fast rather than registering an undescribed tool.","triggerScenarios":"Calling Initialize on a Config whose Description field is the empty string (omitted in YAML config or set to \"\").","commonSituations":"YAML tool definitions that omit the description field; programmatic construction of Config that leaves Description unset; tooling that copies a config and drops the description.","solutions":["Add a non-empty description field to the tool's YAML config","Set cfg.Description programmatically before calling Initialize","Validate the config early in startup so the failure points at the right file"],"exampleFix":"# before\ntools:\n  get_dicom_store:\n    kind: cloud-healthcare-get-dicom-store\n# after\ntools:\n  get_dicom_store:\n    kind: cloud-healthcare-get-dicom-store\n    description: Fetches a DICOM store from Cloud Healthcare API","handlingStrategy":"validation","validationCode":"if cfg.Description == \"\" {\n    return fmt.Errorf(\"tool %q is missing a description\", cfg.Name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include a description field in every tool YAML block","Add a CI lint that parses tool configs and asserts description is non-empty","Use config structs with required-field validation before Initialize"],"tags":["go","config","validation","mcp-toolbox"],"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"}