Parse an e-invoice into JSON
parse_invoiceReads CII, UBL, XRechnung, Peppol XML, or Factur-X/ZUGFeRD PDF invoices into a structured invoice object for review, editing, or re-issuance. Use validate_invoice to check rules.
Instructions
Reads an e-invoice (CII, UBL, XRechnung or Peppol XML, or a Factur-X / ZUGFeRD PDF) into the structured invoice object that create_invoice accepts, with money in integer minor units. Use it to answer questions about a received invoice, to edit one, or to re-issue it with create_invoice. It does not check any rules, so use validate_invoice for that, and convert_invoice to change syntax directly. For a PDF, visibleTotals shows whether the totals printed on the page match the embedded XML, which exposes a tampered or mismatched PDF. A document it cannot read comes back as an error result with the reason. Runs locally.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "parse_invoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | No | The invoice as XML text (CII, UBL Invoice/CreditNote, XRechnung, Peppol BIS). Provide this OR pdfBase64. | |
| pdfBase64 | No | A Factur-X / ZUGFeRD PDF/A-3 as base64; the embedded XML is used. Provide this OR xml. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | Yes | Syntax of the source document. | |
| origin | Yes | Whether the input was XML or a PDF. | |
| invoice | Yes | The Invoice object, in the shape of the create_invoice input schema. | |
| visibleTotals | No | PDF only: comparison of the printed totals with the embedded XML. | |
| embeddedFilename | No | PDF only: name of the embedded XML that was read. |