Skip to main content
Glama

Generate Factur-X invoice

generate_invoice
Read-onlyIdempotent

Create a new, compliant e-invoice (Factur-X PDF/A-3, CII XML or UBL XML) from structured invoice data.

Use when you have the invoice content (parties, lines, dates) and need the document. Do not use when you
already have a visual PDF and a Factur-X XML to combine: call embed_xml. To check a document you did not
create here, call validate_invoice; to read one, call extract_invoice.

The result is validated (XSD + schematron for `check`) before it is returned; on failure the tool returns
an error listing the failing rule ids (e.g. BR-CO-10, BR-FR-01) so you can fix the input and retry.
Nothing is stored. Returns a text summary (number, totals, warnings) plus the document as an embedded
resource: base64 PDF for facturx-pdf, XML text for cii-xml / ubl-xml.

Input Schema

TableJSON 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 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).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.
profileNoFactur-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)en16931
languageNoLanguage of the visual PDF: fr or enfr
footer_textNoOptional footer text on the PDF

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 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)"
  2. First observed

TDQS

A5/5.0
Behavior5/5

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

The description discloses important behavior beyond the annotations: the output is validated (XSD + schematron) before being returned, failure yields error rule IDs (BR-CO-10, BR-FR-01), nothing is stored, and the return structure is summarized (text summary + embedded resource with format-specific encodings). This is significant context the annotations do not provide.

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

Conciseness5/5

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

The description is well-organized and front-loaded: the core purpose appears in the first sentence, followed by clear routing guidance, then behavioral details. Each sentence earns its place without redundancy. The formatting with line breaks and bullet-like structure improves scannability for an agent.

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?

For a complex generation tool with nested schemas, the description covers the key decision points (output format, check profile, when to use siblings), the expected input semantics, the validation behavior, and the return shape. It does not need to document every nested field because the schema already does that at 100% coverage. The absence of an output schema is compensated by a clear summary of the return value.

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?

Although the schema has 100% coverage, the description adds crucial semantic meaning for the top-level parameters: it explains what 'check' rule sets mean (fr-ctc vs base), what each output format produces in practice, and clarifies that 'invoice' amounts are decimal strings and dates are ISO 8601. It also notes that totals and VAT breakdown are computed, which is not explicit in the schema's property descriptions alone.

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 description states a specific verb ('Create'), a clear resource ('compliant e-invoice), and enumerates the exact output formats (Factur-X PDF/A-3, CII XML, UBL XML). It distinguishes the tool from its siblings by explicitly naming embed_xml, validate_invoice, and extract_invoice and stating what each is for.

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?

The description gives explicit when-to-use ('Use when you have the invoice content...') and when-not-to-use ('Do not use when you already have a visual PDF and a Factur-X XML to combine: call embed_xml'). It also names the alternatives for validation and extraction, making routing unambiguous.

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.

TDQS

A4.7/5.0
Disambiguation5/5

Each tool targets a distinct operation: embed_xml combines existing PDF and XML, extract_invoice reads invoice data, generate_invoice creates new invoices, and validate_invoice checks compliance. The descriptions explicitly cross-reference each other with 'do not use' guidance, eliminating ambiguity.

Naming Consistency5/5

All tool names follow the same verb_noun pattern in snake_case: embed_xml, extract_invoice, generate_invoice, validate_invoice. The naming is predictable and consistent across the entire set.

Tool Count5/5

Four tools cover the core e-invoicing operations without redundancy or bloat. The count is well-scoped for the server's purpose, fits within the typical 3-15 range, and each tool earns its place.

Completeness5/5

The set covers the full document lifecycle relevant to Factur-X: generate (create), extract (read), validate (check), and embed (combine). No obvious gaps exist; the server's stated stateless nature means additional CRUD operations are unnecessary.

Resources