util_edifact
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
| Name | Required | Description | Default |
|---|---|---|---|
| edi | Yes | UNA:+.? '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' |