Skip to main content
Glama

embed_zugferd_pdf

Read-onlyIdempotent

Upgrade an existing visual PDF plus structured invoice JSON into a PDF/A-3b ZUGFeRD 2.5 hybrid invoice with embedded factur-x.xml, for custom PDF layouts that need compliant e-invoice embedding.

Instructions

Deterministically upgrade an existing visual PDF plus structured invoice JSON into an ISO 19005-3 PDF/A-3b ZUGFeRD 2.5 hybrid invoice with embedded factur-x.xml. Use when you already have BOTH a custom-designed PDF layout and structured invoice JSON; use generate_erechnung to render a new PDF from JSON alone, or magic_convert_pdf when you only have an unstructured PDF without JSON. Returns JSON with format ('ZUGFERD'), profile, filename, mimeType ('application/pdf'), sizeBytes, and pdfBase64 (Base64-encoded ZUGFeRD PDF/A-3b).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "pdfBase64": "<pdfBase64>",
      "invoice": "<invoice>"
    },
    "name": "embed_zugferd_pdf"
  }
}

Input Schema

NameRequiredDescriptionDefault
invoiceYesStructured German B2B invoice payload conforming to EN 16931 / XRechnung 3.0 / ZUGFeRD 2.5.
profileNoCompliance profile: 'EN16931' for standard German B2B invoices (DATEV ZUGFeRD 2.5 Comfort), or 'XRECHNUNG' for strict KoSIT XRechnung 3.0.2 public-sector rules (requires buyerReference, seller email/phone, buyer email).EN16931
pdfBase64YesBase64-encoded existing visual PDF document to upgrade to PDF/A-3b ZUGFeRD 2.5.
stampGiroCodeNoWhen true, stamps a scannable EPC SEPA GiroCode QR code onto the visual ZUGFeRD PDF using seller.bankDetails[0].iban.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed49 schema fields changedv1.0.1
    • addedInput schema / properties / invoice / description
      Added value: +"Structured German B2B invoice payload conforming to EN 16931 / XRechnung 3.0 / ZUGFeRD 2.5."
    • addedInput schema / properties / invoice / properties / buyer / description
      Added value: +"Buyer / customer legal entity, postal address, VAT ID, and electronic endpoint (BG-7)."
    • addedInput schema / properties / invoice / properties / buyer / properties / city / description
      Added value: +"Buyer city name (BT-52)."
    • changedInput schema / properties / invoice / properties / buyer / properties / countryCode / description
      Previous value: -"ISO 3166-1 alpha-2, e.g. DE"New value: +"Buyer ISO 3166-1 alpha-2 country code (BT-55), e.g. DE."
    • changedInput schema / properties / invoice / properties / buyer / properties / email / description
      Previous value: -"Buyer email (mandatory on XRECHNUNG: PEPPOL-EN16931-R010)"New value: +"Buyer electronic address email (BT-49; mandatory on XRECHNUNG per PEPPOL-EN16931-R010)."
    • addedInput schema / properties / invoice / properties / buyer / properties / name / description
      Added value: +"Buyer legal company name (BT-44)."
    • addedInput schema / properties / invoice / properties / buyer / properties / phone / description
      Added value: +"Optional buyer contact phone number (BT-57)."
    • addedInput schema / properties / invoice / properties / buyer / properties / street / description
      Added value: +"Buyer street name and house number (BT-50)."
    • changedInput schema / properties / invoice / properties / buyer / properties / vatId / description
      Previous value: -"Buyer VAT ID (required for 0% Reverse Charge AE / Intra-EU K)"New value: +"Buyer VAT ID (BT-48; mandatory for 0% Reverse Charge AE or Intra-EU K)."
    • addedInput schema / properties / invoice / properties / buyer / properties / zip / description
      Added value: +"Buyer postal / ZIP code (BT-53)."
    • changedInput schema / properties / invoice / properties / buyerReference / description
      Previous value: -"Leitweg-ID or buyer PO reference (BT-10, mandatory on XRECHNUNG)"New value: +"Leitweg-ID or buyer PO reference (BT-10; mandatory when profile is XRECHNUNG per BR-DE-15)."
    • changedInput schema / properties / invoice / properties / currency / description
      Previous value: -"ISO 4217 currency code (BT-5)"New value: +"ISO 4217 3-letter currency code (BT-5), default EUR."
    • changedInput schema / properties / invoice / properties / deliveryDate / description
      Previous value: -"Service/delivery date in YYYY-MM-DD (BT-72)"New value: +"Service or delivery date in ISO YYYY-MM-DD format (BT-72)."
    • changedInput schema / properties / invoice / properties / dueDate / description
      Previous value: -"Payment due date in YYYY-MM-DD (BT-9)"New value: +"Payment due date in ISO YYYY-MM-DD format (BT-9)."
    • addedInput schema / properties / invoice / properties / grossTotal / description
      Added value: +"Optional total gross payable amount including VAT (BT-112); verified against netTotal + vatTotal."
    • changedInput schema / properties / invoice / properties / invoiceNumber / description
      Previous value: -"Unique invoice number (BT-1), e.g. RE-2026-001"New value: +"Unique invoice number (BT-1), e.g. RE-2026-001."
    • changedInput schema / properties / invoice / properties / issueDate / description
      Previous value: -"Invoice issue date in YYYY-MM-DD (BT-2)"New value: +"Invoice issue date in ISO YYYY-MM-DD format (BT-2)."
    • addedInput schema / properties / invoice / properties / items / description
      Added value: +"Non-empty list of invoice line items (BG-25)."
    • addedInput schema / properties / invoice / properties / items / items / description
      Added value: +"Single invoice line item with net unit price, quantity, and VAT rate."
    • addedInput schema / properties / invoice / properties / items / items / properties / description / description
      Added value: +"Optional detailed item description (BT-154)."
    • addedInput schema / properties / invoice / properties / items / items / properties / lineTotalNet / description
      Added value: +"Optional net line total (BT-131); verified against quantity * unitPriceNet within 0.02 EUR."
    • addedInput schema / properties / invoice / properties / items / items / properties / name / description
      Added value: +"Item or service title (BT-153)."
    • addedInput schema / properties / invoice / properties / items / items / properties / quantity / description
      Added value: +"Billed quantity (BT-129), e.g. 10."
    • changedInput schema / properties / invoice / properties / items / items / properties / taxCategoryCode / description
      Previous value: -"Optional S, AE, K, E, G, Z, O (auto-inferred when omitted)"New value: +"Optional EN 16931 VAT category code (BT-151): S, AE, K, E, G, Z, or O; auto-inferred when omitted."
    • changedInput schema / properties / invoice / properties / items / items / properties / taxExemptionReason / description
      Previous value: -"Optional 0% VAT exemption reason (BT-120)"New value: +"Optional 0% VAT exemption reason text (BT-120), e.g. § 19 UStG Kleinunternehmer."
    • changedInput schema / properties / invoice / properties / items / items / properties / unit / description
      Previous value: -"Human unit or UN/ECE Rec 20 code (Stk, Std, Tage, pauschal, kg, piece, hour)"New value: +"Human unit or UN/ECE Rec 20 code (BT-130), e.g. Stk, Std, Tage, pauschal, kg, piece, hour."
    • addedInput schema / properties / invoice / properties / items / items / properties / unitPriceNet / description
      Added value: +"Net unit price excluding VAT (BT-146)."
    • changedInput schema / properties / invoice / properties / items / items / properties / vatPercent / description
      Previous value: -"19, 7, or 0"New value: +"Applicable German VAT rate percentage (BT-152), typically 19, 7, or 0."
    • addedInput schema / properties / invoice / properties / netTotal / description
      Added value: +"Optional total net invoice amount excluding VAT (BT-109); verified against sum of line items."
    • changedInput schema / properties / invoice / properties / paymentTermsDescription / description
      Previous value: -"Payment terms text (BT-20)"New value: +"Human-readable payment terms or skonto text (BT-20; required if dueDate is omitted)."
    • addedInput schema / properties / invoice / properties / seller / description
      Added value: +"Seller / supplier legal entity, postal address, tax identifiers, contact point, and SEPA bank account (BG-4)."
    • addedInput schema / properties / invoice / properties / seller / properties / bankDetails / description
      Added value: +"Seller SEPA bank accounts for wire transfer and EPC GiroCode QR generation (BG-17)."
    • addedInput schema / properties / invoice / properties / seller / properties / bankDetails / items / description
      Added value: +"SEPA credit transfer bank account entry."
    • addedInput schema / properties / invoice / properties / seller / properties / bankDetails / items / properties / accountHolder / description
      Added value: +"Optional account holder name (BT-85); defaults to seller.name."
    • addedInput schema / properties / invoice / properties / seller / properties / bankDetails / items / properties / bic / description
      Added value: +"Optional SWIFT/BIC bank identifier code (BT-86)."
    • changedInput schema / properties / invoice / properties / seller / properties / bankDetails / items / properties / iban / description
      Previous value: -"SEPA IBAN passing ISO 13616 MOD-97"New value: +"SEPA IBAN passing ISO 13616 MOD-97 checksum (BT-84)."
    • addedInput schema / properties / invoice / properties / seller / properties / city / description
      Added value: +"Seller city name (BT-37)."
    • changedInput schema / properties / invoice / properties / seller / properties / countryCode / description
      Previous value: -"ISO 3166-1 alpha-2, e.g. DE"New value: +"Seller ISO 3166-1 alpha-2 country code (BT-40), e.g. DE."
    • changedInput schema / properties / invoice / properties / seller / properties / email / description
      Previous value: -"Seller email (mandatory on XRECHNUNG: BR-DE-7 / R020)"New value: +"Seller contact & electronic endpoint email (BT-43 / BT-34; mandatory on XRECHNUNG per BR-DE-7 and PEPPOL-EN16931-R020)."
    • addedInput schema / properties / invoice / properties / seller / properties / name / description
      Added value: +"Seller legal company name (BT-27)."
    • changedInput schema / properties / invoice / properties / seller / properties / phone / description
      Previous value: -"Seller phone >=3 digits (mandatory on XRECHNUNG: BR-DE-6)"New value: +"Seller contact phone number with at least 3 digits (BT-42; mandatory on XRECHNUNG per BR-DE-6)."
    • addedInput schema / properties / invoice / properties / seller / properties / street / description
      Added value: +"Seller street name and house number (BT-35)."
    • changedInput schema / properties / invoice / properties / seller / properties / taxNumber / description
      Previous value: -"German Steuernummer"New value: +"Seller local German tax number / Steuernummer (BT-32)."
    • changedInput schema / properties / invoice / properties / seller / properties / vatId / description
      Previous value: -"USt-IdNr., e.g. DE123456789"New value: +"Seller VAT ID / USt-IdNr. with country prefix (BT-31), e.g. DE123456789."
    • addedInput schema / properties / invoice / properties / seller / properties / zip / description
      Added value: +"Seller postal / ZIP code (BT-38)."
    • addedInput schema / properties / invoice / properties / vatTotal / description
      Added value: +"Optional total VAT amount (BT-110); verified against VAT category breakdown."
    • changedInput schema / properties / pdfBase64 / description
      Previous value: -"Base64-encoded source visual PDF"New value: +"Base64-encoded existing visual PDF document to upgrade to PDF/A-3b ZUGFeRD 2.5."
    • addedInput schema / properties / profile / description
      Added value: +"Compliance profile: 'EN16931' for standard German B2B invoices (DATEV ZUGFeRD 2.5 Comfort), or 'XRECHNUNG' for strict KoSIT XRechnung 3.0.2 public-sector rules (requires buyerReference, seller email/phone, buyer email)."
    • addedInput schema / properties / stampGiroCode / description
      Added value: +"When true, stamps a scannable EPC SEPA GiroCode QR code onto the visual ZUGFeRD PDF using seller.bankDetails[0].iban."
  2. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true, and destructiveHint=false, so the safety profile is covered. The description adds genuinely new behavioral information: the operation is deterministic, it embeds a named payload (factur-x.xml), and it enumerates the response envelope including Base64 output. It does not cover validation-failure behavior or what happens to the source PDF, which keeps it below a 5.

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?

Three tight sentences: what it does, when to use it instead of siblings, and what it returns. The precondition is front-loaded and there is no redundant restatement of the name or title.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 4-parameter tool with deep nested objects and no output schema, the description covers selection, determinism, and the return contract, which is what an agent needs to call it. Remaining gaps are the error/validation path and the default-stamping behavior of stampGiroCode, both of which are minor since the schema documents defaults.

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

Parameters3/5

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

Schema description coverage is 100% and the nested invoice object is documented field-by-field, so the schema carries the parameter burden. The description adds no meaning beyond the schema for pdfBase64, profile, or stampGiroCode; the baseline 3 applies.

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?

States a precise verb ('upgrade') and a precisely scoped resource ('existing visual PDF plus structured invoice JSON' into an 'ISO 19005-3 PDF/A-3b ZUGFeRD 2.5 hybrid invoice with embedded factur-x.xml'). The distinction from generate_erechnung and magic_convert_pdf is embedded in the same sentence, so an agent can route 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?

Gives an explicit precondition ('when you already have BOTH a custom-designed PDF layout and structured invoice JSON') and names two concrete alternatives with the condition that selects each (JSON-only rendering, unstructured PDF without JSON). This is a full when/when-not/alternative mapping.

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