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 Invowerk's REST API (POST /v1/generate), so a program can edit it and write 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.

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": "parse_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoThe file as a download link, instead of `invoice_base64`: set `download_url` to a public https URL of the file.
invoice_base64NoThe invoice file, base64-encoded. At most 4 MB decoded.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / file / description
      Previous value: -"The 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."New value: +"The file as a download link, instead of `invoice_base64`: set `download_url` to a public https URL of the file."
    • changedInput schema / properties / file / properties / file_id / description
      Previous value: -"An identifier for the file. ChatGPT sets it; other clients may pass any label, such as the file name."New value: +"Any label for the file, such as the file name."
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, the description discloses concrete limits (4 MB decoded, 500 PDF pages, 16 attachments), the shape of the result (`model`, `detection`, `source`), and a useful failure taxonomy — PDF without embedded XML, UBL credit note, malformed XML, engine_busy, engine_timeout — each prefixed by an error code. It also states the cost (2 credits per call), which is operationally significant and not available in structured fields.

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 one-line purpose, then the editing/round-trip rationale, then Input, Returns and Credits blocks that map to how an agent reads a definition. Sentences are dense but each carries distinct information; there is no restating of the tool name or filler.

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 read tool with a nested file object and a declared output schema, the description covers format, size limits, return fields, and error modes. Even though the output schema exists and the return values need not be explained, the brief `model`/`detection`/`source` summary plus the error-code guidance makes failure handling possible without inspecting the schema.

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?

Schema coverage is already 100%, so the baseline would be 3, but the description adds real meaning: it clarifies that `file` and `invoice_base64` are mutually exclusive alternatives for supplying the same document, and it specifies the accepted formats (UBL or CII XML, ZUGFeRD/Factur-X PDF) that the schema does not enumerate. It also restates the 4 MB decoded limit, tying the constraint to the decoding step rather than raw payload size.

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 first sentence gives a specific verb and resource (read an e-invoice into JSON) and names the target convention (EN 16931 Business Terms), which is far more precise than the title alone. It also states the purpose of the output (input format for POST /v1/generate), so an agent understands what the JSON is for. It stops short of naming a sibling such as validate_invoice or render_invoice to draw a boundary, which keeps it at 4 rather than 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?

The description supplies a clear use context: convert an existing invoice file to editable JSON so a program can modify and re-submit it. It also implicitly scopes input to existing invoice files in UBL, CII, ZUGFeRD or Factur-X, ruling out arbitrary documents. There is no explicit exclusion or alternative named (e.g. when to prefer validate_invoice), so it falls short of a 5.

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.