Validate an e-invoice (EN 16931, XRechnung, Peppol BIS)
validate_einvoiceValidate an EU e-invoice XML (UBL 2.1 Invoice/CreditNote or UN/CEFACT CII, e.g. XRechnung, Factur-X/ZUGFeRD XML) against the official CEN EN 16931 rules and, for XRechnung, the KoSIT XRechnung 3.0 rules. Returns valid, and every error with its rule ID (e.g. BR-CO-10), a plain-English message, XPath and a fix hint. rules: auto | en16931 | xrechnung. Slovak sellers also get eFaktúra field checks (FR SR transposition v1.13, warnings with ruleset SK-FS); Norwegian sellers get NO-LAW field checks. Peppol-specific rules are not checked yet. For PDFs use the REST endpoint POST /einvoice/validate. fixes lists concrete fixes for the errors (path, current, suggested, explanation, apply safe|amounts|manual). autofix=true applies the safe ones to a copy and returns it in autofix.xml with its new result (the original is unchanged); allow_amount_changes=true also applies total fixes that change the amount due (reported).
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": {
"xml": "<xml>"
},
"name": "validate_einvoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | Yes | The e-invoice XML as text: UBL 2.1 Invoice/CreditNote or UN/CEFACT CII (XRechnung, Factur-X/ZUGFeRD XML). | |
| rules | No | Rule set: 'auto' (detect from the invoice, default), 'en16931' or 'xrechnung'. | auto |
| autofix | No | If true, apply the safe fixes to a copy and return the fixed XML in autofix.xml (the input is never changed). | |
| allow_amount_changes | No | If true together with autofix, also apply fixes that change amounts (e.g. recomputed totals). |