Skip to main content
Glama

util_edifact

Read-only

UN/EDIFACT parser & validator — Parse and validate a UN/EDIFACT interchange (ORDERS, INVOIC, DESADV, ORDRSP, PRICAT, IFTMIN, APERAK and 40+ other message types). Pass edi= (raw text, max 60,000 chars) or url= (link to an .edi file). Honors the UNA service string (custom separators, release character, decimal comma). Returns the interchange header (UNB sender/recipient/date/control reference/test flag), groups, and each message decoded into business fields: BGM document type/number/function, DTM dates converted to ISO (formats 101/102/203/204/201/718/610/616), NAD parties with roles and GLN check-digit validation, RFF references, currency, line items (LIN with GTIN check digit, PIA ids, IMD description, QTY, PRI, MOA, TAX) with computed qty x price, totals and CNT control totals. Validates envelope integrity: UNT segment counts, UNT/UNH and UNZ/UNB reference matches, UNZ/UNE message counts, unclosed messages, bad tags, missing terminator, UNOA lower-case use, CNT line count and line/total amount mismatches. Verdict VALID / WARNINGS / INVALID with an issues list (level, code, message, segment index). Optional raw=true adds the first 300 segments as element arrays. Companion to /v1/util/x12 and /v1/util/hl7. Price: $0.004 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": {
      "edi": "<edi>"
    },
    "name": "util_edifact"
  }
}

Input Schema

NameRequiredDescriptionDefault
ediYesUNA:+.? 'UNB+UNOC:3+5412345000013:14+8712345000011:14+261125:1430+REF0001'UNH+1+ORDERS:D:96A:UN:EAN008'BGM+220+PO12345+9'DTM+137:20261125:102'NAD+BY+5412345000013::9'NAD+SU+8712345000011::9'LIN+1++4006381333931:EN'QTY+21:48:PCE'PRI+AAA:12.50'MOA+203:600'UNS+S'CNT+2:1'UNT+12+1'UNZ+1+REF0001'

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

Annotations only declare it as a non-destructive, open-world read, but the description goes well beyond that: it discloses a 60,000-char payload ceiling, UNA separator handling, the exact validation rules applied (UNT counts, reference matches, CNT totals), the three-tier VALID/WARNINGS/INVALID verdict with an issues list shape, and the fact that calls are metered at $0.004 USDC via x402. Cost and payload limits are precisely the behavioral facts an agent needs before calling.

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, and nearly every clause carries operational value (message types, UNA handling, decoded fields, validation rules). It is a single dense block rather than being broken into input/behavior/output sections, which makes the phantom 'url=' and 'raw=' mentions easy to overlook.

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?

For a complex parser with no output schema, the description compensates by describing the returned structure (UNB header fields, groups, per-message BGM/DTM/NAD/RFF/LIN decoding with check digits, computed qty x price, totals) and the verdict/issue format. An agent can predict the response shape without an output schema.

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

Parameters2/5

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

The schema already covers the single 'edi' parameter at 100% with a full worked example, so baseline would be 3. However, the description documents two parameters that do not exist in the input schema — 'url=' and 'raw=true' — which can send an agent into an invocation error if it follows the prose instead of 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?

States a specific verb pair (parse & validate) plus the resource (UN/EDIFACT interchange) and enumerates the message types it handles, so the agent knows exactly what domain this covers. It also positions itself against siblings with 'Companion to /v1/util/x12 and /v1/util/hl7', making the format boundary unambiguous.

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 concrete invocation guidance ('Pass edi= (raw text, max 60,000 chars) or url=') and implies the alternative for X12/HL7 payloads by naming the companion tools. It lacks explicit when-not-to-use exclusions (e.g., that this is unnecessary for non-EDI payloads), so it falls short of a 5.

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