Create a validated e-invoice (UBL 2.1)
create_einvoiceCreate a validated EU e-invoice (UBL 2.1) from simple JSON. invoice = {format: en16931|xrechnung|peppol-bis3, invoice_number, issue_date (YYYY-MM-DD), due_date?, tax_point_date?, delivery_date?, currency (EUR), buyer_reference?, seller: {name, vat_id, street, city, postal_code, country, email, phone, contact_name, company_id?, company_id_scheme?, legal_form?}, buyer: {...}, lines: [{description, quantity, unit_price, unit?, vat_category (S|Z|E|AE|K|G|O), vat_rate}], payment: {iban, bic?, terms?}}. Totals and VAT breakdown are computed; returns {valid, xml, totals, errors, fixes}. autofix=true applies the safe fixes (date formats, codes, VAT ID format, misnamed fields) first and returns the corrected input in autofix.invoice.
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": {
"invoice": "<invoice>"
},
"name": "create_einvoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| autofix | No | If true, first apply safe input fixes (date formats, codes, VAT ID format, misnamed fields); the corrected input is in autofix.invoice. | |
| invoice | Yes | Invoice as simple JSON: format, invoice_number, issue_date, currency, seller, buyer, lines, payment (see the tool description). |