Skip to main content
Glama

Check an e-invoice

validate_invoice
Read-only

Check an e-invoice against EN 16931 and German rules.

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. explain=true adds an explanation to findings whose rule has one, in lang ("de" or "en").

valid is the result. For XRechnung the KoSIT validator decides. If it is unreachable, Invowerk's own check with the same rules decides, verdict_source is "local" and official_degraded is true. disagreement is true when both ran and differ. findings lists each problem with rule_id, severity and message; pass the codes to explain_errors (free). pdfa_verdict is the PDF/A check of a PDF. hints never change valid. Unreadable input returns a finding, not an error. It fails with an error when the check is busy (engine_busy), ran longer than 20 s (engine_timeout) or the XML has more than 100,000 elements (document_too_complex).

Credits: 1 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": "validate_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.
langNoLanguage of the explanations: "de" (default) or "en".de
explainNotrue adds an explanation to each finding whose rule has one.
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. Changed1 schema field changed
    • addedInput schema / properties / lang / enum
      Added value: +[
      +  "de",
      +  "en"
      +]
  3. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnlyHint/openWorldHint annotations: it discloses the validator resolution order (KoSIT first, local fallback with `verdict_source` and `official_degraded`), the `disagreement` flag, that unreadable input yields a finding rather than an error, the three explicit error conditions (engine_busy, 20 s engine_timeout, 100,000-element document_too_complex), and the 1-credit cost.

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 is front-loaded in sentence one, then input contract, then output semantics, then failure modes and cost — a logical progression. It is dense but nearly every clause carries non-schema information; the findings/explain_errors ordering is slightly interleaved with output fields but not confusing.

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 zero-required-parameter validation tool with a nested `file` object and an output schema, the definition covers size limits, formats, verdict provenance, degraded mode, non-fatal vs. fatal outcomes, and pricing — everything an agent needs to decide to call it and interpret the result, even though the output schema alone would document the return shape.

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 baseline context is already high, yet the description still adds meaning: the accepted payload formats (UBL, CII, ZUGFeRD/Factur-X PDF) for `invoice_base64`, that `file` is an alternative rather than an addition, and that `explain` applies only to findings whose rule has an explanation, with `lang` governing those. It doesn't clarify what happens if both inputs are supplied.

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 plus scope: 'Check an e-invoice against EN 16931 and German rules.' The standards named (EN 16931, XRechnung/KoSIT, ZUGFeRD) let an agent distinguish this from siblings like create_e_invoice or parse_invoice, and the description explicitly routes rule-code lookups to explain_errors.

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?

Establishes clear usage context: two mutually substitutable input modes (base64 vs. `file` download link), accepted formats, and the follow-up path to `explain_errors` for code explanations. It does not state explicit exclusions (e.g. when to prefer parse_invoice instead), so it stops short of full when-not guidance.

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.