Skip to main content
Glama

Auto-fix e-invoice

fix_invoice

Fix validation errors of an EN 16931 invoice (XRechnung, Peppol BIS, ZUGFeRD/Factur-X XML, UBL, CII) deterministically: empty elements, decimals, date and code formats, specification ids; with totals=true also recalculates totals and the VAT breakdown from the lines. Data that is not in the file (Leitweg-ID, seller contact, endpoint ids, payment terms) is taken from "values"; missing ones are listed in needs_input. Returns the change list, the remaining errors and the corrected XML. Counts as 2 requests.

Input Schema

NameRequiredDescriptionDefault
totalsNoAllow recalculating document totals and VAT breakdown from the line amounts
valuesNoValues for data that is missing in the file
contentNoInvoice XML (UBL, CII, XRechnung, Peppol BIS, ZUGFeRD/Factur-X XML, KSeF FA(3)) as text
dry_runNoOnly report what would change
content_base64NoA ZUGFeRD / Factur-X PDF (or any invoice file) as base64, when the invoice is not plain XML

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations the description carries the full load and does well: it discloses the deterministic fixing scope, the values-vs-needs_input fallback behavior for data absent from the file, the returned artifacts (change list, remaining errors, corrected XML), and a cost signal ('Counts as 2 requests'). It omits auth/permission requirements and failure behavior.

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?

Three dense but well-ordered sentences: scope and fixable error classes first, opt-in totals second, data-fallback and outputs last. The parenthetical format list is long but load-bearing for format selection; nothing is purely redundant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, and the description compensates by naming the three return payloads and needs_input. For a 5-param tool with a nested values object and no annotations, this is nearly sufficient; only error/failure semantics and any permission prerequisites are left unstated.

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 relational meaning the schema cannot: values is only consumed for data missing from the file, and anything still unresolved surfaces in needs_input. totals=true is also framed as the condition that triggers total/VAT recalculation.

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 (fix) plus resource (EN 16931 invoice) and enumerates exactly which error classes are corrected (empty elements, decimals, date/code formats, specification ids), while distinguishing itself from validate_invoice/parse_invoice by being the corrective step.

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?

Usage context is clear: it is the tool for repairing validation errors, with dry_run for previewing and totals=true as an opt-in escalation. It never explicitly names validate_invoice as the prerequisite for obtaining errors, so the routing is implied rather than spelled out.

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.