Skip to main content
Glama

e-Factura Validator (Romania)

fix_invoice

Read-only

Use when a validation report lists 'autofix' rules, or ANAF or a Peppol access point rejected an invoice for codes, dates or totals, and you want the corrected XML instead of editing it yourself: fixes county/sector/country/currency/unit codes, date formats, VAT-id prefixes, Belgian enterprise numbers (0208), Peppol CustomizationID/ProfileID, empty elements, decimals, totals and VAT recomputed from the lines. Lists every change (field, old, new) and re-validates the result. Paid: $0.05 USDC via x402, charged only if something was fixed. Review the changes before sending the invoice.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "xml": "<xml>"
    },
    "name": "fix_invoice"
  }
}

Input Schema

NameRequiredDescriptionDefault
xmlYesThe UBL 2.1 Invoice or CreditNote XML document, as text
profileNoRule set; 'auto' reads it from the invoice's CustomizationIDauto

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / xml / examples
      Added value: +[
      +  "<Invoice xmlns=\"urn:oasis:names:specification:ubl:schema:xsd:Invoice-2\" …>…</Invoice>"
      +]
  2. Added

TDQS

A4.4/5.0
Behavior5/5

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

Annotations only declare readOnly/openWorld/idempotent/destructive flags; the description adds context they cannot carry: a $0.05 USDC x402 charge, the fact it is billed only when a fix occurs, that every change is listed as field/old/new, and that the result is re-validated. It also advises reviewing the changes before sending, which tells the agent the tool is not a silent pass-through.

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 'Use when...' followed by the trigger, then the fix list, then output and payment facts. The long enumeration of fixable fields is dense but each item is informative; a lighter summary list would read faster without losing meaning.

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?

There is no output schema, yet the description covers what comes back (per-field change list plus re-validation), what it costs and when the charge applies, and the review-before-sending caveat. For a two-parameter XML transformation tool that is everything an agent needs before calling it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with both parameters documented, including the profile enum values and the 'auto' behavior, so the schema does the heavy lifting. The description adds nothing about the xml or profile parameters specifically, so the baseline 3 applies.

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 ('fixes...codes, date formats, VAT-id prefixes...totals and VAT recomputed') and enumerates the exact defect classes it repairs. An agent can immediately tell this apart from validate_invoice or generate_invoice because it returns corrected XML rather than a report or a new document.

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?

Gives a clear triggering condition: a validation report listing 'autofix' rules, or a rejection by ANAF or a Peppol access point, plus the intent 'you want the corrected XML instead of editing it yourself'. It never names the sibling validate_invoice/validate_invoice_free as the prerequisite step nor states when not to use it, so it stops short of full routing 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.

Resources