Skip to main content
Glama

Update draft invoice

update_invoice
Destructive

Edit an existing DRAFT invoice (borrador): items, prices, customer, dates, tax/retention rates or notes. Only DRAFT invoices can be edited, a finalized invoice is immutable, use rectify_invoice instead. Only the fields you pass are changed, EXCEPT items: passing items REPLACES the full line-item list (pass all lines you want to keep, not just the changed one). Returns the updated draft's id and new total.

Input Schema

NameRequiredDescriptionDefault
itemsNoReplaces ALL line items when provided.
notesNo
due_dateNoYYYY-MM-DD
tax_rateNo
invoice_idYes
issue_dateNoYYYY-MM-DD
referenciaNoShort human reference shown on the PDF and searchable in the invoice list. Pass an empty string to clear it.
customer_idNo
numero_pedidoNoPurchase order / commitment number of a public customer (Facturae ReceiverTransactionReference). Can still be set on a FINALIZED invoice as long as it was not submitted to FACe. Empty string clears it.
product_groupNoProduct group from get_product_groups. Pass an empty string to clear it.
retention_rateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Beyond the annotations, it discloses that finalized invoices are immutable, that only passed fields change except for items, and that items completely replace the line-item list. It also states what the tool returns, giving the agent mutation and response context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the draft-only constraint and alternative tool, then covers mutation semantics and return values. Every sentence carries actionable information with no wasted wording.

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 an 11-parameter mutation tool with no output schema, it provides the essential constraints: draft-only editing, the rectify_invoice alternative, full replacement semantics for items, and what is returned. That is enough for an agent to call it correctly.

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?

The description adds crucial semantics for the items parameter, especially that it replaces the full line-item list rather than patching individual lines. Schema coverage is moderate at 55%, and the description covers major editable field categories but does not explain every parameter such as referencia, numero_pedido, or product_group.

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?

The description states a specific verb and resource: editing an existing DRAFT invoice, enumerating editable fields and scope. It clearly distinguishes this tool from rectify_invoice by naming that sibling and the condition that selects it.

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?

It explicitly says when to use this tool (DRAFT invoices only) and when not to (finalized invoices, where rectify_invoice should be used instead). The alternative route is named rather than left to inference.

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