Skip to main content
Glama

Invoices: Update lines

invoice_update_lines
Destructive

Replace ALL lines of an invoice that is not sent or paid yet (status Draft or Open): a wrong amount, quantity, price, item or VAT rate, keeping the invoice's number. Either 'lines' — the complete new list, every line the invoice should have, numbers exactly as the person said — or one 'amount': on a one-line invoice without 'description' that line keeps its name and VAT rate and only its price changes. vat_percent per line or for all; a line without one carries no VAT, as on invoice_create. A VAT rate on an invoice issued without VAT switches it to VAT (prices_include_vat, default true). A sent, paid or cancelled invoice is refused. The confirmation shows the total before and after; the answer gives the total the ERP computed. Runs propose→confirm. CONFIRMATION: this tool is PROPOSED, never performed directly. You get status='confirmation_required' with an action_id and a plan_token, and the write happens only after confirm_action.

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": {
      "invoice": "<invoice>"
    },
    "name": "invoice_update_lines"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesNoThe complete new list of lines. Prices exactly as said.
amountNoOne new total for a one-line invoice, instead of 'lines'.
invoiceYesThe invoice's number as the person said it (INV-12, 12) or its id.
descriptionNoThe new line's name with 'amount', only if the person renamed it.
vat_percentNo
prices_include_vatNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations: it explains that all lines are replaced wholesale, that VAT behavior follows invoice_create and that adding a VAT rate to a non-VAT invoice switches it to VAT (prices_include_vat default true), and that the response reports totals before/after. It also fully discloses the propose→confirm protocol with status='confirmation_required', action_id, plan_token, and confirm_action.

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-loads the primary action and constraint, and nearly every clause carries decision-relevant information. It is a dense single block, however, and the mode-selection, VAT, and confirmation rules would be easier to scan if separated into distinct sentences or lines.

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 destructive mutation tool with no output schema, the definition covers replacement semantics, refusal cases, VAT edge cases, the returned totals, and the confirmation handshake. An agent has everything needed to call it correctly and interpret status='confirmation_required'.

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

Parameters5/5

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

With 67% schema coverage, the description compensates substantially: it clarifies that 'lines' must be the complete list with numbers exactly as the person said, that 'amount' only applies to a one-line invoice lacking 'description', that vat_percent may be set per line or globally, that an omitted vat_percent means no VAT, and the prices_include_vat default.

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 ('Replace ALL lines of an invoice') plus an explicit guard on which invoices qualify (status Draft or Open), and notes the invoice number is preserved. An agent can distinguish this from invoice_update (header changes) or invoice_create 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 clear when-to-use guidance including two mutually exclusive modes ('lines' full list vs a single 'amount' limited to a one-line invoice without 'description') and when-not conditions ('a sent, paid or cancelled invoice is refused'). It does not explicitly route the agent to invoice_update for non-line fields, leaving that inference to the agent, so it falls short of a 5.

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