Skip to main content
Glama

Update order item

update_order_item
Destructive

Update a line item on an order (quantity, unit price, discount, name, or SKU). Recomputes the order total. Only allowed while the order is pending or confirmed; otherwise it fails with 409 CONFLICT "Order lines can only be changed while the order is pending or confirmed" (stock is committed from processing on). Use get_order to find the order's externalId and the item's itemId. The CRM recalculates shipping eligibility from the saved priced lines; a separate whole-order discount may require source-confirmed amount correction. The result echoes the operating workspace.

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": {
      "externalId": "<externalId>",
      "itemId": "<itemId>",
      "patch": "<patch>"
    },
    "name": "update_order_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
patchYesThe order item fields to update; include at least one changed field.
itemIdYesThe order item id returned by get_order.
externalIdYesThe order externalId returned by list_orders or create_order.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • removedInput schema / properties / patch / properties / discount / default
      Removed value: -0
  2. Changed1 schema field changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  3. Changed1 schema field changed
    • changedInput schema / properties / itemId / description
      Previous value: -"The order item id returned by the matching search/list tool."New value: +"The order item id returned by get_order."
  4. Changed6 schema fields changed
    • changedInput schema / properties / patch / description
      Previous value: -"The order item fields to update."New value: +"The order item fields to update; include at least one changed field."
    • addedInput schema / properties / patch / properties / discount / description
      Added value: +"Percentage discount on this line (0-100). Default 0."
    • addedInput schema / properties / patch / properties / productName / description
      Added value: +"Line item name, snapshotted onto the order. Use search_products to quote a real catalog product's name. Required."
    • addedInput schema / properties / patch / properties / quantity / description
      Added value: +"Quantity ordered (integer, at least 1)."
    • addedInput schema / properties / patch / properties / sku / description
      Added value: +"Product SKU snapshot (from search_products). Optional."
    • addedInput schema / properties / patch / properties / unitPrice / description
      Added value: +"Price per unit in the order currency, as a decimal (e.g. 199.99). Snapshotted onto the line."
  5. Changed3 schema fields changed
    • addedInput schema / properties / externalId / description
      Added value: +"The order externalId returned by list_orders or create_order."
    • addedInput schema / properties / itemId / description
      Added value: +"The order item id returned by the matching search/list tool."
    • addedInput schema / properties / patch / description
      Added value: +"The order item fields to update."
  6. Added

TDQS

A4.4/5.0
Behavior5/5

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

Goes well beyond the annotations by disclosing side effects: recomputes the order total, triggers CRM recalculation of shipping eligibility, and notes a whole-order discount may need source-confirmed correction. It also states the state constraint and stock-commit boundary and notes the result echoes the operating workspace.

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 core purpose and field list, then adds constraint and side-effect context. Efficient overall, though the mid-sentence about CRM shipping recalculation and whole-order discount correction is dense and slightly tangential.

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, non-idempotent mutation with no output schema, it covers prerequisites, the failure condition, side effects, and what the result contains. Nothing an agent needs to call it correctly is missing.

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 100%, so the schema already documents externalId, itemId, and every patch field with constraints. The description's field list (quantity, unit price, discount, name, SKU) merely restates what the schema provides, so the baseline 3 applies.

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 (Update) and resource (line item on an order), enumerates the mutable fields, and is clearly distinguishable from siblings add_order_item and remove_order_item. An agent can identify the operation 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 a clear precondition (order must be pending or confirmed) and the exact failure mode (409 CONFLICT) otherwise, plus a pointer to get_order for obtaining externalId/itemId. It stops short of explicitly naming sibling alternatives (add/remove_order_item) or when not to use it, so it falls just below the top band.

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