Skip to main content
Glama

InkVoice — XRechnung & E-Invoicing

create_xrechnung

Builds a German XRechnung 3.x electronic invoice (EN 16931, CII syntax) from invoice details and returns the XML as text. This is the format German public-sector buyers are legally required to receive, and that many private B2B buyers now ask for.

The EN 16931 business rules are checked before anything is built, and a rejected call comes back naming the rules that failed and the business term (BT-xx) each concerns. The ones worth getting right up front: tax category S requires a rate above 0 %, categories Z, E and AE require exactly 0 %, E and AE additionally require a stated exemption reason (BT-120), and both parties need an email address because XRechnung makes the electronic address (BT-34, BT-49) mandatory. For a public-sector buyer, put their Leitweg-ID in buyerReference (BT-10) — check_leitweg_id will verify it first.

What this does NOT do:

  • It does not validate against the KoSIT Prüftool. It applies our reading of EN 16931, which is not the same thing as the Schematron suite a receiving portal runs. Use validate_einvoice for a second look, and the official validator before a deadline.

  • It does not produce ZUGFeRD or Factur-X. There is no PDF and no embedded XML — this is a bare XML file.

  • It handles ONE tax rate and one tax category for the whole invoice. A document mixing 19 % and 7 % lines is not expressible here.

  • It does not send the invoice anywhere, and there is no Peppol.

Nothing is stored: no account, no invoice record, no retained personal data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
invoiceYesThe invoice to turn into an XRechnung document.

Schema Changelog

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

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Given no annotations were provided, the description carries the full behavioral burden and excels. It discloses failure modes (rejected calls name the BT-xx rule violated), side-effect-free execution ("Nothing is stored"), and numerous non-behaviors: no Peppol, no PDF, no multi-rate support, no Schematron validation. This is exemplary transparency.

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?

The description is long but every section earns its place: core behavior, critical tax-rule guidance, a 'what this does NOT do' list, and data-retention disclosure. It is front-loaded with the one-sentence purpose and then organized into scannable blocks, though the tax-rule detail could arguably be trimmed for the most common cases.

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?

Given the complex nested invoice schema and no output schema, the description covers the essential behavioral gaps: return format (XML as text), error/rejection behavior (returns named BT-xx failures), constraints (one tax rate, one category, bare XML), and non-goals (no ZUGFeRD, no Peppol, no persistence). This is unusually complete for a high-complexity tool.

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?

The schema names fields like taxCategoryCode and buyerReference, but the description adds critical semantics not inferable from types alone: tax category S implies a specific reduction, AE requires BT-120, the Leitweg-ID must go into buyerReference (BT-10), and the single-rate limitation. It also gives email/contact guidance missing from 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 description opens with a clear verb+resource: "Builds a ... electronic invoice ... and returns the XML as text." It precisely distinguishes itself from siblings by naming what it does NOT do (no ZUGFeRD, no Peppol, no PDF) and what it uniquely handles (EN 16931 rule pre-checks), so an agent can select it without opening the 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?

Explicit routing guidance is everywhere: use validate_einvoice for a second opinion, use check_leitweg_id for BT-10 lookup, and avoid this tool for multi-rate invoices or when a Schematron-level guarantee is required. Conditions like 'tax category S requires reduction', 'AE requires BT-120', and 'public sector => put Leitweg ID in BT-10' give concrete call-time decision rules.

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