Skip to main content
Glama

Factur-X: Generate & Validate E-Invoices

Generate an EN 16931 invoice

generate_invoice
Read-onlyIdempotent

Create an EN 16931 e-invoice from structured data: Factur-X PDF/A-3, CII XML, or UBL 2.1 XML.

Use when you have the parties, lines and dates and need the document. To revise one, correct the input
and regenerate; save and deliver the returned file through your own system. Do not use when you already have a
visual PDF and CII XML: call embed_xml. To check a document you did not create here, call validate_invoice;
to read one, call extract_invoice.

Start invoice from get_invoice_example, replacing sample parties and dates. Leave totals and line
net_amount omitted to compute them from quantities, prices, allowances and charges. For ubl-xml,
profile must be en16931 or extended-ctc-fr; extended and basicwl are CII/PDF-only. profile selects
the XML model while check selects validation rules: use check=base for non-French invoices;
changing check does not disable party_check. language and footer_text affect only the visual PDF.

Omitted party_check enables registry checks only for extended-ctc-fr; true/false explicitly
overrides that default. Enabled checks send party identifiers/address and seller IBAN to EU Verify.
A not_ready verdict blocks output with field pointers. Successful checks add evidence ids;
registry outages do not block generation and are reported as warnings, not proof of readiness.
XSD/business-rule failures return a tool error with rule ids; fix the input and retry.

Requires an authenticated trial, prepaid or subscription allowance (OAuth or API key).
Each successful result uses one document operation, including repeated calls.
Returns a JSON text summary (totals, warnings, evidence) and an embedded resource: base64 PDF
or XML text. No invoice is stored or sent to a recipient.

Input Schema

