Skip to main content
Glama

updateInvoiceItem

Destructive

Change the title, quantity, or unit price of a custom invoice item; omitted fields keep their current values. Returns the item read after the update. product.title is the title, quantity a whole number, and unitAmount the price of one unit in major units. The item's total and tax are recalculated with its existing tax rate. Only an item whose product.type is custom can be changed, and only while it is pending or on a draft invoice: an item on an issued invoice is corrected with createCreditNote. Get invoiceItemId from getInvoiceItems. Never invent UUIDs; only use values from prior tool responses.

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": {
      "invoiceItemId": "<invoiceItemId>",
      "invoiceItem": "<invoiceItem>"
    },
    "name": "updateInvoiceItem"
  }
}

Input Schema

NameRequiredDescriptionDefault
invoiceItemYesInvoice line item to update.
invoiceItemIdYesThe id of the invoice item.

Output Schema

NameRequiredDescriptionDefault
invoiceItemYes

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 readOnlyHint=false; the description goes further by disclosing the side effect that total and tax are recalculated using the existing tax rate, and that the item is returned as read after the update. It also adds an anti-hallucination constraint on UUID sourcing, which is real behavioral guidance beyond the annotations.

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?

Four front-loaded sentences, mutation rules and preconditions first, with no filler. Minor redundancy where 'Get invoiceItemId from getInvoiceItems' and 'Never invent UUIDs; only use values from prior tool responses' overlap, but both are actionable so the cost is small.

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 mutating, nested-object tool with an existing output schema, the description covers what changes, what is preserved, what is recomputed, eligibility constraints, and id sourcing. An agent has everything needed to invoke it correctly without guessing.

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 100%, so baseline is 3, but the description adds mapping semantics: product.title corresponds to the title, quantity is a whole number, and unitAmount is the price of one unit in major units. This clarifies the nested product object beyond the flat schema, though it restates some schema text (integer, major units) rather than adding new detail on limits.

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 ('Change the title, quantity, or unit price of a custom invoice item') and immediately clarifies partial-update semantics ('omitted fields keep their current values'). It also distinguishes itself from createInvoiceItem/deleteInvoiceItem by scope and names createCreditNote as the route for issued invoices, so an agent can tell it apart from siblings.

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 explicit preconditions: only items whose product.type is custom, and only while pending or on a draft invoice. It names the alternative for the excluded case ('an item on an issued invoice is corrected with createCreditNote') and explains how to obtain the required id via getInvoiceItems.

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