Validate a German e-invoice (XRechnung, ZUGFeRD XML)
validate_invoiceValidates one e-invoice (XRechnung UBL or CII, ZUGFeRD / Factur-X XML) against the XML schema, EN 16931 and the official KoSIT rules for XRechnung 3.0.2, and explains every finding in German (meaning of the rule code, how to fix it). Requires an eRechio API key (header Authorization: Bearer pk_…; free test key: https://api.erechio.de/testschluessel?lang=en). Each successful validation counts one document against the monthly quota; repeats with the same idempotency_key within 24 hours do not count. Does not check content or tax correctness. No PDF input: for ZUGFeRD send the embedded XML file. Returns (texts in German): content[0] a short summary, content[1] and structuredContent the full result of POST /v1/validate: vollstaendig_validiert (boolean, the decisive field: XML schema and rules passed), regelpruefung_bestanden, schemapruefung, syntax (UBL or CII), szenario, fehler (number of errors), warnungen (number of warnings), meldungen (list of {code, level: fehler|warnung|hinweis, text, location, erklaerung {titel, was, beheben, pfad, mehr}}), leitweg_id, kontingent {genutzt, limit, rest}, regelstand, ohne (what is not checked). Errors are returned as a tool result with isError true and structuredContent {http_status, fehler {code, text}, retry_after}: schluessel (401, API key missing or invalid), kontingent (429, monthly quota used up; the free test key has 50 documents per month), rate (429, more than 60 validations per minute, retry_after 60), zu_gross (413, invoice larger than 2 MB), kein_xml / kein_format / dtd (400/422, not an XML e-invoice), idempotenz_laeuft (409, same idempotency_key still running, retry after 2 s), idempotenz_konflikt (422, same idempotency_key with a different invoice), ausgelastet / zeitlimit (503, retry later).
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_invoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml | Yes | The invoice as XML text (UTF-8), at most 2 MB: XRechnung UBL (Invoice/CreditNote) or CII, or the XML part of a ZUGFeRD / Factur-X invoice. | |
| idempotency_key | No | Optional, 1–255 visible ASCII characters (e.g. a UUID). The same key with the same invoice within 24 hours returns the stored result and is not counted again; the same key with a different invoice is rejected (idempotenz_konflikt). |