{"record":{"id":"8697bc7b1a44fb7e","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-8697bc","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/cloudhealthcareretrieverendereddicominstance/cloudhealthcareretrieverendereddicominstance.go","lineNumber":74,"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":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudhealthcare/cloudhealthcareretrieverendereddicominstance/cloudhealthcareretrieverendereddicominstance.go#L56-L92","documentation":"Config.Initialize for the cloudhealthcare-retrieve-rendered-dicom-instance tool requires a non-empty description. Descriptions are surfaced to the LLM as the tool's description in the MCP manifest; without one the tool would be unusable/undescribable, so initialization fails fast with this error.","triggerScenarios":"Calling Initialize on a Config (at server startup when tools.yaml is parsed) where the tool entry has no description field or description: \"\".","commonSituations":"Writing a minimal tools.yaml entry and omitting the description field; YAML indentation errors putting description under the wrong key; programmatically constructing Config and leaving Description zero-valued.","solutions":["Add a description field to the tool entry in tools.yaml","Check YAML indentation so description lands under the tool config, not a sibling key","If constructing Config in code, set cfg.Description before calling Initialize"],"exampleFix":"// before (tools.yaml)\ntools:\n  retrieve-rendered-dicom-instance:\n    kind: cloudhealthcare-retrieve-rendered-dicom-instance\n    source: my-healthcare-source\n// after\ntools:\n  retrieve-rendered-dicom-instance:\n    kind: cloudhealthcare-retrieve-rendered-dicom-instance\n    source: my-healthcare-source\n    description: Retrieves a rendered (image/png) DICOM instance from a Cloud Healthcare DICOM store","handlingStrategy":"validation","validationCode":"// validate the tools.yaml entry before loading\ncfg, err := config.ParseYaml(yamlBytes)\nif err != nil {\n\tlog.Fatal(err)\n}\nfor name, toolCfg := range cfg.Tools {\n\tif toolCfg[\"description\"] == \"\" {\n\t\tlog.Fatalf(\"tool %q is missing required description\", name)\n\t}\n}","typeGuard":null,"tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil {\n\tif strings.Contains(err.Error(), \"description is required\") {\n\t\tlog.Fatalf(\"add a description to tool in tools.yaml: %v\", err)\n\t}\n\treturn err\n}","preventionTips":["Always include a description for every custom tool entry","Validate tools.yaml with `toolbox --tools-file` before deploying","Keep descriptions meaningful — they are shown to the LLM"],"tags":["go","cloud-healthcare","config-validation","missing-field"],"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"}