{"record":{"id":"8c37d87c2b07d17a","repo":"googleapis/mcp-toolbox","slug":"description-is-required-for-tool-q-8c37d8","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/cloudhealthcarefhirpatientsearch/cloudhealthcarefhirpatientsearch.go","lineNumber":91,"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":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/googleapis/mcp-toolbox/blob/8cc6e09de2ad7b8bffc77751799585a1401a48eb/internal/tools/cloudhealthcare/cloudhealthcarefhirpatientsearch/cloudhealthcarefhirpatientsearch.go#L73-L109","documentation":"The cloudhealthcare-fhir-patient-search tool requires a non-empty description in its Config. Initialize validates this before constructing the Tool and returns this error when cfg.Description is empty. Descriptions are what the LLM sees in the MCP tool manifest, so the library treats a missing one as an invalid tool configuration and refuses to initialize the tool.","triggerScenarios":"Calling Config.Initialize(ctx) (or starting the toolbox with a tools.yaml that defines a cloudhealthcare-fhir-patient-search tool) where the description field is absent or set to \"\".","commonSituations":"The tool entry in tools.yaml omits the description key; YAML indentation puts description under the wrong node so it never populates the field; a programmatically constructed Config leaves Description unset; an empty string was provided thinking a default would be applied.","solutions":["Add a non-empty description field to the cloudhealthcare-fhir-patient-search tool entry in tools.yaml.","Check YAML indentation so description sits under the tool's own mapping, not a sibling.","If building Config in Go, set the Description field from tools.ConfigBase before calling Initialize.","Restart the toolbox after fixing the config."],"exampleFix":"# before\ntools:\n  fhir-patient-search:\n    kind: cloudhealthcare-fhir-patient-search\n    source: my-healthcare\n\n# after\ntools:\n  fhir-patient-search:\n    kind: cloudhealthcare-fhir-patient-search\n    source: my-healthcare\n    description: Searches for FHIR Patient resources in a Cloud Healthcare FHIR store.","handlingStrategy":"validation","validationCode":"cfg, _ := configs.GetToolConfig(\"fhir-patient-search\")\nif cfg == nil || cfg.GetDescription() == \"\" {\n\treturn errors.New(\"cloudhealthcare-fhir-patient-search requires a non-empty description\")\n}","typeGuard":"null","tryCatchPattern":"tool, err := cfg.Initialize(ctx)\nif err != nil && strings.Contains(err.Error(), \"description is required\") {\n\treturn fmt.Errorf(\"fix tools.yaml: %w\", err)\n}","preventionTips":["Always include a description for every tool in tools.yaml.","Watch for YAML indentation mistakes that silently drop fields.","Lint tools.yaml against the Config schema (required: name, kind, source, description).","Avoid empty-string descriptions; they fail the same check."],"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-08T15:18:49.778Z"}