Skip to main content
Glama

invoice_item_update

Edits a line item's description, quantity, unit, price or discount, or re-parents it to another invoice. expected_updated_at is required: the line's updated_at from your read; without it nothing is written and the refusal names the current value; a line changed since then answers CONFLICT. Bounds: unit_price_cents is integer CENTS, 0 or more; quantity 0.001 to 1,000,000 (3 decimals); discount_bps 0 to 10000; quantity × unit_price_cents at most 10,000,000,000. unit "" clears the unit. Refuses when the current or target invoice is paid or cancelled. tax_code is the line's code under the document's tax_scheme, refused on a document without a scheme. NEXT: invoice_read to see the updated total.

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": {
      "id": "<id>",
      "expected_updated_at": "<expected_updated_at>"
    },
    "name": "invoice_item_update"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesThe invoice_item id (invoice_item_list shows them).
unitNo
positionNo
quantityNoHow many, up to 3 decimals (1.5 hours → 1.5). A new line defaults to 1.
tax_codeNo
invoice_idNo
descriptionNo
discount_bpsNoOptional line discount in basis points: 10% → 1000, none → 0. A discount is never a lower or negative price.
unit_price_centsNo
expected_updated_atYesRequired: the line's updated_at from your last read (invoice_item_read, invoice_item_list or the create answer). Left out, the call is refused and names the current value; a line changed since then returns CONFLICT with the current value and stays as it is.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only declare the mutation/safety profile; the description adds substantial behavior beyond them — optimistic concurrency semantics, the exact CONFLICT outcome (line stays as-is, current value returned), the empty-string-clears-unit convention, and refusal on paid or cancelled invoices. These are precisely the details an agent needs before committing a write.

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-loaded with the action, then the concurrency requirement, then bounds, then refusals, then the next step — a logical reading order with no filler. It is dense and near the upper limit of comfortable length, but every clause carries an operational fact.

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 mutation with no output schema and thin schema descriptions, the definition covers the risky parts (concurrency, value bounds, refusal states, tax scheme dependency) and points to invoice_read for the result. It leaves 'position' and the invoice_id re-parenting mechanics somewhat implicit, and does not say what a successful call returns.

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 40%, and the description compensates well: it clarifies unit_price_cents is integer cents, spells out quantity and discount_bps ranges, defines discount as basis points (10% → 1000) and explicitly not a negative price, explains unit="" clearing, and defines tax_code relative to the document's tax_scheme. It also adds a cross-field constraint (quantity × unit_price_cents ≤ 10,000,000,000) absent from the schema. Minor gap: 'position' is unexplained in both places.

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 ("Edits a line item's...") and enumerates exactly which fields are mutable, including the non-obvious re-parenting capability. An agent can immediately distinguish this from invoice_item_create, invoice_item_delete, or invoice_update without opening a 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 clear operating context: expected_updated_at is mandatory, omission means nothing is written, stale data answers CONFLICT, and paid/cancelled invoices refuse. It also routes forward with "NEXT: invoice_read to see the updated total." It stops short of explicitly naming alternatives (invoice_item_create for new lines, invoice_update for header-level edits), which is the only gap.

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