Skip to main content
Glama

util_hl7

Read-only

HL7 v2 message parser — Parse an HL7 v2.x message (text= the message; segments separated by carriage returns or new lines) into JSON offline. Detects delimiters from MSH, unescapes HL7 escape sequences, names fields for common segments (MSH EVN PID PD1 PV1 PV2 NK1 ORC OBR OBX AL1 DG1 NTE MSA ERR IN1 SCH TXA FT1 RXE RXA), splits components and repetitions, and summarizes message type and trigger event (ADT^A01 admit, ORU^R01 results, ORM, SIU, MDM, DFT, VXU, ACK), version, control id, sending/receiving apps, patient (id, name, DOB, sex), visit, observations (LOINC code, value, units, reference range, abnormal flag, computed out-of-range), acknowledgment code, and validation warnings (missing MSH-9/10/12, non-numeric NM values, Z-segments, unknown segments). Nothing is stored; use test or de-identified messages where possible. Price: $0.003 USDC (Base, via x402).

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": {
      "text": "<text>"
    },
    "name": "util_hl7"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesMSH|^~&|LAB|HOSP|EHR|CLINIC|20261121083000||ORU^R01|MSG00001|P|2.5.1 PID|1||123456^^^HOSP^MR||DOE^JANE||19800215|F OBX|1|NM|2345-7^Glucose^LN||182|mg/dL|70-99|H|||F

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already cover safety (readOnlyHint, destructiveHint=false), yet the description still adds real behavioral facts: nothing is persisted, delimiters are auto-detected from MSH, escape sequences are unescaped, and validation warnings are produced (missing MSH-9/10/12, non-numeric NM values, Z-segments). It also discloses cost ($0.003 USDC via x402), which is behavior an agent should know before calling. The only minor tension is "offline" against openWorldHint=true, but that concerns a paid transport, not a contradiction of the read-only claim.

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 verb and resource, then a dense but organized enumeration of parsed segments, summarized fields, and warnings. The long segment-list and summary-field list are somewhat over-packed for a single paragraph, but each item tells the agent what output to expect, so little is genuinely wasted.

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

Completeness5/5

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

There is no output schema, so the description must carry the return contract, and it does: field naming for 20+ segment types, component/repetition splitting, a message summary (type, trigger event, version, control id, apps, patient, visit, observations, ACK code), and validation warnings. For a one-parameter, read-only parser this is complete enough to invoke confidently.

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

Parameters4/5

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

Schema coverage is 100% and the property already carries an example message, so the schema does the heavy lifting. The description still adds meaning beyond it by stating that segments may be separated by carriage returns or new lines and that delimiters come from MSH, which tells the agent how to format input even when the sample's delimiters differ.

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+resource ("Parse an HL7 v2.x message") and immediately pins the scope: offline, MSH-derived delimiters, JSON output. The parenthetical "text= the message" removes any ambiguity about the single input, so an agent can distinguish this from sibling utilities like util_csv or util_xml_json without opening the schema.

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 clear operational context (offline conversion, no network dependency) plus an explicit safety recommendation: "use test or de-identified messages where possible." It does not name an alternative tool or state when-not-to-use, but among the listed siblings no other tool parses HL7, so the routing gap is small.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources