Skip to main content
Glama

fhir-agent-bench

A read-only MCP server over FHIR records of synthetic patients, a LangGraph agent that answers clinician-style questions through it ("last 10 HbA1c values", "active medications", "conditions since 2020"), and a benchmark of tool-call accuracy, answer correctness and refusal behaviour across open-weight and API models.

Work in progress: see the milestones and issues. Results appear here only once a run in this repo has produced them.

No real patient data is used: tests run on a small hand-written synthetic FHIR bundle, and the benchmark uses Synthea synthetic patients (Apache-2.0).

Development

uv venv --python 3.12 .venv
uv pip install --python .venv/Scripts/python.exe -e ".[agent,dev]"
pre-commit install
python -m pytest

Work runs through issues and pull requests: one branch per issue, conventional commits, CI (ruff + pytest) must pass before a squash-merge.

Related MCP server: Legacy-to-FHIR Mapping MCP Server

Licence

MIT, see LICENSE. Author: Arjun Sivasankar (github.com/Arjun-Sivasankar).

Available Tools

6 tools
get_allergiesB
Read-onlyIdempotent

Recorded allergies and intolerances for one patient.

Inputs: patient_id (required).

get_conditionsA
Read-onlyIdempotent

Conditions (diagnoses) for one patient, optionally by clinical status (active, resolved, ...) and onset on or after since (YYYY-MM-DD).

Inputs: patient_id (required), since, clinical_status.

get_medicationsB
Read-onlyIdempotent

Medication requests for one patient, optionally filtered by status (active, stopped, completed, ...).

Inputs: patient_id (required), status.

get_observationsA
Read-onlyIdempotent

Lab results and vital signs for one LOINC code, newest first. since (YYYY-MM-DD) is inclusive; limit is 1-100. Examples: 4548-4 HbA1c, 13457-7 LDL cholesterol, 3016-3 TSH, 8480-6 systolic and 8462-4 diastolic blood pressure.

Inputs: loinc_code (required), patient_id (required), limit, since.

get_patientB
Read-onlyIdempotent

Demographics of one patient by id.

Inputs: patient_id (required).

search_patientsA
Read-onlyIdempotent

Find patients by (part of) their name and/or exact birth date (YYYY-MM-DD). Returns id, name, gender and birth date for each match.

Inputs: name, birth_date.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a clearly distinct FHIR resource: observations, demographics, allergies, conditions, medications, and patient search. The only potentially close pair (get_patient vs search_patients) is cleanly separated by id lookup vs name/birthdate search.

    Naming Consistency5/5

    All names follow a predictable snake_case verb_noun pattern (get_* for single-patient resource reads, search_* for discovery). The one verb deviation (search_patients) is semantically meaningful rather than arbitrary.

    Tool Count5/5

    Six tools is a well-scoped surface for a clinical data lookup server, with each tool mapping to a distinct resource type. No redundant or filler tools are present.

    Completeness3/5

    The surface covers common chart-review reads but omits encounters/visits, procedures, immunizations, and diagnostic reports, and offers no write or update operations at all. Filtering is also inconsistent (observations support limit, conditions/medications do not), which will cause dead ends for agents needing pagination or broader clinical context.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Provides safe read-only access to synthetic healthcare data via FHIR R4, enabling AI assistants to search patients, retrieve vitals, and summarize conditions using a public sandbox.
      4
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables exploring a synthetic electronic health record via natural language, including patient demographics, encounters, notes, and medications, with optional write support for adding synthetic progress notes.
      -