Skip to main content
Glama
formfeed

formfeed

Official

Validate an e-invoice

validate_einvoice
Read-only

Validate CII or UBL e-invoices against the rule set named by their specification identifier, returning pass, fail, or not-checked results with per-rule findings.

Instructions

Says which rules an e-invoice passed, by which validator and release: the file is held to the rule set its specification identifier (BT-24) names, Factur-X and ZUGFeRD by Mustang, XRechnung (CII and UBL) by the KoSIT validator, and each check (syntax, schema, every named rule set) comes back with its own result and findings. Pass exactly one source: render_id, an e-invoice this workspace rendered, which is answered from the report the render keeps and costs nothing; path, an XML file on this machine; or xml_base64, the XML itself. An XML takes one of the organisation's validations of the day (from the Starter plan; Free validates no uploads). Up to 4 MB of CII or UBL; a PDF is not taken. result is passed, failed or not_checked: not_checked means no rule set here is for the file (reason and explanation say why, such as an identifier it does not know), not that the file is wrong. The report says which rules a file passed; it does not say whether the document is a proper invoice for VAT purposes. To check an _invoice block before rendering it, use check_invoice.

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_einvoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoAbsolute path of an e-invoice XML on this machine; counts one of the day’s validations
rulesNoauto (default) takes the rule set the file's identifier names; a rule set named here judges only a file whose identifier it is for. en16931 holds a render's EN 16931 invoice to CEN's own rules, which counts like an upload
render_idNornd_ id of a render of this workspace that made an e-invoice; free
xml_base64NoThe e-invoice XML (CII or UBL), base64 encoded, up to 4 MB; counts one of the day’s validations

Output Schema

NameRequiredDescriptionDefault
rulesYesThe rule set and its release, as the validator names it
checksYes
reasonYesWhy it was not checked, such as unknown_customization_id
resultYespassed, failed or not_checked; new values may be added
allowanceYesWhat the day's validations have used after this call; null where nothing was counted
validatorYesThe validator and its version, e.g. KoSIT validator 1.6.3
xml_sha256YesSHA-256 of the XML that was judged
explanationYes
customization_idYesThe specification identifier (BT-24) the file names

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.24

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, non-destructive, closed-world), and the description adds substantial context beyond them: the 4 MB cap, the PDF rejection, the daily validation quota and which inputs consume it versus render_id being free. It also disambiguates the not_checked outcome so an agent does not misread it as a failure, and disclaims that the report is not a VAT determination.

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 what the tool does and which validator handles which rule set before moving to inputs and caveats. It is dense but every sentence conveys operational information; minor overlap between the description's input constraints and the schema's own parameter text keeps it from a 5.

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?

Even though an output schema exists, the description still explains the meaning of the three result values and what 'reason' and 'explanation' convey, which is the part an agent most needs to interpret results. Quota behavior, size limits, supported formats, and the pre-render alternative are all present.

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?

With 100% schema description coverage the baseline is 3, but the description adds meaning the schema does not carry: render_id is answered from the retained render report and costs nothing, and uploads consume one of the organisation's daily validations. The rules/en16931 nuance is mostly left to the schema, which already documents the enum well.

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 and resource ('Says which rules an e-invoice passed') and immediately names the validators and rule sets involved (Mustang for Factur-X/ZUGFeRD, KoSIT for XRechnung CII/UBL). It also distinguishes itself from the sibling check_invoice at the end, so an agent can pick the right tool without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly says 'Pass exactly one source' and enumerates the three mutually exclusive inputs with their conditions. It adds an exclusion ('a PDF is not taken'), a plan constraint (Starter and above; Free validates no uploads), and a direct routing statement: 'To check an _invoice block before rendering it, use check_invoice.'

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.