Skip to main content
Glama

UN/EDIFACT EDI Parser API - INVOIC, ORDERS to JSON

edifact_parser
Read-onlyIdempotent

Parse UN/EDIFACT and EANCOM EDI messages (INVOIC, ORDERS, DESADV, ORDRSP and others) into structured JSON: interchange sender and recipient, message type and version, document number, dates, parties with VAT ids and addresses, line items with GTIN, quantity, unit and price, totals and tax rows. Honors UNA separators and release characters, checks UNT segment counts and truncated files. Deterministic parsing, zero AI, nothing stored. Usable from AI agents via MCP. Free: 5 calls/day per IP. Paid: Radar API key (from €15/mo at https://radarbg.com/pricing#starter via X-API-Key) or $0.01/call via x402 at https://radarbg.com/x402/edifact-parser.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "limit": 75,
      "content": "UNA:+.? '\nUNB+UNOC:3+4012345000009:14+4098765000008:14+261105:0915+0000001547++INVOIC+++EANCOM'\nUNH+1+INVOIC:D:96A:UN:EAN010'\nBGM+380+INV-2026-4471+9'\nDTM+137:20261105:102'\nDTM+35:20261104:102'\nDTM+13:20261205:102'\nRFF+ON:PO-88231'\nRFF+DQ:LS-20261104-07'\nNAD+SU+4012345000009::9++Muster Großhandel GmbH+Industriestraße 4+Hamburg++20457+DE'\nRFF+VA:DE123456789'\nNAD+BY+4098765000008::9++Beispiel Märkte AG+Marktplatz 9?+11+Köln++50667+DE'\nRFF+VA:DE987654321'\nNAD+DP+4098765000015::9++Beispiel Märkte AG, Lager West+Lagerweg 2+Dortmund++44135+DE'\nCUX+2:EUR:4'\nPAT+3++5:3:D:30'\nLIN+1++4000000000012:EN'\nPIA+5+A-1001:SA'\nIMD+F++:::Bio Haferflocken 500 g'\nQTY+47:240:PCE'\nMOA+203:432.00'\nPRI+AAA:1.80'\nRFF+ON:PO-88231:1'\nTAX+7+VAT+++:::7+S'\nLIN+2++4000000000029:EN'\nPIA+5+A-1002:SA'\nIMD+F++:::Müsli Nuss & Frucht 750 g'\nQTY+47:120:PCE'\nMOA+203:287.40'\nPRI+AAA:2.395'\nTAX+7+VAT+++:::7+S'\nLIN+3++4000000000036:EN'\nPIA+5+A-2040:SA'\nIMD+F++:::Mehrweg-Kiste 12er (Pfand)'\nQTY+47:20:PCE'\nMOA+203:60.00'\nPRI+AAA:3.00'\nTAX+7+VAT+++:::19+S'\nUNS+S'\nCNT+2:3'\nMOA+79:779.40'\nMOA+125:779.40'\nMOA+176:61.76'\nMOA+86:841.16'\nTAX+7+VAT+++:::7+S'\nMOA+125:719.40'\nMOA+124:50.36'\nTAX+7+VAT+++:::19+S'\nMOA+125:60.00'\nMOA+124:11.40'\nUNT+49+1'\nUNZ+1+0000001547'\n"
    },
    "name": "edifact_parser"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoMaximum number of line items to return per message (1-2000).
contentNoRaw UN/EDIFACT text (starting with UNA or UNB). Provide either content or fileBase64.
fileNameNoOptional original file name.
fileBase64NoBase64-encoded EDIFACT file (alternative to content, max 15 MB).

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?

The annotations only cover read-only/idempotent/open-world semantics, while the description adds substantial behavior: deterministic parsing, no AI involvement, nothing stored, validation of UNT segment counts and truncated files, and UNA separator/release-character handling. It also discloses access constraints absent from annotations – free 5 calls/day per IP, paid via X-API-Key or x402 at $0.01/call – which is exactly the operational context an agent needs.

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?

The description leads with the core verb and supported formats, then behaviors, then pricing, so a reader can stop early. The pricing and URL tail is long and comma-spliced, but it earns its place by telling the agent about rate limits and auth.

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?

With no output schema, the description carries the burden of describing return values and does so field-by-field (interchange envelope, message metadata, parties, line items, totals, tax rows). The remaining gap is error behavior – it says truncation and segment counts are checked but not whether failures surface as an exception or a structured error.

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 schema already documents content, fileBase64, fileName and limit, including their mutual exclusivity. The description adds nothing parameter-specific; the 'line items' enumeration in the output summary only loosely hints at what the limit parameter caps.

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?

The description states a specific verb and resource ('Parse UN/EDIFACT and EANCOM EDI messages'), names the concrete message types supported (INVOIC, ORDERS, DESADV, ORDRSP), and enumerates the extracted payload (parties, VAT ids, line items with GTIN/quantity/price, totals, tax rows). This distinguishes it cleanly from sibling parsers such as bai2_parser or camt-style invoice parsers.

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?

It gives clear input-matching context – the payload must be UN/EDIFACT or EANCOM text – and the schema narrows it further to text starting with UNA or UNB. There is no explicit when-not guidance or mention of which sibling parser handles a different EDI dialect, so it falls short of naming alternatives, but the selection context is unambiguous.

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