Skip to main content
Glama
FHIR MCP Server

FHIR MCP Server

by wso2

create

Adds a new FHIR resource (e.g., Patient or Observation) to the server via POST; use it only for records that do not exist yet—modify existing ones with update.

Instructions

Creates a new FHIR resource on the server (FHIR create interaction: POST [base]/{type}). Use it to add a record that does not exist yet, such as a new Patient, Observation or Appointment. Do not use it to change an existing resource; use update for that. The server assigns a new id on every call, so repeating a call creates duplicates; use search first if the record may already exist. On success it returns the resource as stored, including the server-assigned id and meta. On failure it returns OperationOutcome issues whose diagnostics explain what to fix, such as a missing required element or an invalid code.

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>",
      "payload": "<payload>"
    },
    "name": "create"
  }
}

Input Schema

NameRequiredDescriptionDefault
typeYesThe FHIR resource type name. Must exactly match one of the resource types supported by the server.
payloadYesThe JSON body of the new resource. Include every element the resource's profile marks as required, or the server rejects the request. Set `resourceType` to the same value as `type`; if omitted, it defaults to `type`. Leave out `id` and `meta`, which the server assigns.
operationNoThe name of a custom FHIR operation or extended query defined for the resourceMust match one of the operation names returned by `get_capabilities`.
searchParamNoA mapping of FHIR search parameter names to their desired values. These parameters refine queries for operation-specific query qualifiers. Only parameters exposed by `get_capabilities` for that resource type are valid.

Output Schema

NameRequiredDescriptionDefault
resultYesA dictionary containing the newly created FHIR resource, including server-assigned fields (id, meta.versionId, meta.lastUpdated, and any server-added extensions). Reflects exactly what was persisted.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.11.0
    • changedInput schema / properties / payload / description
      Previous value: -"A JSON object representing the full FHIR resource body to be created. It must include all required elements of the resource's profile."New value: +"The JSON body of the new resource. Include every element the resource's profile marks as required, or the server rejects the request. Set `resourceType` to the same value as `type`; if omitted, it defaults to `type`. Leave out `id` and `meta`, which the server assigns."
    • addedInput schema / properties / payload / examples
      Added value: +[
      +  {
      +    "birthDate": "1980-04-12",
      +    "gender": "male",
      +    "name": [
      +      {
      +        "family": "Smith",
      +        "given": [
      +          "John"
      +        ]
      +      }
      +    ],
      +    "resourceType": "Patient"
      +  }
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "result": {
      +      "additionalProperties": true,
      +      "description": "A dictionary containing the newly created FHIR resource, including server-assigned fields (id, meta.versionId, meta.lastUpdated, and any server-added extensions). Reflects exactly what was persisted.",
      +      "title": "Result",
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "result"
      +  ],
      +  "title": "createOutput",
      +  "type": "object"
      +}
  2. First observedv0.9.0

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it discloses non-idempotency ("The server assigns a new id on every call, so repeating a call creates duplicates"), the success shape (stored resource with server-assigned `id` and `meta`), and the failure shape (OperationOutcome with actionable `diagnostics`). These are exactly the behavioral facts an agent cannot infer from the schema.

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

Conciseness5/5

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

Five tight sentences, front-loaded with purpose and the POST form, followed by when-not, the duplicate hazard, and return/error semantics. No sentence is redundant despite covering a lot of ground.

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?

Covers purpose, exclusions, idempotency, and outcomes well for a tool with nested payloads and an output schema (return values are arguably already structured). The one real gap is that the `operation`/`searchParam` path for invoking custom operations is invisible to the agent from the description alone.

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 the baseline is 3; the description adds no parameter-level detail beyond what `type` and `payload` already document. More importantly, it never mentions the `operation` or `searchParam` parameters, which let the call invoke custom FHIR operations like `$evaluate` — a meaningfully different mode of use that goes unexplained.

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

Purpose5/5

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

States a specific verb and resource ("Creates a new FHIR resource on the server") and even names the protocol interaction (POST [base]/{type}). It explicitly separates itself from the `update` sibling, so an agent can route correctly without opening another schema.

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

Usage Guidelines5/5

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

Gives both when-to-use ("add a record that does not exist yet, such as a new Patient, Observation or Appointment") and when-not ("Do not use it to change an existing resource; use `update` for that"). It also prescribes `search` as a pre-check when duplicates are a risk, naming alternatives explicitly.

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