Skip to main content
Glama

Rectify invoice (Veri*factu)

rectify_invoice
Destructive

Create a rectificativa (factura rectificativa / abono / corrección) for a finalized invoice. This is a Veri*factu chain operation. Ask the user for explicit confirmation first, then call with confirm=true. It creates a DRAFT rectificativa that you review and finalize afterwards. Use negative amounts for a full credit. Returns the new rectificativa draft's id (and number, if already assigned).

Input Schema

NameRequiredDescriptionDefault
itemsYes
notesNo
confirmYesMust be true. Only after the user explicitly confirmed.
tax_rateNo
invoice_idYes
base_rectificadaNoTaxable base of the ORIGINAL invoice. Required when rectification_mode is S.
cuota_rectificadaNoTax amount of the ORIGINAL invoice. Required when rectification_mode is S.
rectification_modeNoI = por diferencias (only the delta), S = por sustitución (replaces the original). With S you MUST also pass base_rectificada and cuota_rectificada.I
rectification_typeNoAEAT reason class, goes into the Veri*factu record as given. R1 = art. 80.1/80.2/80.6 LIVA (the usual error case), R2 = art. 80.3 (insolvency), R3 = art. 80.4 (bad debt), R4 = other, R5 = corrective for a simplified invoice. Ask the user which case applies; do not infer it.R1
rectification_reason_codeNoOnly needed when the customer is a Spanish public administration (Facturae/FACe). Facturae has its OWN reason list, different from Veri*factu's R1-R5: 01-16 for formal errors, 80-85 for Art. 80 LIVA cases. Ask the user which applies, do not infer it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations only tell the agent this is a destructive write; the description adds real context: a DRAFT is created rather than a finalized record, confirmation gating is mandatory, and the return value (new draft id, optional number) is disclosed. It stops short of stating whether the original invoice remains untouched or how the Veri*factu chain is affected, which is the main residual gap for a destructive tool.

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?

Five short sentences, front-loaded with the operation and followed by the mandatory confirmation gate and draft semantics; no filler. Slight redundancy with the schema on negative amounts costs it a point.

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?

For a 10-parameter destructive financial tool with no output schema, the description successfully covers the confirmation gating, draft lifecycle, credit convention, and return value. What it omits is downstream consequence — effect on the original invoice and the Veri*factu chain — which an agent would reasonably want before invoking.

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 60% and the schema already documents the hard parts (rectification_mode I/S with required base_rectificada/cuota_rectificada, R1-R5 meanings, Facturae reason codes, confirm=true). The description's only parameter guidance — negative amounts for full credit — restates the unit_price schema description, so it adds little beyond the structured fields.

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?

Specific verb (create) + resource (rectificativa/abono/corrección) + scope constraint (for a finalized invoice), with Spanish accounting terminology that maps the tool unambiguously against create_invoice/update_invoice. An agent can identify the operation without opening the schema.

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 concrete pre-call workflow (ask the user for explicit confirmation, then pass confirm=true) and a post-call expectation (draft to review and finalize), plus the rule for full credits via negative amounts. It does not explicitly name which sibling to use instead for non-finalized invoices, which keeps it at 4.

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