mcp-einvoicing-be
v0.10.4Belgian e-invoicing MCP server: Peppol BIS 3.0, UBL 2.1, EU PINT v1.0.1, Mercurius.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
validate_invoice_be Validate Invoice Be
Validate a UBL 2.1 XML invoice against Belgian business rules. For 'peppol-bis-3'/'pint-eu': checks the CEN EN16931 base rules (structural + arithmetic/totals, ~50 BR-* rules) via a compiled Schematron. Does NOT check the Peppol-specific overlay (profile ID registration, EndpointID scheme, narrowed code lists) — the result's metadata.scope is "en16931-base-only", and a warning is included. This is not a full Peppol BIS3 conformance check; a document that passes may still be rejected by a real Peppol Access Point (no confirmed OpenPeppol redistribution rights for the overlay rules). For 'mer…
| Parameter | Type | Description |
|---|---|---|
xml * | string | Raw UBL 2.1 XML invoice content |
profile | string | Validation profile: 'peppol-bis-3' (default), 'pint-eu', or 'mercurius' |
generate_invoice_be Generate Invoice Be
Generate a valid UBL 2.1 Belgian e-invoice XML document from structured data. Applies the correct customizationID and profileID for the selected Belgian Peppol profile. The output XML is ready for submission to the Peppol network or the Mercurius platform. Returns a dict with: - ``xml``: the generated UBL 2.1 XML string - ``customization_id``: the UBL customizationID applied (BT-24) - ``profile_id``: the UBL profileID applied (BT-23)
| Parameter | Type | Description |
|---|---|---|
invoice_data * | object | Invoice fields matching the BEInvoice schema |
profile | string | Target profile: 'peppol-bis-3' (default) or 'pint-eu' (EU PINT v1.0.1) |
transform_to_ubl Transform To Ubl
Convert a structured JSON invoice payload to UBL 2.1 XML. Unlike ``generate_invoice_be``, this tool does not run validation after transformation. Intended as a conversion step when the caller will validate separately or submit directly to a platform that performs its own validation. Returns a dict with: - ``xml``: the generated UBL 2.1 XML string - ``warnings``: list of non-fatal issues detected during transformation
| Parameter | Type | Description |
|---|---|---|
data * | object | Source invoice data matching the BEInvoice schema |
parse_ubl_invoice_be Parse Ubl Invoice Be
Parse a UBL 2.1 XML invoice into a structured dict. Accepts a Peppol BIS Billing 3.0 or EU PINT v1.0.1 UBL 2.1 document and extracts the EN 16931 core field set (header, parties, lines, tax breakdown, totals) plus Belgian extensions (OGM/VCS reference, endpoint scheme info). Returns ``{"success": true, "invoice": {...}, "be_extensions": {...}, "warnings": []}`` on success, or ``{"success": false, "error": "..."}`` on parse failure.
| Parameter | Type | Description |
|---|---|---|
xml_content * | string | Raw UBL 2.1 XML invoice content (Peppol BIS 3.0) |
lookup_vat_be Lookup Vat Be
Look up a Belgian enterprise number against the BCE/KBO public database. Accepts the number with or without the 'BE' prefix and with or without dots/spaces. Returns the enterprise's legal name, registered address, legal form, status, and NACE activity codes. Optionally set the ``BCE_API_KEY`` environment variable for authenticated access to the full BCE dataset.
| Parameter | Type | Description |
|---|---|---|
vat_number * | string | Belgian VAT/enterprise number, e.g. 'BE0123456789' or '0123456789' |
get_invoice_types_be Get Invoice Types Be
Return the supported Belgian e-invoice document types. Includes invoice (380), credit note (381), and debit note (383) with their UBL ``customizationID`` and ``profileID`` values for each supported profile (Peppol BIS Billing 3.0).
peppol_lookup_participant Peppol Lookup Participant
Check whether a business is registered on the Peppol network. Performs a DNS-over-HTTPS U-NAPTR lookup followed by an SMP service-group request to determine registration status and the list of supported document type identifiers.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | Peppol participant ID ("<scheme>:<value>") or a bare national identifier this server knows how to adapt (e.g. a VAT number, if a national identifier adapter is configured). |
environment | string | "production" or "test". |
peppol_get_service_endpoint Peppol Get Service Endpoint
Fetch the AS4 endpoint for a Peppol participant's document type. Resolves the SMP hostname via DNS, then fetches service metadata for *document_type_id*. If the SMP returns a redirect, the result's `redirect_url` is set and `endpoint_url` is None; callers must not follow more than one redirect hop (SMP 1.4.0 §3.2).
| Parameter | Type | Description |
|---|---|---|
identifier * | string | Peppol participant ID or adaptable national identifier. |
document_type_id | string | Peppol document type identifier URN (default: BIS Billing 3.0 invoice). |
environment | string | "production" or "test". |
resolve_peppol_dns Resolve Peppol Dns
Resolve the SMP hostname for a Peppol participant via DNS only. Performs the raw U-NAPTR (SML) lookup without fetching the SMP service group, useful for diagnosing whether a participant is registered in the SML independently of SMP reachability.
| Parameter | Type | Description |
|---|---|---|
identifier * | string | Peppol participant ID or adaptable national identifier. |
environment | string | "production" or "test". |
peppol_send Peppol Send
Send a UBL/CII invoice to a Peppol participant via AS4. Looks up the recipient's AS4 endpoint (SMP), builds the ebMS3/AS4 envelope, and transmits it using the supplied signing credentials.
| Parameter | Type | Description |
|---|---|---|
certificate_path * | string | Path to the PEM-encoded signing certificate. |
invoice_xml_base64 * | string | Base64-encoded UBL or CII invoice XML. |
private_key_path * | string | Path to the PEM-encoded private key. |
recipient_identifier * | string | Peppol participant ID or adaptable national identifier of the receiver. |
sender_id * | string | Peppol AP identifier of the sender. |
document_type_id | string | Peppol document type identifier URN (default: BIS Billing 3.0 invoice). |
environment | string | "production" or "test". |
private_key_password | string | Optional password for the private key. |
list_participant_id_schemes List Participant Id Schemes
List Peppol participant identifier (ICD) schemes from the OpenPeppol eDEC code list. Requires EINVOICING_PEPPOL_CODELIST_DIR to point at a local copy of the eDEC "Participant Identifier Schemes" GeneriCode export (not bundled with this package, no confirmed redistribution rights, see `mcp_einvoicing_core.peppol.codelists` module docstring).
| Parameter | Type | Description |
|---|---|---|
active_only | boolean | When True (default), omit deprecated/removed entries. |
list_document_type_ids List Document Type Ids
List Peppol document type identifiers from the OpenPeppol eDEC code list. Requires EINVOICING_PEPPOL_CODELIST_DIR (see `list_participant_id_schemes`).
| Parameter | Type | Description |
|---|---|---|
active_only | boolean | When True (default), omit deprecated/removed entries. |
list_process_ids List Process Ids
List Peppol process identifiers from the OpenPeppol eDEC code list. Requires EINVOICING_PEPPOL_CODELIST_DIR (see `list_participant_id_schemes`).
| Parameter | Type | Description |
|---|---|---|
active_only | boolean | When True (default), omit deprecated/removed entries. |
list_spis_use_case_ids List Spis Use Case Ids
List Peppol SPIS use case identifiers from the OpenPeppol eDEC code list. Requires EINVOICING_PEPPOL_CODELIST_DIR (see `list_participant_id_schemes`).
| Parameter | Type | Description |
|---|---|---|
active_only | boolean | When True (default), omit deprecated/removed entries. |
check_document_type_id_in_codelist Check Document Type Id In Codelist
Check whether a (scheme, value) pair is a recognized Peppol document type identifier. Requires EINVOICING_PEPPOL_CODELIST_DIR (see `list_participant_id_schemes`). Searches all entries regardless of state, so a historical (deprecated or removed) document type is still reported as found.
| Parameter | Type | Description |
|---|---|---|
scheme * | string | |
value * | string |
check_process_id_in_codelist Check Process Id In Codelist
Check whether a (scheme, value) pair is a recognized Peppol process identifier. Requires EINVOICING_PEPPOL_CODELIST_DIR (see `list_participant_id_schemes`).
| Parameter | Type | Description |
|---|---|---|
scheme * | string | |
value * | string |
check_participant_id_scheme_in_codelist Check Participant Id Scheme In Codelist
Check whether a 4-digit ISO 6523 ICD code (e.g. "0208") is a recognized Peppol scheme. Requires EINVOICING_PEPPOL_CODELIST_DIR (see `list_participant_id_schemes`).
| Parameter | Type | Description |
|---|---|---|
icd * | string |
get_peppol_codelist_version Get Peppol Codelist Version
Report the OpenPeppol eDEC code list release version(s) currently configured locally.
peppol_directory_search Peppol Directory Search
Search the Peppol Directory for registered participants. Public, unauthenticated search (no relation to SMP lookup). At least one of q/participant/name/country/doctype must be supplied.
| Parameter | Type | Description |
|---|---|---|
country | Exact match on ISO 3166-2 country code. | |
doctype | Exact match on a full document type identifier URN. | |
environment | string | "production" or "test". |
name | Partial match on business entity name (min. 3 characters). | |
participant | Exact match on a scheme-qualified participant ID (e.g. "iso6523-actorid-upis::0208:0123456789"). | |
q | General purpose query term, matched across all fields. | |
result_page_count | integer | Results per page. |
result_page_index | integer | 0-based result page index. |
validate_eusr_report Validate Eusr Report
Validate a Peppol End User Statistics Report (EUSR) document. Runs XSD structural validation, then Schematron business rules (requires the ``[xslt2]`` optional extra).
| Parameter | Type | Description |
|---|---|---|
report_xml_base64 * | string | Base64-encoded EUSR XML document. |
validate_tsr_report Validate Tsr Report
Validate a Peppol Transaction Statistics Report (TSR) document. Runs XSD structural validation, then Schematron business rules (requires the ``[xslt2]`` optional extra).
| Parameter | Type | Description |
|---|---|---|
report_xml_base64 * | string | Base64-encoded TSR XML document. |
validate_mls_message Validate Mls Message
Validate a Peppol Message Level Status (MLS) document. Runs the bundled MLS Schematron rules (requires the ``[xslt2]`` optional extra). No bespoke MLS XSD exists — full UBL 2.1 XSD validation is out of scope.
| Parameter | Type | Description |
|---|---|---|
mls_xml_base64 * | string | Base64-encoded MLS (UBL ApplicationResponse-2) XML. |
build_mls_message Build Mls Message
Build a document-level MLS response and return it base64-encoded. For per-line responses, build the document directly with `mcp_einvoicing_core.peppol.mls.build_mls`.
| Parameter | Type | Description |
|---|---|---|
document_reference_id * | string | The SBDH ``InstanceIdentifier`` of the source message this MLS reports on. |
issue_date * | string | ISO date string, e.g. "2026-08-23". |
mls_id * | string | The ``cbc:ID`` of this MLS document. |
receiver_scheme_id * | string | ICD scheme of the receiving endpoint (normally the original message's SBDH ``MLS_TO`` scheme). |
receiver_value * | string | Receiving endpoint value. |
response_code * | string | "AB" (Acknowledged), "AP" (Accepted), or "RE" (Rejected). |
sender_scheme_id * | string | ICD scheme of the sending Access Point's endpoint. |
sender_value * | string | Sending Access Point's endpoint value. |
description | string | Optional human-readable response text. |
issue_time | string | Optional ISO time string, e.g. "12:00:00Z". |
status_reason_code | string | Optional: "SV", "BV", "BW", or "FD" (required by the Schematron when response_code is "RE"). |
list_country_codes List Country Codes
List ISO 3166-1 alpha-2 country codes from the CEF EN 16931 code list.
check_country_code Check Country Code
Check whether *code* is a recognized ISO 3166-1 alpha-2 country code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_currency_codes List Currency Codes
List ISO 4217 currency codes from the CEF EN 16931 code list.
check_currency_code Check Currency Code
Check whether *code* is a recognized ISO 4217 currency code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_icd_codes List Icd Codes
List ISO 6523 ICD codes from the CEF EN 16931 code list.
check_icd_code Check Icd Code
Check whether *code* is a recognized ISO 6523 ICD code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_document_name_codes List Document Name Codes
List UNCL1001 document name codes from the CEF EN 16931 code list.
check_document_name_code Check Document Name Code
Check whether *code* is a recognized UNCL1001 document name code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_reference_qualifier_codes List Reference Qualifier Codes
List UNCL1153 reference qualifier codes from the CEF EN 16931 code list.
check_reference_qualifier_code Check Reference Qualifier Code
Check whether *code* is a recognized UNCL1153 reference qualifier code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_payment_means_codes List Payment Means Codes
List UNCL4461 payment means codes from the CEF EN 16931 code list.
check_payment_means_code Check Payment Means Code
Check whether *code* is a recognized UNCL4461 payment means code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_vat_category_codes List Vat Category Codes
List UNCL5305 VAT category codes from the CEF EN 16931 code list.
check_vat_category_code Check Vat Category Code
Check whether *code* is a recognized UNCL5305 VAT category code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_allowance_reason_codes List Allowance Reason Codes
List allowance reason codes from the CEF EN 16931 code list.
check_allowance_reason_code Check Allowance Reason Code
Check whether *code* is a recognized allowance reason code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_item_type_codes List Item Type Codes
List item type identification codes from the CEF EN 16931 code list.
check_item_type_code Check Item Type Code
Check whether *code* is a recognized item type identification code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_charge_reason_codes List Charge Reason Codes
List charge reason codes from the CEF EN 16931 code list.
check_charge_reason_code Check Charge Reason Code
Check whether *code* is a recognized charge reason code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_mime_codes List Mime Codes
List recognized MIME types for embedded attachments.
check_mime_code Check Mime Code
Check whether *code* is a recognized MIME type for embedded attachments.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_eas_codes List Eas Codes
List Electronic Address Scheme (EAS) codes from the CEF EN 16931 code list.
check_eas_code Check Eas Code
Check whether *code* is a recognized Electronic Address Scheme code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
list_vatex_codes List Vatex Codes
List VATEX (VAT exemption reason) codes from the CEF EN 16931 code list.
check_vatex_code Check Vatex Code
Check whether *code* is a recognized VATEX VAT exemption reason code.
| Parameter | Type | Description |
|---|---|---|
code * | string |
get_en16931_codelist_version Get En16931 Codelist Version
Report the CEF EN 16931 code-list release version(s) currently configured locally.