NameRequiredDescriptionDefault
checkNoRule set the output must pass before it is returned: fr-ctc (default) = EN 16931 + French CTC rules (BR-FR-*), base = EN 16931 only (non-French sellers).fr-ctc
outputNofacturx-pdf (default): PDF/A-3 with the visual invoice and CII XML inside, the hybrid file French platforms accept. cii-xml: UN/CEFACT CII XML alone. ubl-xml: UBL 2.1 XML alone.facturx-pdf
invoiceYesInvoice data: seller, buyer, lines, dates, payment terms. Amounts are decimal strings ("1200.00"), dates ISO 8601. Totals and the VAT breakdown are computed. Full JSON Schema in the resource facturx://schema/invoice.
profileNoEN 16931 conformance level written in the XML: en16931 (default, full semantic model), extended (optional business terms), extended-ctc-fr (French B2B mandate; parties are checked before the file is emitted), basicwl (no lines)en16931
languageNoLanguage of the visual PDF: fr (default) or en. Ignored when output is cii-xml or ubl-xml.fr
footer_textNoOptional text printed in the PDF footer. Omit it for no footer. Ignored for XML-only output.
party_checkNoAsk EU Verify whether the seller and buyer are invoice-ready before emitting. true checks. false skips. Omit it and extended-ctc-fr checks, other profiles do not. not_ready is a tool error and no file is returned.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • addedInput schema / properties / invoice / type
      Added value: +"object"
    • addedInput schema / properties / language / type
      Added value: +"string"
    • addedInput schema / properties / output / type
      Added value: +"string"
    • addedInput schema / properties / profile / type
      Added value: +"string"
  2. Changed3 schema fields changed
    • changedInput schema / properties / footer_text / description
      Previous value: -"Optional footer text on the PDF"New value: +"Optional text printed in the PDF footer. Omit it for no footer. Ignored for XML-only output."
    • changedInput schema / properties / language / description
      Previous value: -"Language of the visual PDF: fr or en"New value: +"Language of the visual PDF: fr (default) or en. Ignored when output is cii-xml or ubl-xml."
    • changedInput schema / properties / party_check / description
      Previous value: -"Ask EU Verify whether the seller and buyer are invoice-ready before emitting. Defaults to true for extended-ctc-fr. not_ready returns an error and no file."New value: +"Ask EU Verify whether the seller and buyer are invoice-ready before emitting. true checks. false skips. Omit it and extended-ctc-fr checks, other profiles do not. not_ready is a tool error and no file is returned."
  3. Changed3 schema fields changed
    • changedInput schema / properties / output / description
      Previous value: -"facturx-pdf (default): PDF/A-3 with the visual invoice and the CII XML embedded, the format French platforms accept. cii-xml: the UN/CEFACT CII XML alone. ubl-xml: UBL 2.1 XML alone (Peppol-style)."New value: +"facturx-pdf (default): PDF/A-3 with the visual invoice and CII XML inside, the hybrid file French platforms accept. cii-xml: UN/CEFACT CII XML alone. ubl-xml: UBL 2.1 XML alone."
    • changedInput schema / properties / party_check / description
      Previous value: -"Check parties with EU Verify before emitting. Defaults to true for extended-ctc-fr."New value: +"Ask EU Verify whether the seller and buyer are invoice-ready before emitting. Defaults to true for extended-ctc-fr. not_ready returns an error and no file."
    • changedInput schema / properties / profile / description
      Previous value: -"Factur-X conformance level written in the XML: en16931 (default, full EN 16931 semantic model), extended (adds optional business terms), extended-ctc-fr (French B2B mandate profile), basicwl (no lines)"New value: +"EN 16931 conformance level written in the XML: en16931 (default, full semantic model), extended (optional business terms), extended-ctc-fr (French B2B mandate; parties are checked before the file is emitted), basicwl (no lines)"
  4. Changed1 schema field changed
    • addedInput schema / properties / party_check
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "boolean"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Check parties with EU Verify before emitting. Defaults to true for extended-ctc-fr.",
      +  "title": "Party Check"
      +}
  5. Changed4 schema fields changed
    • changedInput schema / properties / check / description
      Previous value: -"Schematron rule set: EN 16931 base or + French CTC rules"New value: +"Rule set the output must pass before it is returned: fr-ctc (default) = EN 16931 + French CTC rules (BR-FR-*), base = EN 16931 only (non-French sellers)."
    • addedInput schema / properties / invoice / description
      Added value: +"Invoice data: seller, buyer, lines, dates, payment terms. Amounts are decimal strings (\"1200.00\"), dates ISO 8601. Totals and the VAT breakdown are computed. Full JSON Schema in the resource facturx://schema/invoice."
    • changedInput schema / properties / output / description
      Previous value: -"facturx-pdf (PDF/A-3 with XML, default), cii-xml or ubl-xml"New value: +"facturx-pdf (default): PDF/A-3 with the visual invoice and the CII XML embedded, the format French platforms accept. cii-xml: the UN/CEFACT CII XML alone. ubl-xml: UBL 2.1 XML alone (Peppol-style)."
    • changedInput schema / properties / profile / description
      Previous value: -"EN 16931 conformance level: en16931 (default), extended, extended-ctc-fr, basicwl"New value: +"Factur-X conformance level written in the XML: en16931 (default, full EN 16931 semantic model), extended (adds optional business terms), extended-ctc-fr (French B2B mandate profile), basicwl (no lines)"
  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 past the annotations: it discloses that each successful result consumes one document operation (including repeats), that an authenticated trial/prepaid/subscription allowance is required, that enabled party checks transmit party identifiers/addresses and the seller IBAN to an EU Verify service, that a not_ready verdict blocks output while registry outages only warn, and that no invoice is stored or sent. It is consistent with readOnlyHint (nothing persisted) and openWorldHint (external registry calls).

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?

Seven short paragraphs ordered purpose → usage → alternatives → workflow → parameter interactions → billing/auth → returns, which is well front-loaded. It is dense and every block is on-topic, but the size is close to the ceiling for a description and several lines restate constraints already present in the schema.

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 carries the return contract itself: a JSON text summary (totals, warnings, evidence) plus an embedded base64 PDF or XML text resource. Combined with auth requirements, error semantics (XSD/business-rule tool errors with rule ids, not_ready blocking, warnings on registry outage) and regeneration guidance, nothing needed to invoke or interpret the tool is missing.

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?

Despite 100% schema coverage, the description adds cross-parameter constraints the schema does not carry: profile selects the XML model while check selects rule sets, check=base is for non-French sellers and disabling it does not disable party_check, ubl-xml only supports en16931 or extended-ctc-fr while extended/basicwl are CII/PDF-only, and language/footer_text affect only the visual PDF. This is well above the baseline, though details of the large nested invoice object are deferred to the referenced schema resource.

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?

Opens with a specific verb + resource + artifact set ('Create an EN 16931 e-invoice ... Factur-X PDF/A-3, CII XML, or UBL 2.1 XML'), so the agent knows exactly what is produced. It explicitly differentiates itself from four named siblings (embed_xml, validate_invoice, extract_invoice, get_invoice_example), so selection is unambiguous.

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 the trigger ('Use when you have the parties, lines and dates and need the document'), the revision path ('correct the input and regenerate'), and a negative case with a routed alternative ('Do not use when you already have a visual PDF and CII XML: call embed_xml'). It further routes read/check workloads to extract_invoice and validate_invoice.

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