Skip to main content
Glama
FHIR MCP Server

FHIR MCP Server

by wso2

update

Replace the full content of an existing FHIR resource when its type and ID are known; include every element to keep because omitted fields are removed.

Instructions

Replaces the full content of an existing FHIR resource (FHIR update interaction: PUT [base]/{type}/{id}). Use it to correct or complete a record whose logical id you already know. Elements left out of the payload are removed from the stored resource, not kept, so first get the current version with read, change what you need, and send the whole resource back. Do not use it to add new records; use create for that. On success it returns the resource as stored, with an updated meta.versionId and meta.lastUpdated. On failure it returns OperationOutcome issues whose diagnostics explain what to fix.

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

Input Schema

NameRequiredDescriptionDefault
idYesThe logical ID of a specific FHIR resource instance.
typeYesThe FHIR resource type name. Must exactly match one of the resource types supported by the server.
payloadYesThe complete new content of the resource. It replaces the stored version entirely, so include every required element and all existing data you want to keep. Set `resourceType` to the same value as `type`; if omitted, it defaults to `type`. The body `id` is always set to the `id` argument, overriding any value given here.
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 updated FHIR resource

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.11.0
    • changedInput schema / properties / payload / description
      Previous value: -"The complete JSON representation of the FHIR resource, containing all required elements and any optional data. Servers replace the existing resource with this exact content, so the payload must include all mandatory fields defined by the resource's profile and any previous data you wish to preserve."New value: +"The complete new content of the resource. It replaces the stored version entirely, so include every required element and all existing data you want to keep. Set `resourceType` to the same value as `type`; if omitted, it defaults to `type`. The body `id` is always set to the `id` argument, overriding any value given here."
    • addedInput schema / properties / payload / examples
      Added value: +[
      +  {
      +    "active": true,
      +    "id": "org-1001",
      +    "name": "Boston General Hospital",
      +    "resourceType": "Organization",
      +    "telecom": [
      +      {
      +        "system": "phone",
      +        "value": "+1-617-555-0100"
      +      }
      +    ]
      +  }
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "result": {
      +      "additionalProperties": true,
      +      "description": "A dictionary containing the updated FHIR resource",
      +      "title": "Result",
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "result"
      +  ],
      +  "title": "updateOutput",
      +  "type": "object"
      +}
  2. First observedv0.9.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full burden and does it well: it discloses the destructive replace semantics ('Elements left out of the payload are removed from the stored resource, not kept') and both success and failure responses (resource with updated meta.versionId/meta.lastUpdated, or OperationOutcome with diagnostics). It does not mention version-conflict/precondition behavior (If-Match, 412) or permission requirements, which matter for a FHIR update.

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?

Six tight sentences, front-loaded with the verb and resource, then the destructive-replace warning, then the alternative, then return behavior. Every sentence adds information an agent needs; there is no filler.

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 did not need spelling out, yet the description covers them anyway. The only real gap relative to a 5-parameter, nested-payload FHIR mutation tool is the unexplained `operation`/`searchParam` parameters and no note on concurrency or authorization.

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% and the payload parameter already documents resourceType defaulting and id override, so the description mostly restates schema content ('send the whole resource back'). It says nothing about the `operation` and `searchParam` parameters, which are unusual on an update tool and left entirely to the schema.

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?

Names a specific verb and resource ('Replaces the full content of an existing FHIR resource') and anchors it to the standard FHIR update interaction with an explicit PUT [base]/{type}/{id} shape. It also contrasts itself with `create` in the same breath, so an agent can distinguish it from siblings without opening schemas.

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 an explicit when-to-use ('correct or complete a record whose logical id you already know'), an explicit read-before-write workflow ('first get the current version with `read`, change what you need, and send the whole resource back'), and an explicit when-not-to-use with the named alternative ('Do not use it to add new records; use `create` for that').

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