Skip to main content
Glama

Invoiceer e-invoicing tools

Create an e-invoice

create_einvoice
Read-only

Create a valid e-invoice from structured data: XRechnung 3.0 (UBL or CII), ZUGFeRD / Factur-X PDF (EN 16931) or Peppol BIS Billing 3.0. The file is checked with the official KoSIT validator before it is returned; if it fails, you get the rule errors instead of a file. XML comes back as text in xml, the ZUGFeRD PDF as base64 in pdf_base64. XRechnung needs a seller contact (contact, phone, email), a buyer email or Peppol ID (electronic address), a buyer_reference (Leitweg-ID for German authorities) and payment details (iban). Peppol needs peppol_id for seller and buyer.

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": {
      "number": "<number>",
      "seller": "<seller>",
      "buyer": "<buyer>",
      "lines": "<lines>"
    },
    "name": "create_einvoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
bicNo
ibanNo
noteNo
buyerYes
linesYes
formatNoxrechnung-ubl
numberYes
sellerYes
currencyNoEUR
due_dateNoYYYY-MM-DD, default issue + 14 days
issue_dateNoYYYY-MM-DD, default today
period_endNo
credit_noteNo
paid_amountNoAlready paid (BT-113), e.g. down payments
skonto_baseNoOptional base amount if Skonto applies to part of the amount due
skonto_daysNoEarly-payment discount (Skonto): days; written into BT-20 in the XRechnung format (BR-DE-18)
period_startNo
delivery_dateNoYYYY-MM-DD delivery / service date (BT-72); default: issue date unless a period is given
exempt_reasonNoBT-120 text for VAT-exempt (E) lines; default for DE/FR small businesses without VAT ID: § 19 UStG / art. 293 B CGI; for VATEX-EU-D: Sonderregelung für Reisebüros
payment_termsNo
skonto_percentNoSkonto percentage, e.g. 2
buyer_referenceNo
order_referenceNo
payment_referenceNo
preceding_invoiceNoOriginal invoice number (credit notes)
exempt_reason_codeNoBT-121 VAT exemption reason code from the CEF VATEX list, e.g. VATEX-EU-D for the travel agency margin scheme (§ 25 UStG; lines use vat_category E, rate 0). VATEX-EU-G/O/IC/AE need category G/O/K/AE. VATEX-EU-306 is rejected (fails BR-CL-22).
preceding_invoice_dateNoYYYY-MM-DD, date of the original invoice (BT-26; required for French sellers)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / exempt_reason / description
      Previous value: -"BT-120 text for VAT-exempt (E) lines; default for DE/FR small businesses without VAT ID: § 19 UStG / art. 293 B CGI"New value: +"BT-120 text for VAT-exempt (E) lines; default for DE/FR small businesses without VAT ID: § 19 UStG / art. 293 B CGI; for VATEX-EU-D: Sonderregelung für Reisebüros"
    • addedInput schema / properties / exempt_reason_code
      Added value: +{
      +  "description": "BT-121 VAT exemption reason code from the CEF VATEX list, e.g. VATEX-EU-D for the travel agency margin scheme (§ 25 UStG; lines use vat_category E, rate 0). VATEX-EU-G/O/IC/AE need category G/O/K/AE. VATEX-EU-306 is rejected (fails BR-CL-22).",
      +  "type": "string"
      +}
  2. Changed1 schema field changed
    • addedInput schema / properties / delivery_date
      Added value: +{
      +  "description": "YYYY-MM-DD delivery / service date (BT-72); default: issue date unless a period is given",
      +  "type": "string"
      +}
  3. Changed4 schema fields changed
    • addedInput schema / properties / exempt_reason
      Added value: +{
      +  "description": "BT-120 text for VAT-exempt (E) lines; default for DE/FR small businesses without VAT ID: § 19 UStG / art. 293 B CGI",
      +  "type": "string"
      +}
    • addedInput schema / properties / preceding_invoice_date
      Added value: +{
      +  "description": "YYYY-MM-DD, date of the original invoice (BT-26; required for French sellers)",
      +  "type": "string"
      +}
    • addedInput schema / properties / seller / properties / supplier_id
      Added value: +{
      +  "description": "Seller identifier at the buyer (BT-29)",
      +  "type": "string"
      +}
    • addedInput schema / properties / seller / properties / tax_number
      Added value: +{
      +  "description": "Tax number (BT-32) if the seller has no VAT ID: German Steuernummer (Kleinunternehmer), French SIREN (franchise en base)",
      +  "type": "string"
      +}
  4. Changed4 schema fields changed
    • addedInput schema / properties / paid_amount
      Added value: +{
      +  "description": "Already paid (BT-113), e.g. down payments",
      +  "type": "number"
      +}
    • addedInput schema / properties / skonto_base
      Added value: +{
      +  "description": "Optional base amount if Skonto applies to part of the amount due",
      +  "type": "number"
      +}
    • addedInput schema / properties / skonto_days
      Added value: +{
      +  "description": "Early-payment discount (Skonto): days; written into BT-20 in the XRechnung format (BR-DE-18)",
      +  "type": "integer"
      +}
    • addedInput schema / properties / skonto_percent
      Added value: +{
      +  "description": "Skonto percentage, e.g. 2",
      +  "type": "number"
      +}
  5. Added

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the annotations, it discloses the critical behavioral gate: the file is checked by the official KoSIT validator and on failure the caller receives rule errors instead of a file. It also states exactly what comes back (XML as text in `xml`, ZUGFeRD PDF as base64 in `pdf_base64`), which matters since there is no output schema. The "create" wording is consistent with readOnlyHint=true because the artifact is returned, not persisted.

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 sentences, front-loaded with purpose, then return payload, then format prerequisites. Every clause carries operational information: format names, validator behavior, response keys, required fields. No filler or restatement of the 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 high-complexity, 27-parameter generator with no output schema, the definition covers purpose, validation behavior, return shape, and per-format requirements. Gaps remain around less common options (credit_note handling, skonto/discount fields, currency, default format behavior), which an agent would have to infer from schema descriptions.

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?

With 27 parameters at 41% schema coverage, the description adds genuine cross-parameter semantics the schema cannot express: which fields become mandatory per format and the role of buyer_reference as a Leitweg-ID and peppol_id as an electronic address. Many top-level parameters (credit_note, skonto_*, currency, format default) remain unexplained in prose, though several carry schema descriptions.

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 definition opens with a specific verb and resource ("Create a valid e-invoice from structured data") and enumerates the exact supported standards (XRechnung 3.0 UBL/CII, ZUGFeRD/Factur-X, Peppol BIS 3.0). That is enough to separate it from read_invoice_pdf or validate_einvoice, which operate on existing documents.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives concrete per-format prerequisites (XRechnung needs seller contact, buyer electronic address, buyer_reference/Leitweg-ID, iban; Peppol needs peppol_id on both parties), which tells an agent when each format choice is viable. It stops short of explicitly routing the agent to validate_einvoice for pre-existing files or naming exclusions, so it is strong context rather than full when/when-not guidance.

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