Skip to main content
Glama

Create a Factur-X / ZUGFeRD PDF

create_invoice_pdf
DestructiveIdempotent

Builds a Factur-X/ZUGFeRD invoice as a readable PDF/A-3b with embedded EN 16931 XML, so it can be emailed to a person and processed by accounting software.

Instructions

Builds a Factur-X / ZUGFeRD invoice: a PDF/A-3b page a person can read, with the EN 16931 XML embedded for software. Use it when the invoice goes to a person or by e-mail. For XML only, such as an XRechnung uploaded to a German public-sector portal, use create_invoice. Takes the same invoice object as create_invoice, money in integer minor units. language changes only the printed labels; the embedded XML is identical in every language. By default the PDF comes back as base64, which can be large; pass outputPath to write the file instead. Writing stays inside the server's working directory and never replaces an existing file unless overwrite is true. The same input always gives the same bytes, and nothing is sent anywhere. Check the result with validate_invoice (pass pdfBase64).

Input Schema

NameRequiredDescriptionDefault
invoiceYesThe invoice. Required: number, issueDate, currency, seller, buyer, lines.
profileNoFactur-X / ZUGFeRD profile. Default en16931.
languageNoLanguage of the printed labels: en, de or fr. Default en. Presentation only; the XML does not change.
templateNoPage layout. Default classic.
overwriteNoAllow replacing an existing file at outputPath. Default false.
outputPathNoWrite the PDF here instead of returning base64. Relative to the server working directory; must end in .pdf.

Output Schema

NameRequiredDescriptionDefault
sha256YesSHA-256 of the PDF bytes, hex; equal for equal input.
profileYesThe Factur-X / ZUGFeRD profile written.
warningsYesNon-fatal findings about the invoice data.
pdfBase64NoThe PDF, base64. Absent when outputPath was given.
byteLengthYesSize of the PDF in bytes.
outputPathNoAbsolute path written, when outputPath was given.
xmlFilenameYesName of the embedded XML attachment.
conformanceLevelYesConformance level declared in the PDF metadata, e.g. EN 16931.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • addedOutput schema / properties / byteLength / description
      Added value: +"Size of the PDF in bytes."
    • addedOutput schema / properties / conformanceLevel / description
      Added value: +"Conformance level declared in the PDF metadata, e.g. EN 16931."
    • addedOutput schema / properties / profile / description
      Added value: +"The Factur-X / ZUGFeRD profile written."
    • addedOutput schema / properties / sha256 / description
      Added value: +"SHA-256 of the PDF bytes, hex; equal for equal input."
    • addedOutput schema / properties / warnings / description
      Added value: +"Non-fatal findings about the invoice data."
  2. First observedv0.2.1

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds concrete behavior the agent could not otherwise know: writes are confined to the server working directory, an existing file is never replaced unless overwrite is true, output is byte-deterministic, nothing leaves the process, and the default base64 payload can be large enough to warrant outputPath. These are exactly the operational facts a caller needs before invoking a file-writing tool.

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?

Every sentence is front-loaded with purpose and carries a distinct fact: what it builds, when to use it, when not to, input contract, language behavior, output channel, overwrite safety, determinism, and verification. No sentence repeats the schema or the annotations, and nothing 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?

For a six-parameter tool with a deeply nested invoice schema and an output schema already present, the description covers the decision-relevant surface: artifact choice, input reuse, output channel trade-off, filesystem safety, determinism, and next-step validation. Return-value shape is correctly left to the output schema.

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 would be 3, but the description adds real meaning: it explains that `language` affects only printed labels while the embedded XML is identical, that `outputPath` switches the return channel from base64 to a file, that writes are sandboxed to the working directory, and that the `invoice` object is shared with create_invoice and uses integer minor units. Only per-parameter details like profile/template semantics are left to the schema.

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 the exact artifact (a Factur-X / ZUGFeRD PDF/A-3b page with EN 16931 XML embedded), which is far more specific than the name alone, and the second sentence distinguishes it from the sibling create_invoice (XML only). An agent can tell instantly which of the two produces a human-readable document.

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?

It states the positive trigger ("when the invoice goes to a person or by e-mail") and the negative one ("For XML only, such as an XRechnung uploaded to a German public-sector portal, use create_invoice"), naming the alternative explicitly. It also routes post-generation verification to validate_invoice with the pdfBase64 argument.

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