Skip to main content
Glama

Finalize invoice (irreversible)

finalize_invoice
Destructive

Finalize a DRAFT invoice: assigns the sequential invoice number, computes the hash and adds it to the Verifactu chain (and, if the account has AEAT mode enabled, submits the record to the tax authority). THIS IS IRREVERSIBLE, se envía a la cadena Verifactu: a finalized invoice can never be edited or deleted; mistakes require a rectificative invoice. Ask the user for explicit confirmation first, then call with confirm=true. Returns the assigned invoice number and the Veri*factu hash, plus the AEAT submission status if the account has AEAT mode enabled. Still something to fix in the draft first, use update_invoice before finalizing.

Input Schema

NameRequiredDescriptionDefault
confirmYesMust be true. Only set after the user explicitly confirmed the irreversible finalization.
invoice_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true, and the description goes well beyond that by explaining the consequence in human terms: the invoice can never be edited or deleted, and corrections require a rectificative document. It also discloses the conditional AEAT submission (account-mode dependent) and what the tool returns, which annotations cannot express.

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?

The critical warning is front-loaded and every clause carries information, but the sentence is overstuffed and contains a stray untranslated fragment ('se envía a la cadena Veri*factu') spliced mid-thought, and it partially repeats the title's 'irreversible' warning.

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 two-parameter, high-stakes mutation with no output schema, the description covers everything an agent needs: preconditions, irreversibility, confirmation protocol, return values (invoice number, Veri*factu hash, AEAT status), and the remediation path.

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 only 50%, with invoice_id carrying no schema description, but the description compensates by framing the target as a DRAFT invoice, making the id's meaning inferable. For confirm it reinforces the schema constraint ('only after explicit user confirmation'), though it does not restate that confirm must be true beyond 'call with confirm=true'.

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+resource (finalize a DRAFT invoice) and then spells out the concrete effects: assigns the sequential number, computes the hash, appends to the Veri*factu chain, and optionally submits to AEAT. It also names its siblings explicitly ('use update_invoice before finalizing', mistakes require a rectificative invoice), so an agent can place it precisely among update_invoice, rectify_invoice and cancel_invoice.

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?

Gives both a when-to-use and a when-NOT-to-use: if the draft still needs changes, call update_invoice first; if a mistake was already made, use a rectificative invoice. It additionally prescribes the interaction protocol ('ask the user for explicit confirmation first, then call with confirm=true'), removing ambiguity about sequencing.

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