Validate Ubl Invoice
validate_ubl_invoiceValidate UBL 2.1 invoice XML for structural correctness, checking required core fields like invoice number, dates, seller, buyer, and line items. Returns validation results with warnings or errors.
Instructions
Validate a UBL 2.1 invoice XML string for structural correctness.
Performs structural validation by parsing the XML into an EN16931Invoice and checking that required core fields (invoice_number, invoice_date, seller, buyer, at least one line item) are present and non-empty.
Note: this tool does NOT validate against the normative UBL 2.1 XSD schema (the UBL XSD files are not bundled with this package). For full XSD validation use a dedicated UBL validator or the Peppol Validator tool.
On success returns {'valid': true, 'warnings': list[str]}. On failure returns {'valid': false, 'errors': list[str]}. On parse error returns {'valid': false, 'errors': ['XML parse error: ...']}.
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_string": "<xml_string>"
},
"name": "validate_ubl_invoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xml_string | Yes | UBL 2.1 Invoice or CreditNote XML string to validate. Must contain a root element in the UBL Invoice-2 or CreditNote-2 namespace. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||