Skip to main content
Glama

Read an e-invoice into JSON

parse_invoice
Read-only

Read an existing e-invoice into JSON keyed on EN 16931 Business Terms.

The JSON is the input format of generate_invoice, so you can edit it and create the invoice again.

Input: invoice_base64 is the base64 of an XML invoice (UBL or CII) or a ZUGFeRD / Factur-X PDF, at most 4 MB decoded; or pass the file as a download link in file. A PDF may have at most 500 pages and 16 attachments.

Returns model (the invoice as JSON), detection (syntax, flavor, customization_id) and source ("xml" or "pdf-embedded"). A file that cannot be read fails with an error that starts with an error code, e.g. a PDF without embedded XML, a UBL credit note, malformed XML, or a busy (engine_busy) or overrunning (engine_timeout) read.

Credits: 2 per call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileNoThe file as a download link, instead of `invoice_base64`. In ChatGPT, pass the user's uploaded file here. Other clients can set `download_url` to a public https URL.
invoice_base64NoThe invoice file, base64-encoded. At most 4 MB decoded.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only cover read-only/open-world; the description adds real behavioral context beyond them: input size limits (4 MB decoded, 500 pages, 16 attachments), accepted syntaxes (UBL, CII, ZUGFeRD/Factur-X PDF), the specific failure modes (missing embedded XML, UBL credit note, malformed XML, engine_busy, engine_timeout) and a cost signal (2 credits per call).

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 purpose, then input, output and error/cost details in compact sections. Dense but nearly every clause carries new information; only the return-field enumeration overlaps slightly with the existing output schema.

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 a two-parameter nested schema, an output schema and read-only annotations, the description covers the remaining gaps an agent needs: input constraints, accepted formats, failure codes and credit cost. Nothing material is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description goes further by explaining what invoice_base64 must actually contain (base64 of a UBL/CII XML or ZUGFeRD/Factur-X PDF) and by framing `file` as the alternative download-link path.

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?

States a specific verb (Read) and resource (e-invoice) and names the exact output semantics ('JSON keyed on EN 16931 Business Terms'), which cleanly separates it from siblings like generate_invoice, render_invoice and validate_invoice.

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?

Explicitly ties the tool to the workflow by noting the JSON output is the input format of generate_invoice, so an agent knows this is the read-back step before editing/regenerating. It stops short of stating when *not* to use it or contrasting it with convert_invoice.

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.