Skip to main content
Glama
FHIR MCP Server

FHIR MCP Server

by wso2

search

Query multiple FHIR resources by resource type and parameters, returning matching bundles or lists; optionally filter response fields to only the data needed.

Instructions

Executes a standard FHIR search interaction on a given resource type, returning a bundle or list of matching resources. Use this when you need to query for multiple resources based on one or more search-parameters. Do not use this tool for create, update, or delete operations, and be aware that large result sets may be paginated by the FHIR server. Optionally specify fields to filter the response to only the data your task needs (e.g., Patient.birthDate, Observation.valueQuantity).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "type": "<type>",
      "searchParam": "<searchParam>"
    },
    "name": "search"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeYesThe FHIR resource type name. Must exactly match one of the resource types supported by the server
searchParamYesA mapping of FHIR search parameter names to their values. Only include parameters supported for the resource type, as listed by `get_capabilities`.
response_filter_fhirpathsNoSpecify FHIRPath expressions to filter the response to only the data you need. Omitting returns the full resource.

Output Schema

NameRequiredDescriptionDefault
resultYesA dictionary containing the full FHIR resource instance matching the search criteria.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.11.0
    • addedInput schema / properties / response_filter_fhirpaths
      Added value: +{
      +  "default": [],
      +  "description": "Specify FHIRPath expressions to filter the response to only the data you need. Omitting returns the full resource.",
      +  "examples": [
      +    [
      +      "Condition.code",
      +      "Condition.clinicalStatus",
      +      "Bundle.link.where(relation='next').url"
      +    ]
      +  ],
      +  "items": {
      +    "type": "string"
      +  },
      +  "title": "Response Filter Fhirpaths",
      +  "type": "array"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "result": {
      +      "anyOf": [
      +        {
      +          "items": {
      +            "additionalProperties": true,
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        {
      +          "additionalProperties": true,
      +          "type": "object"
      +        }
      +      ],
      +      "description": "A dictionary containing the full FHIR resource instance matching the search criteria.",
      +      "title": "Result"
      +    }
      +  },
      +  "required": [
      +    "result"
      +  ],
      +  "title": "searchOutput",
      +  "type": "object"
      +}
  2. First observedv0.9.0

TDQS

A3.9/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full disclosure burden and does reasonably well: it establishes the read-style nature of the operation, states the return shape, and warns that large result sets may be paginated by the FHIR server. Missing are any notes on server-side errors for unsupported resource types or permission scopes, which are common failure modes for FHIR search.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core operation, then usage guidance, then caveats; every sentence maps to a real decision the agent must make. Slight overlap between the filter sentence here and the parameter's own schema description keeps it from a 5.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need no further explanation, and the description covers purpose, sibling exclusions, pagination, and response filtering. The main residual gap is boilerplate operational context: how to validate search parameters against `get_capabilities` and what happens on unsupported parameters.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all three parameters are already documented, including a detailed `response_filter_fhirpaths` description and examples. The description's filter guidance ("only the data your task needs") largely restates the schema, so baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Executes a standard FHIR `search` interaction on a given resource type") and describes the return shape (bundle or list of matching resources). It explicitly rules out the create/update/delete siblings, though the `read` sibling is only implicitly distinguished via the "multiple resources" phrasing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives a clear when-to-use condition ("query for multiple resources based on one or more search-parameters") and an explicit when-not-to-use list (create, update, delete). It omits the practical prerequisite suggested elsewhere in the schema — that valid search parameters must be discovered via `get_capabilities` before calling.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools