Skip to main content
Glama

Finanz & SEO Tools API

Invoice OCR

eu_einvoice_from_scan
Read-only

Invoice OCR: turn a scanned or photographed invoice (JPEG, PNG, WebP, TIFF) or a non-structured PDF (text layer or embedded scan images, max 3 pages, 4 MB) into structured JSON with per-field confidence: invoice number, dates, seller/buyer name and address, VAT ID, tax number, HRB, IBAN (checksum-validated, bank/BIC from the Bundesbank directory), BIC, payment terms and due date, net/VAT/gross totals, VAT breakdown, § 19 / reverse-charge hints and line items. Cross-checks the arithmetic (line sum = net, basis × rate = VAT, net + VAT = gross) and flags inconsistencies. Nothing is guessed: unreadable fields are null with confidence 0. Optional xrechnung=cii|ubl builds an XRechnung 3.0 / EN 16931 XML via the official schematron and returns validation errors or the list of missing business terms instead of inventing data. German and English invoices. Send the file as raw body (Content-Type image/jpeg, image/png, image/webp, image/tiff or application/pdf) or JSON {base64} / {url}. No charge (HTTP 4xx/422) if no text can be read. Price: $0.04 USDC per call via x402.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "eu_einvoice_from_scan"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNopublic http(s) URL of the image or PDF
base64Nobase64 of a JPEG/PNG/WebP/TIFF image or PDF (alternatively POST the raw file with its Content-Type)
profileNoprofile for the generated XML (default xrechnung)
leitwegIdNobuyer reference / Leitweg-ID (BT-10) if not printed
xrechnungNoalso generate and validate an XRechnung/EN 16931 XML from the extracted data (query parameter when posting a raw file)
buyerEmailNobuyer electronic address (BT-49), usually not printed on the invoice

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Beyond readOnlyHint/openWorldHint, the description discloses the no-guess policy (unreadable fields are null with confidence 0), arithmetic cross-checks and inconsistency flags, IBAN checksum validation plus Bundesbank BIC lookup, XML validation returning errors or missing business terms, the billing rule (4xx/422 free, $0.04 USDC per call via x402), and language coverage. That is substantial behavioral context an agent cannot get from annotations alone.

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?

Purpose and input formats are front-loaded, followed by extraction behavior, no-guess policy, optional XML generation, and price in a logical order. The long inline field enumeration and the parenthetical size limits are dense, but nearly every clause adds usable information.

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?

With no output schema, the description carries the return-value burden itself and does so: the JSON field set, confidence semantics, arithmetic/validation flags, and the alternate XML-error return shape. Error and cost behavior are also stated, leaving nothing an agent needs before calling.

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 baseline is 3. The description adds some meaning — the raw-body POST alternative with its Content-Types and that xrechnung builds and validates an XRechnung 3.0 XML, with leitwegId/buyerEmail being fields usually not printed on the invoice — but most parameter meaning is already in the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: it turns a scanned/photographed invoice or unstructured PDF into structured JSON with per-field confidence, and enumerates the extracted fields (invoice number, VAT ID, IBAN, totals, line items). An agent knows exactly what the tool produces. It never names a sibling to distinguish itself from, so a 4 rather than a 5.

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?

Use context is set clearly: inputs must be images or non-structured PDFs, max 3 pages / 4 MB, German or English invoices, with an optional xrechnung flag for XML generation. It gives no explicit 'use eu_einvoice for structured e-invoices instead' exclusion, so the boundary against siblings is implied rather than stated.

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