Skip to main content
Glama

invowerk

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.4/5.0
Behavior5/5

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

With readOnlyHint/openWorldHint already declaring the safety profile, the description still adds substantial operational context: 4 MB decoded cap, 500-page and 16-attachment PDF limits, accepted syntaxes (UBL, CII, ZUGFeRD/Factur-X), the exact failure modes (no embedded XML, UBL credit note, malformed XML, engine_busy, engine_timeout) and a cost of 2 credits per call. None of that is derivable from 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?

Front-loaded with the purpose, then broken into Input / Returns / Credits sections. The sentences are dense with limits and error codes but each one carries actionable information, so there is little waste despite the length.

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?

For a two-parameter, nested-object tool with an output schema, the description covers the inputs accepted, the decoded size and page/attachment caps, the returned keys, the error-code convention, and the credit cost. An agent has everything needed to decide to call it and to interpret both success and failure.

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 adds real constraint meaning on top: 'at most 4 MB decoded' and the 500-page/16-attachment limits for the PDF path, plus the explicit either/or between invoice_base64 and file. It stops short of explaining the base64 encoding/format expectations beyond what the schema states.

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?

States a specific verb and resource ('Read an existing e-invoice into JSON') and pins the output shape ('keyed on EN 16931 Business Terms'), which is far more precise than siblings like convert_invoice or render_invoice. It names generate_invoice as a downstream consumer rather than as an alternative, so the boundary against read/convert siblings is only implied, not explicit.

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 gives the round-trip workflow: the returned JSON is generate_invoice's input, so 'you can edit it and create the invoice again.' That is clear usage context, but there is no statement of when NOT to use it (e.g. for a PDF without embedded XML, or when the file is not an e-invoice), which would be the deciding exclusion.

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.