Skip to main content
Glama

Export invoice as DATEV Buchungsstapel

invoice_to_datev
Read-onlyIdempotent

Convert a received e-invoice (XML or hybrid PDF) into a DATEV Buchungsstapel import file (EXTF 700) for German bookkeeping, with per-VAT-rate booking rows and account mapping.

Instructions

Convert one received (purchase) e-invoice into a DATEV Buchungsstapel import file (EXTF format 700) for German bookkeeping in DATEV Kanzlei-Rechnungswesen or Unternehmen online. Use it only for incoming invoices booked on the German side; use invoice_to_csv for a generic table, read_invoice for the raw data, validate_invoice for rule checks (this tool does not validate). Input: XML (UBL, CII, XRechnung, Peppol BIS 3, FatturaPA, KSeF FA(2)/FA(3)) or a ZUGFeRD/Factur-X hybrid PDF up to 25 MB; plain or scanned PDFs without embedded XML are rejected (no OCR). Returns the file content as one text string, decoded from cp1252: the EXTF header line, the DATEV column header, then one booking row per VAT-rate group with the gross amount and S/H flag (H for credit notes), the expense account chosen by rate under the selected SKR (e.g. SKR03 3400 for 19 %, 3300 for 7 %, 3200 for 0 %, 3120 intra-EU, 3425 reverse charge), the creditor account as Gegenkonto, document and due date, invoice number in Belegfeld 1, seller name as Buchungstext and the seller VAT id on intra-EU / reverse-charge rows. Save it as cp1252 with CRLF before importing; the account mapping is a default to confirm with the tax advisor. An unreadable file returns a tool error with the reason. Costs one invoice credit per call; without an API key the anonymous quota is 20 invoices per day per IP. Nothing is stored.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
skrNoGerman standard chart of accounts that selects the expense accounts: '03' = SKR03 (default), '04' = SKR04.03
pathNoAbsolute path of the invoice file on the machine running the server, used instead of file_base64. Only honoured over stdio (`python -m invoicein.mcp_server`); the hosted server at invoicein-api.peculiar.systems ignores it and answers with an error asking for file_base64.
file_base64NoInvoice file content, base64-encoded (standard alphabet). Accepted content: XML in UBL 2.1, CII D16B, XRechnung, Peppol BIS Billing 3, FatturaPA 1.2 or KSeF FA(2)/FA(3) syntax, or a ZUGFeRD 1.0/2.x or Factur-X hybrid PDF (the embedded XML is used). Max 25 MB decoded. Required unless `path` is given.
creditor_accountNoCreditor account (Kreditor, written as Gegenkonto) the invoice is posted against: 4–9 digits as configured in the DATEV client, e.g. '70000' (default). Use the supplier's creditor number.70000

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changedv0.1.1
    • addedInput schema / properties / creditor_account / description
      Added value: +"Creditor account (Kreditor, written as Gegenkonto) the invoice is posted against: 4–9 digits as configured in the DATEV client, e.g. '70000' (default). Use the supplier's creditor number."
    • addedInput schema / properties / creditor_account / pattern
      Added value: +"^[0-9]{4,9}$"
    • addedInput schema / properties / file_base64 / default
      Added value: +""
    • addedInput schema / properties / file_base64 / description
      Added value: +"Invoice file content, base64-encoded (standard alphabet). Accepted content: XML in UBL 2.1, CII D16B, XRechnung, Peppol BIS Billing 3, FatturaPA 1.2 or KSeF FA(2)/FA(3) syntax, or a ZUGFeRD 1.0/2.x or Factur-X hybrid PDF (the embedded XML is used). Max 25 MB decoded. Required unless `path` is given."
    • addedInput schema / properties / path
      Added value: +{
      +  "default": "",
      +  "description": "Absolute path of the invoice file on the machine running the server, used instead of file_base64. Only honoured over stdio (`python -m invoicein.mcp_server`); the hosted server at invoicein-api.peculiar.systems ignores it and answers with an error asking for file_base64.",
      +  "title": "Path",
      +  "type": "string"
      +}
    • addedInput schema / properties / skr / description
      Added value: +"German standard chart of accounts that selects the expense accounts: '03' = SKR03 (default), '04' = SKR04."
    • addedInput schema / properties / skr / enum
      Added value: +[
      +  "03",
      +  "04"
      +]
    • removedInput schema / required
      Removed value: -[
      -  "file_base64"
      -]
  2. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

Beyond the annotations (readOnly, idempotent, non-destructive), the description discloses side effects: one invoice credit per call, anonymous quota of 20 per day per IP, nothing stored, error behavior for unreadable files, and the need to save as cp1252 with CRLF.

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 dense but well-organized: purpose, usage, input details, output format, and operational notes. It front-loads the primary function and alternatives, and the length is justified by the complexity of the output format and constraints.

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?

The description covers the full return content (header line, column header, booking rows with specific fields), input acceptance rules, error handling, cost, quota, storage, and default account mapping, leaving no gaps for the agent to call it successfully.

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?

Each parameter (skr, path, file_base64, creditor_account) is explained in detail beyond the schema, including defaults, accepted formats, size limits, and when the path parameter is ignored, fully complementing the 100% schema coverage.

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 clearly states the tool converts a received purchase e-invoice to a DATEV Buchungsstapel (EXTF 700) and explicitly distinguishes it from sibling tools (invoice_to_csv, read_invoice, validate_invoice) by noting it does not validate and is specific to German bookkeeping.

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 provides explicit usage conditions ('Use it only for incoming invoices booked on the German side') and names alternatives for other cases, giving the agent clear guidance on when to select this tool over siblings.

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