Skip to main content
Glama

Update document item

update_document_item

Update a line item on a document (invoice, quote, bill, etc.). To change several lines on one document, prefer update_document_items_bulk — one call instead of many. To create the document or change its header/dates/totals, use save_document.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idNoLine item id. Required on update_document_item; omit on add_document_line.
costNoUnit cost (for margin / cost-of-sales), in :costcurrency.
nameNoLine item name / title.
sortNoDisplay order of the line within the document (ascending).
unitNoUnit label for the quantity (e.g. "hours", "kg").
priceNoUnit price (per-unit selling price) in the document currency.
amountNoLine total (unit price × quantity), usually derived from :price × :quantity. Accepts a number or a numeric string.
productNoId of a catalog product to link this line to.
variantNoId of a catalog product variant to link this line to.
quantityNoNumber of units. Accepts a number or a numeric string.
accountidNoPer-line chart-of-accounts / expense-category id; bills split cost by category at accrual (see list_accounts).
quinvoiceNoId of the parent document (invoice, quote, bill, etc.) this line belongs to.
responseidNoInternal: correlation id used to return the updated entity to the frontend; omit.
descriptionNoLine item description.
costcurrencyNoISO 4217 currency of :cost, when it differs from the document currency.
baseupdatedatNoOptimistic-concurrency token: the line's last-known updatedat (epoch number or ISO string). A stale value is rejected; omit to skip the check.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed16 schema fields changed
    • addedInput schema / properties / accountid / description
      Added value: +"Per-line chart-of-accounts / expense-category id; bills split cost by category at accrual (see list_accounts)."
    • addedInput schema / properties / amount / description
      Added value: +"Line total (unit price × quantity), usually derived from :price × :quantity. Accepts a number or a numeric string."
    • addedInput schema / properties / baseupdatedat / description
      Added value: +"Optimistic-concurrency token: the line's last-known updatedat (epoch number or ISO string). A stale value is rejected; omit to skip the check."
    • addedInput schema / properties / cost / description
      Added value: +"Unit cost (for margin / cost-of-sales), in :costcurrency."
    • addedInput schema / properties / costcurrency / description
      Added value: +"ISO 4217 currency of :cost, when it differs from the document currency."
    • addedInput schema / properties / description / description
      Added value: +"Line item description."
    • addedInput schema / properties / id / description
      Added value: +"Line item id. Required on update_document_item; omit on add_document_line."
    • addedInput schema / properties / name / description
      Added value: +"Line item name / title."
    • addedInput schema / properties / price / description
      Added value: +"Unit price (per-unit selling price) in the document currency."
    • addedInput schema / properties / product / description
      Added value: +"Id of a catalog product to link this line to."
    • addedInput schema / properties / quantity / description
      Added value: +"Number of units. Accepts a number or a numeric string."
    • addedInput schema / properties / quinvoice / description
      Added value: +"Id of the parent document (invoice, quote, bill, etc.) this line belongs to."
    • addedInput schema / properties / responseid / description
      Added value: +"Internal: correlation id used to return the updated entity to the frontend; omit."
    • addedInput schema / properties / sort / description
      Added value: +"Display order of the line within the document (ascending)."
    • addedInput schema / properties / unit / description
      Added value: +"Unit label for the quantity (e.g. \"hours\", \"kg\")."
    • addedInput schema / properties / variant / description
      Added value: +"Id of a catalog product variant to link this line to."
  2. First observed

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already indicate this is a mutating but non-destructive operation (readOnlyHint=false, destructiveHint=false), so the bar for additional disclosure is lower. The description adds scope context about what kind of entity is updated, but it does not disclose partial-update semantics, recalculation side effects, or behavior when required fields like id are omitted. This is adequate but not rich.

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 three sentences with no filler: the first states the core operation, the second gives a bulk alternative, and the third points to save_document for related-but-different scenarios. It is front-loaded and every sentence earns its place.

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 tool with 16 parameters and no output schema, the description does well to scope the operation and route to the correct siblings. The rich input schema fills in most remaining operational detail, while the description covers the key decision of when this tool versus bulk or save_document is appropriate. Minor gap: it does not state what the response is, but no output schema exists and the schema/description are otherwise strong.

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?

The input schema has 100% description coverage and provides detailed parameter documentation, including special notes like id being required on this tool and amount being derived from price × quantity. The description itself adds no parameter-level meaning, so the schema carries the load; the score is at baseline.

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 clearly states the action ('Update a line item on a document') and identifies the resource type ('invoice, quote, bill, etc.'). It explicitly distinguishes itself from sibling tools by naming update_document_items_bulk and save_document, so an agent can tell what this tool does and does not do.

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?

The description gives explicit usage guidance: use this tool for a single line item update, prefer update_document_items_bulk for multiple lines, and use save_document for creating a document or changing header/dates/totals. This clearly routes the agent to the correct alternative based on the task shape.

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