Skip to main content
Glama

Update invoice draft

update_invoice_draft
DestructiveIdempotent

Changes the header fields (dates, language, VAT, references, notes, colour theme) of an invoice draft or an open proforma. Only the given fields change; the draft stays without a number and nothing is issued. Issued documents can't be changed. The bank account of the document is not changed by this tool; set_invoice_bank_account changes it.

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": {
      "company_id": "<company_id>",
      "invoice_id": "<invoice_id>"
    },
    "name": "update_invoice_draft"
  }
}

Input Schema

NameRequiredDescriptionDefault
vatNoThe default VAT rate of the document in percent, e.g. 22; new items get it. null: no rate.
dateNoThe date of the document, YYYY-MM-DD.
notesNoThe notes printed on the document; null clears them.
placeNoThe place of issue printed on the document (one line); null clears it.
themeNoThe colour theme of this document, a DOCUMENT_THEME value of get_reference_data (a new document takes the theme of the company). A theme other than SLATE needs the theme feature of the plan of the company owner.
due_dateNoThe due date, YYYY-MM-DD, not before the date; null clears it.
languageNoThe language of the printed document.
vat_noteNoThe VAT note printed on the document; null clears it.
company_idYesThe id of the company, from list_companies.
invoice_idYesThe id of the document, from list_invoices.
supply_dateNoThe date of supply of the goods or services, YYYY-MM-DD; null clears it.
valid_untilNoProformas only: the last day the proforma is valid, YYYY-MM-DD; null clears it.
vat_categoryNoThe default VAT category of the document.
exchange_rateNoA manual exchange rate of the currency of the document to the national currency of the company, as text with up to 6 decimals, e.g. "4.2512"; only for a document in a foreign currency where a rate is required; null clears it.
payment_termsNoThe payment terms printed on the document; null clears them.
split_paymentNoWhether the document is marked for the split payment mechanism (Poland).
buyer_referenceNoThe buyer reference required by the customer on e-invoices (one line); null clears it.
order_referenceNoThe order (purchase order) reference of the customer (one line); null clears it.
payment_referenceNoThe payment reference printed on the document (one line); null clears it.
vat_exemption_reasonNoThe VAT exemption reason for an exempt category; null clears it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior4/5

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

Beyond annotations, the description discloses partial-update semantics ('Only the given fields change'), that the draft remains unnumbered, that nothing is issued, and that issued documents are immutable. It also clarifies that bank account data is untouched, which matters given destructiveHint=true. It does not discuss validation failures or permission/plan requirements, but the schema covers the theme plan constraint.

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?

Four short sentences, front-loaded with the action and scope, then the partial-update behavior, then restrictions, then the bank-account exclusion. No filler and no repetition.

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 20-parameter mutation tool with no output schema, the description covers the essential scope, side effects, immutability constraint, and the one sibling alternative that could otherwise be confused with this operation. It omits return-value information, but that is minor for a draft-update tool.

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 description coverage is 100% and the schema already documents every parameter thoroughly, including null-clearing semantics, formats, enums, and constraints. The description adds only a grouped summary of header fields, which is useful orientation but no new parameter-level meaning.

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 (Changes) and resource (header fields of an invoice draft or an open proforma), enumerates the affected field groups, and implicitly scopes itself away from item-level edits by saying 'header fields'. This clearly distinguishes it from siblings like update_invoice_item and set_invoice_bank_account.

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?

It gives a clear usage boundary ('Issued documents can't be changed') and names the correct alternative for a related concern (set_invoice_bank_account for bank account changes). It does not explicitly mention update_invoice_item as the alternative for line items, but the 'header fields' framing establishes the scope.

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