Skip to main content
Glama

finisma – ZUGFeRD e-invoices

Rechnungsdaten aus PDF auslesen

extract_invoice

Extrahiert EN-16931-Rechnungsdaten aus einer hochgeladenen PDF (Formularfelder) plus Validierungs-Issues, als Korrekturschritt vor create_zugferd: Felder und Issues dem Nutzer zeigen, korrigieren lassen, danach create_zugferd mit dem korrigierten invoice und derselben upload_id aufrufen. Unsichere Felder stehen als Platzhalter 'KORRIGIEREN' (Text) bzw. '1900-01-01' (Datum) drin und werden als Issue mit Code EXTRACTION_UNCERTAIN gemeldet — diese Felder müssen vor create_zugferd korrigiert werden. Enthält die PDF bereits eine eingebettete E-Rechnung (ZUGFeRD/Factur-X), kommen die Felder deterministisch aus der XML (source='xml') statt aus einer Sprachmodell-Lesung des Druckbilds. Erfordert ein Konto mit aktivem Abo oder Guthaben.

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": {
      "confirmed": "<confirmed>"
    },
    "name": "extract_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
confirmedYesMuss true sein, und zwar erst, nachdem der Nutzer genau diesen Aufruf im Gespräch bestätigt hat: sagen, was erzeugt wird und was es kostet (Tageskontingent, Credit oder Abo), sein Ja abwarten, dann mit confirmed: true aufrufen. Ein Aufruf ohne confirmed: true wird abgelehnt und ändert nichts.
upload_idNoReferenz auf eine zuvor über request_upload_link hochgeladene Datei, anstelle von pdf_base64. Genau eines von beiden angeben. Wird im Ergebnis erneut zurückgegeben und kann anschließend bei create_zugferd als 'upload_id' verwendet werden, damit dieselbe Quell-PDF eingebettet wird.
pdf_base64NoDie zu extrahierende PDF-Rechnung, Base64-kodiert (max. 25 MB). Alternativ 'upload_id' angeben. Chat-Clients, die eine angehängte Datei nicht zuverlässig als Base64 übergeben können, rufen zuerst request_upload_link auf.

Output Schema

NameRequiredDescriptionDefault
sourceYesHerkunft der Felder: 'xml' = deterministisch aus der in der PDF eingebetteten E-Rechnung übernommen, 'llm' = per Sprachmodell aus dem Druckbild extrahiert.
invoiceYesExtrahierte EN-16931-Rechnungsdaten (Formularfelder). Vor create_zugferd prüfen und korrigieren, insbesondere Felder mit dem Wert 'KORRIGIEREN' bzw. '1900-01-01'.
upload_idYesBei create_zugferd als 'upload_id' übergeben, damit dieselbe Quell-PDF eingebettet wird.
expires_atYesISO-8601-Zeitpunkt, ab dem upload_id verfällt. Danach erneut request_upload_link und extract_invoice aufrufen.
validation_issuesYesOffene Probleme der extrahierten Daten. severity='error' blockiert create_zugferd (dort wird dieselbe Prüfung erneut ausgeführt), 'warning' nicht.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / confirmed
      Added value: +{
      +  "description": "Muss true sein, und zwar erst, nachdem der Nutzer genau diesen Aufruf im Gespräch bestätigt hat: sagen, was erzeugt wird und was es kostet (Tageskontingent, Credit oder Abo), sein Ja abwarten, dann mit confirmed: true aufrufen. Ein Aufruf ohne confirmed: true wird abgelehnt und ändert nichts.",
      +  "type": "boolean"
      +}
    • addedInput schema / required
      Added value: +[
      +  "confirmed"
      +]
  2. Changed2 schema fields changed
    • addedOutput schema / properties / invoice / properties / delivery / properties / gln
      Added value: +{
      +  "maxLength": 20,
      +  "type": "string"
      +}
    • addedOutput schema / properties / invoice / properties / seller / properties / customerAssignedId
      Added value: +{
      +  "maxLength": 100,
      +  "type": "string"
      +}
  3. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Adds substantial context beyond the annotations: credit/subscription requirement, sentinel placeholder values ('KORRIGIEREN', '1900-01-01'), the EXTRACTION_UNCERTAIN issue code, and a deterministic XML branch (source='xml') for PDFs that already embed ZUGFeRD/Factur-X. This explains why the non-read-only, non-idempotent annotations make sense (each call consumes quota). It does not contradict the annotations, though it does not spell out rate-limit or failure-mode behavior beyond the credit requirement.

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?

Front-loaded with the verb and resource, then the workflow, then the edge cases, which is the right order. It is a dense block rather than separated sentences and repeats the 'correct before create_zugferd' instruction twice, costing some tightness but not clarity.

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?

An output schema exists, so return values need not be explained; the description instead covers the non-obvious parts: credit gating, placeholder semantics, the XML-versus-language-model source distinction, and the handoff to create_zugferd. Nothing an agent needs to call this correctly appears to be missing.

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%, so the schema already documents confirmed, upload_id, and pdf_base64 in detail, including the mutual exclusivity and the 25 MB limit. The description reinforces the upload_id reuse across calls but adds no new syntax or format detail. Baseline 3 is appropriate when the schema carries the parameter semantics.

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?

Opens with a specific verb and resource tied to a standard: extracts EN-16931 invoice data from an uploaded PDF, plus validation issues. It immediately distinguishes itself from the sibling by framing the output as a correction step feeding into create_zugferd, so an agent knows exactly what this returns versus what the downstream tool does.

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 ordered workflow: extract, show fields and issues to the user, let them correct, then call create_zugferd with the corrected invoice and the same upload_id. It also states the precondition that placeholder fields must be fixed before create_zugferd, which is exactly the when/when-not guidance an agent needs.

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