Skip to main content
Glama

Factur-X: Generate & Validate E-Invoices

Embed CII XML into a PDF

embed_xml
Read-onlyIdempotent

Combine a visual PDF you already have with CII XML into one Factur-X PDF/A-3.

Use for an existing visual invoice; use generate_invoice to render invoice data or produce UBL.
Match the PDF's parties, lines and totals to xml yourself: check examines only XML and cannot detect
disagreement with the visible PDF. The embedded profile comes from xml; neither check nor language
changes it. language does not translate the PDF.

Invalid input or failed rules return a tool error with no file; rule errors include ids. For a
findings report use validate_invoice. Success returns a JSON summary (profile, size_bytes, warning
count) and a base64 PDF/A-3 resource. Requires a trial, prepaid or subscription allowance via OAuth or key; success consumes one document, errors
consume none. Nothing is stored or sent.

Input Schema

NameRequiredDescriptionDefault
xmlYesUnencoded CII XML text (Factur-X / EN 16931); UBL is not supported.
checkNoXML validation rules: fr-ctc adds French BR-FR-* to EN 16931; base uses EN 16931 only.fr-ctc
languageNoLanguage written in the PDF metadata: fr (default) or en.fr
pdf_base64YesStandard base64 of PDF bytes starting with %PDF-. Not a URL or data-URI.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / language / type
      Added value: +"string"
  2. Changed3 schema fields changed
    • changedInput schema / properties / check / description
      Previous value: -"Rule set the XML must pass before embedding: fr-ctc (default, EN 16931 plus French BR-FR-*) or base (EN 16931 only). A failed check is a tool error listing the rule ids, not a validation report, and no PDF is returned."New value: +"XML validation rules: fr-ctc adds French BR-FR-* to EN 16931; base uses EN 16931 only."
    • changedInput schema / properties / pdf_base64 / description
      Previous value: -"Required. Standard base64 of the visual invoice PDF. After decoding it must be a PDF (bytes start with %PDF-). Invalid base64 or a non-PDF is a tool error and no file is returned. The PDF is converted to PDF/A-3."New value: +"Standard base64 of PDF bytes starting with %PDF-. Not a URL or data-URI."
    • changedInput schema / properties / xml / description
      Previous value: -"Required. CII XML for the same invoice (Factur-X / EN 16931). UBL and any other flavor cannot be embedded: that is a tool error and no PDF is returned. The XML must pass `check` or the tool errors with the rule ids and returns no PDF."New value: +"Unencoded CII XML text (Factur-X / EN 16931); UBL is not supported."
  3. Changed4 schema fields changed
    • changedInput schema / properties / check / description
      Previous value: -"Rule set the XML must pass before embedding: fr-ctc (default, France) or base (EN 16931 only)"New value: +"Rule set the XML must pass before embedding: fr-ctc (default, EN 16931 plus French BR-FR-*) or base (EN 16931 only). A failed check is a tool error listing the rule ids, not a validation report, and no PDF is returned."
    • changedInput schema / properties / language / description
      Previous value: -"Document language written in the PDF metadata: fr or en"New value: +"Language written in the PDF metadata: fr (default) or en."
    • changedInput schema / properties / pdf_base64 / description
      Previous value: -"Your existing visual invoice PDF (any PDF, will be converted to PDF/A-3), base64 encoded"New value: +"Required. Standard base64 of the visual invoice PDF. After decoding it must be a PDF (bytes start with %PDF-). Invalid base64 or a non-PDF is a tool error and no file is returned. The PDF is converted to PDF/A-3."
    • changedInput schema / properties / xml / description
      Previous value: -"CII XML for the same invoice (Factur-X or EN 16931). It must pass the `check` rules or the tool fails"New value: +"Required. CII XML for the same invoice (Factur-X / EN 16931). UBL and any other flavor cannot be embedded: that is a tool error and no PDF is returned. The XML must pass `check` or the tool errors with the rule ids and returns no PDF."
  4. Changed1 schema field changed
    • changedInput schema / properties / xml / description
      Previous value: -"Factur-X / CII XML text for the same invoice; must pass the `check` rules or the tool fails"New value: +"CII XML for the same invoice (Factur-X or EN 16931). It must pass the `check` rules or the tool fails"
  5. Changed4 schema fields changed
    • changedInput schema / properties / check / description
      Previous value: -"Rule set to enforce before embedding"New value: +"Rule set the XML must pass before embedding: fr-ctc (default, France) or base (EN 16931 only)"
    • changedInput schema / properties / language / description
      Previous value: -"Document language metadata"New value: +"Document language written in the PDF metadata: fr or en"
    • changedInput schema / properties / pdf_base64 / description
      Previous value: -"Your visual invoice PDF, base64 encoded"New value: +"Your existing visual invoice PDF (any PDF, will be converted to PDF/A-3), base64 encoded"
    • changedInput schema / properties / xml / description
      Previous value: -"Factur-X / CII XML text (must pass EN 16931 rules)"New value: +"Factur-X / CII XML text for the same invoice; must pass the `check` rules or the tool fails"
  6. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Goes well beyond the annotations: it discloses error semantics (tool error, no file, rule ids included), the success payload shape, the billing model (success consumes one document, errors consume none), auth requirements, and a no-storage/no-transmission guarantee. It also warns that check examines XML only and cannot detect PDF/XML disagreement, which is behavior an agent could not otherwise predict.

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?

Well front-loaded and nearly every sentence carries operational information, but it reads as a dense block of eight sentences without grouping; the constraint clauses (check/profile/language) could be consolidated. Efficient, though not maximally scannable.

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?

With no output schema, the description compensates by describing the return value (JSON summary with profile, size_bytes, warning count, plus a base64 PDF/A-3 resource), failure behavior, prerequisites, and cost. An agent has everything needed to call this correctly and interpret the result.

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 the baseline is 3, but the description adds real semantic meaning: check cannot reconcile against the visible PDF, the embedded profile is taken from xml, and language neither changes the profile nor translates the PDF. These clarify parameter effects that the schema descriptions do not state.

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?

The first sentence names a specific verb and resource ('Combine a visual PDF ... with CII XML into one Factur-X PDF/A-3') and the second immediately separates it from generate_invoice and validate_invoice. An agent can distinguish this from all ten siblings without opening a 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?

Explicit when-to-use ('Use for an existing visual invoice'), explicit alternatives for adjacent needs ('use generate_invoice to render invoice data or produce UBL', 'For a findings report use validate_invoice'), and an explicit precondition that the caller must reconcile PDF and XML themselves. Nothing is left to inference.

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