Skip to main content
Glama

Factur-X: Generate & Validate E-Invoices

Validate your invoice document

validate_invoice
Read-onlyIdempotent

Check a Factur-X PDF, CII XML or UBL XML against EN 16931, and report the fields to fix.

Use when the caller supplies a document, including after corrections; use extract_invoice for business data.
With no document and only a request to try the product, choose view_invoice_demo instead.
Supply one source: nonblank xml overrides document_base64 without inspecting it. To check a PDF's
attachment, omit xml. check adds rules to the detected profile; it cannot change that profile.
Use base for non-French invoices to avoid French-field findings.

Returns validity and findings with rule ids and field pointers for explain_finding. XSD failures
skip schematron; inspect checks_skipped before treating validation as complete. Warnings alone do
not invalidate an invoice. Rule failures or a PDF without XML return valid=false; missing input,
invalid base64, malformed or unrecognized XML return a tool error.
Free without a key (shared daily limit, files up to 5 MB). With an OAuth connection or API key,
completed reports consume one operation even when invalid; tool errors do not.
No invoice is changed, stored or sent.

Input Schema

NameRequiredDescriptionDefault
xmlNoCII or UBL XML as unencoded text.
checkNofr-ctc: EN 16931 plus French CTC rules (BR-FR-*). base: EN 16931 only.fr-ctc
document_base64NoStandard base64 of a Factur-X PDF, CII XML or UBL XML file; no data-URI prefix.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / check / description
      Previous value: -"fr-ctc (default): EN 16931 plus French CTC rules (BR-FR-*). base: EN 16931 only. A failed rule is a normal result with valid false and findings, not a tool error."New value: +"fr-ctc: EN 16931 plus French CTC rules (BR-FR-*). base: EN 16931 only."
    • changedInput schema / properties / document_base64 / description
      Previous value: -"Base64 of a Factur-X PDF, or of a CII or UBL XML file. Give this or xml. If both are set, nonblank xml is used. Invalid base64 is a tool error. Omit both and the tool errors."New value: +"Standard base64 of a Factur-X PDF, CII XML or UBL XML file; no data-URI prefix."
    • changedInput schema / properties / xml / description
      Previous value: -"CII or UBL XML as plain text. Alternative to document_base64: give exactly one. If both are set, this value is used when nonblank. Well-formed XML that is not an e-invoice is a tool error."New value: +"CII or UBL XML as unencoded text."
  2. Changed2 schema fields changed
    • changedInput schema / properties / document_base64 / description
      Previous value: -"Base64 of a Factur-X PDF, or of a CII or UBL XML file. Give this or xml. If both are set, xml is used. Invalid base64 is a tool error. Omit both and the tool errors."New value: +"Base64 of a Factur-X PDF, or of a CII or UBL XML file. Give this or xml. If both are set, nonblank xml is used. Invalid base64 is a tool error. Omit both and the tool errors."
    • changedInput schema / properties / xml / description
      Previous value: -"CII or UBL XML as plain text. Alternative to document_base64: give exactly one. If both are set, this value is used. Well-formed XML that is not an e-invoice is a tool error."New value: +"CII or UBL XML as plain text. Alternative to document_base64: give exactly one. If both are set, this value is used when nonblank. Well-formed XML that is not an e-invoice is a tool error."
  3. Changed3 schema fields changed
    • changedInput schema / properties / check / description
      Previous value: -"fr-ctc (default): EN 16931 + French CTC rules (BR-FR-*). base: EN 16931 only."New value: +"fr-ctc (default): EN 16931 plus French CTC rules (BR-FR-*). base: EN 16931 only. A failed rule is a normal result with valid false and findings, not a tool error."
    • changedInput schema / properties / document_base64 / description
      Previous value: -"Factur-X PDF (the embedded XML is read), or a CII or UBL XML file, base64 encoded"New value: +"Base64 of a Factur-X PDF, or of a CII or UBL XML file. Give this or xml. If both are set, xml is used. Invalid base64 is a tool error. Omit both and the tool errors."
    • changedInput schema / properties / xml / description
      Previous value: -"CII or UBL XML as plain text; alternative to document_base64, give exactly one"New value: +"CII or UBL XML as plain text. Alternative to document_base64: give exactly one. If both are set, this value is used. Well-formed XML that is not an e-invoice is a tool error."
  4. Changed1 schema field changed
    • changedInput schema / properties / document_base64 / description
      Previous value: -"Factur-X PDF (the embedded XML is read) or a CII/UBL XML file, base64 encoded"New value: +"Factur-X PDF (the embedded XML is read), or a CII or UBL XML file, base64 encoded"
  5. Changed3 schema fields changed
    • changedInput schema / properties / check / description
      Previous value: -"EN 16931 base rules or + French CTC rules (default)"New value: +"fr-ctc (default): EN 16931 + French CTC rules (BR-FR-*). base: EN 16931 only."
    • changedInput schema / properties / document_base64 / description
      Previous value: -"Factur-X PDF or XML file, base64 encoded"New value: +"Factur-X PDF (the embedded XML is read) or a CII/UBL XML file, base64 encoded"
    • changedInput schema / properties / xml / description
      Previous value: -"CII or UBL XML as text (alternative to document_base64)"New value: +"CII or UBL XML as plain text; alternative to document_base64, give exactly one"
  6. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations cover only readOnly/idempotent/openWorld, so the description carries the real burden and delivers: XSD failures skip schematron (check checks_skipped), warnings alone do not invalidate, rule failures or PDF-without-XML yield valid=false while malformed input yields a tool error, and it discloses the free-tier 5 MB / shared daily limit and per-operation cost. It also confirms no invoice is changed, stored or sent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with purpose, then routing, then behavior, then billing; nearly every sentence carries a distinct fact. It is dense and longer than typical for a three-parameter tool, but the length buys real behavioral detail rather than filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Even though an output schema exists, the description explains the shape of outcomes (validity, findings with rule ids and field pointers for explain_finding, checks_skipped). Combined with the routing rules and error-mode taxonomy, an agent has everything needed to call this correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds cross-parameter semantics the schema cannot express: xml overrides document_base64 without inspecting it, omitting xml targets the PDF attachment, and check adds rules to the detected profile but cannot change it. It does not restate the base64 encoding requirement, which the schema already covers.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (check/validate), the exact resource formats (Factur-X PDF, CII XML, UBL XML) and the standard applied (EN 16931), plus the deliverable (fields to fix). It is immediately distinguishable from extract_invoice and view_invoice_demo, which it names directly.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit routing rules: use when the caller supplies a document including after corrections; use extract_invoice for business data; use view_invoice_demo when there is no document and only a product-trial request. Also states the base-vs-fr-ctc selection condition for non-French invoices.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources