Skip to main content
Glama

Factur-X: Generate & Validate E-Invoices

Extract e-invoice data

extract_invoice
Read-onlyIdempotent

Extract invoice parties, dates, lines, totals and VAT as JSON for bookkeeping or matching.

Use validate_invoice for compliance; this performs no OCR or recalculation. Supply one source:
nonblank xml overrides document_base64 without inspecting it, so omit xml to extract a PDF's
attachment. include_xml returns that selected source for archiving or validation, not XML
reconstructed from fields. Extracted fields need mapping before use as generate_invoice input.

Returns fields and format/profile metadata, plus PDF metadata for PDF input. Missing business values
remain null; numeric values are strings. Missing input, invalid base64, malformed/unrecognized XML
or a PDF without embedded XML returns a tool error, not an empty extraction.
Requires a trial, prepaid or subscription allowance via OAuth or API key; success consumes one
operation, errors consume none. Nothing is stored or sent.

Input Schema

NameRequiredDescriptionDefault
xmlNoCII or UBL XML as unencoded text.
include_xmlNoInclude source XML text in the result; this can substantially increase response size.
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 / 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. A PDF with no embedded e-invoice XML is a tool error, not an empty result. 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 / include_xml / description
      Previous value: -"When true, the result also includes the raw XML text, which can be large. Default false returns only the parsed fields (number, dates, parties, totals, VAT, lines)."New value: +"Include source XML text in the result; this can substantially increase response size."
    • 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. XML that is not well-formed or not an e-invoice is a tool error, not an empty fields object."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. A PDF with no embedded e-invoice XML is a tool error, not an empty result. 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. A PDF with no embedded e-invoice XML is a tool error, not an empty result. 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. XML that is not well-formed or not an e-invoice is a tool error, not an empty fields object."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. XML that is not well-formed or not an e-invoice is a tool error, not an empty fields object."
  3. Changed3 schema fields changed
    • 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. A PDF with no embedded e-invoice XML is a tool error, not an empty result. Omit both and the tool errors."
    • changedInput schema / properties / include_xml / description
      Previous value: -"Also return the raw XML text (large); default false returns only the parsed fields"New value: +"When true, the result also includes the raw XML text, which can be large. Default false returns only the parsed fields (number, dates, parties, totals, VAT, lines)."
    • 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. XML that is not well-formed or not an e-invoice is a tool error, not an empty fields object."
  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 / 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 / include_xml / description
      Previous value: -"Include the raw XML in the result"New value: +"Also return the raw XML text (large); default false returns only the parsed fields"
    • 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.9/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: discloses no OCR or recalculation, source-precedence behavior, error-vs-empty semantics, null/string conventions, billing behavior ('success consumes one operation, errors consume none'), and that nothing is stored or sent. Auth requirements (OAuth/API key/allowance) are also stated.

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?

Purpose is front-loaded in the first sentence and the rest is dense but each clause carries real information (precedence, error cases, billing). It is on the longer side and could be trimmed marginally, but no sentence is 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?

An output schema exists, yet the description still clarifies null/string value handling and PDF metadata presence. Combined with error behavior, source precedence, and auth/billing constraints, nothing an agent needs to call it correctly is missing.

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

Parameters5/5

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

Schema coverage is 100% (baseline 3), but the description adds crucial semantics absent from the schema: xml takes precedence over document_base64 without inspecting it, so omit xml to extract a PDF's attachment, and include_xml returns the selected source rather than XML reconstructed from fields.

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?

Specific verb+resource: 'Extract invoice parties, dates, lines, totals and VAT as JSON for bookkeeping or matching.' It explicitly names the sibling it is not (validate_invoice) and the downstream tool it feeds (generate_invoice), so an agent can distinguish it without opening any schema.

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?

States when to use it ('bookkeeping or matching'), when to use the alternative ('Use validate_invoice for compliance'), and a prerequisite caveat about generate_invoice ('Extracted fields need mapping before use as generate_invoice input'). Explicit routing, not implied.

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