Skip to main content
Glama

Export invoice as CSV

invoice_to_csv
Read-onlyIdempotent

Export one European e-invoice (XML or hybrid PDF) as a flat CSV table for spreadsheet or database import. Returns the CSV as a text string.

Instructions

Export one European e-invoice as a flat CSV table for a spreadsheet or a database import. Document columns: invoice id, type, issue and due date, currency, seller and buyer name / VAT id / country, buyer and order reference, net / tax / gross / due totals, IBAN, BIC, remittance info, detected format and profile; with level=lines each row adds line id, item name, seller item id, quantity, unit, unit price, net amount, VAT category and rate, note. Use invoice_to_datev for DATEV bookkeeping and read_invoice for the full JSON. 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). A FatturaPA lot yields rows for every invoice in it. Returns the CSV as one text string: comma-separated, header row first, LF line endings, decimal point; 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
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.
levelNo'lines' (default) = one row per line item with the document columns repeated on every row; 'documents' = one row per invoice with the document columns only.lines
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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.1.1
    • 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 / level / description
      Added value: +"'lines' (default) = one row per line item with the document columns repeated on every row; 'documents' = one row per invoice with the document columns only."
    • addedInput schema / properties / level / enum
      Added value: +[
      +  "lines",
      +  "documents"
      +]
    • 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"
      +}
    • 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?

The description is highly transparent: it states that nothing is stored, calls cost one credit, anonymous quota is 20 per day per IP, unreadable files return an error, and scanned PDFs without embedded XML are rejected. This aligns with the readOnly, idempotent, and non-destructive annotations and adds operational detail beyond the annotations.

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 each sentence adds relevant information: purpose, output schema, input formats, level behavior, error handling, quota, and storage. No filler or redundancy is present, and the most important usage distinctions are front-loaded.

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 all necessary invocation details: input sources, format constraints, parameter effects, output representation, error conditions, quota, and persistence guarantees. Taken with the schema, it gives an agent everything needed to call the tool correctly in varied deployments.

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?

Although the schema already covers parameters well, the description enriches them by detailing accepted input formats, max size, path behavior on stdio vs. hosted server, and the exact meaning of the 'lines' and 'documents' levels. It also explains what the output CSV columns will contain, tying parameter choices to output structure.

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 exports a European e-invoice as a CSV table, with explicit document and line columns. It also distinguishes itself from invoice_to_datev and read_invoice, making its purpose unambiguous even among siblings.

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 gives concrete guidance on when to use the tool, including accepted XML formats, hybrid PDF handling, the level parameter, and explicit alternatives for DATEV and full JSON output. It also covers error behavior, quotas, and the path vs. base64 modes, so an agent knows exactly how to invoke it.

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