Skip to main content
Glama

Update sales order

update_sales_order
Destructive

Update a sales order. Pass lines to replace the entire line list. Lines that are not sent are deleted. If that call would delete existing lines, the first call does not write. It returns confirmation_required, confirm_token, and a summary with delete_count plus each line name and sku. Show that summary to the user and wait for an explicit yes, then call again with the same arguments plus confirm_token. A call that only changes or adds lines does not need confirm_token. A confirm boolean is ignored. The token is bound to this key, this organization, this order, and the id, sku, name, and quantity of each line that would be deleted. It expires in 5 minutes and works once. If that delete list changes, the token is rejected. If a line is added or changed after the token is accepted, nothing is written and the call returns a new confirmation_required. A line_id that is not on this order is rejected and nothing is changed. A line with quantity_shipped greater than 0 cannot be removed. New lines (no line_id) need item_id or a non-empty description. Each line uses quantity and unit_price. Include line_id to keep an existing line. Fields omitted on a kept line stay as stored. An empty string or null clears that field. Changing item_id on a kept line loads description, SKU, and barcode from the new item in this organization, or clears them when that item has none.

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": {
      "order_id": "<order_id>"
    },
    "name": "update_sales_order"
  }
}

Input Schema

NameRequiredDescriptionDefault
memoNo
linesNo
currencyNo
order_idYes
tax_rateNo
order_dateNo
customer_idNo
sheet_numberNo
confirm_tokenNo
expected_dateNo
discount_amountNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / confirm_token
      Added value: +{
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations: the destructive semantics are spelled out (unsent lines are deleted), a two-phase confirm protocol is described with the exact response fields (confirmation_required, confirm_token, summary with delete_count, name, sku), and token constraints are enumerated (bound to key, org, order and each deleted line's id/sku/name/quantity, 5-minute expiry, single use, rejected if the delete set changes). Error and re-validation behavior (stale token after a line is added, line_id not on order, quantity_shipped > 0) is also disclosed, consistent with destructiveHint=true and idempotentHint=false.

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?

Purpose and the destructive replace rule are front-loaded, and nearly every subsequent sentence adds an actionable rule rather than restating the schema. It is dense but long (~200 words) and mixes confirmation protocol, token binding, and line-field editing without sectioning, which makes it harder to scan than it could be.

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?

There is no output schema, and the description compensates by describing the confirmation response fields in detail. For a destructive 11-parameter mutation with a nested lines array, the risky paths are well covered, but the caller is left without any sense of what a successful (non-confirmation) response looks like or what the scalar header fields do.

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 0%, so the description carries the full burden. It does a good job on the hardest part — the lines array: line_id to keep, item_id/description requirement for new lines, quantity and unit_price, omitted fields retained, empty string/null clearing, and item_id change side effects on description/SKU/barcode — plus confirm_token. But the eight scalar fields (memo, currency, tax_rate, order_date, customer_id, sheet_number, expected_date, discount_amount) get no mention at all, leaving half the surface undocumented anywhere.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Update a sales order') and immediately clarifies the non-obvious scope: lines are replaced wholesale, and lines omitted are deleted. This distinguishes it from a partial patch. It does not, however, differentiate itself from nearby siblings such as confirm_sales_order or cancel_sales_order, so the reader must infer the boundary.

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 explicit branching guidance for the confirmation flow: when a delete occurs the first call does not write, when a token is needed, when it is not ('A call that only changes or adds lines does not need confirm_token'), and that a plain 'confirm' boolean is ignored. The missing piece is routing guidance versus sibling tools like confirm_sales_order, so it stops short of full when/when-not/alternatives coverage.

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