Skip to main content
Glama

update_cart_item

Change an item that is already in the shopping cart.

Use this tool to change the quantity, the variant, or the modifier options of one cart item. A cart must exist and must have items.

Steps

  1. Call the 'add_item_to_cart' tool to put an item in the cart.

  2. Call this tool to change the item.

  3. Call the 'create_checkout_url' tool to get a checkout URL.

Rules

Send 'line_item_id' to select the cart item to change. It is the 'entityId' of that item in the cart that the last cart tool call returned, for example 'add_item_to_cart'. It is not 'productEntityId' or 'variantEntityId'. Send 'quantity' and 'productEntityId' in 'item'. If the configuration that the user chose has a variant, send 'variantEntityId'. If it has no variant, see "Configurations with no variant" in the 'add_item_to_cart' tool. The same rules apply here, including when to send 'variantEntityId' as null.

Modifier options

'item.selectedOptions' works as it works in the 'add_item_to_cart' tool. The 'get_product_details' tool returns these options in 'modifierOptions'.

If the product has required modifier options, send them again in this request. If you do not send them, the server does not change the item. Send only the buckets that you need.

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": {
      "line_item_id": "<line_item_id>",
      "item": "<item>"
    },
    "name": "update_cart_item"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemYes
line_item_idYesThe 'entityId' of the cart item to change. Take it from 'cart.lineItems.physicalItems' or 'cart.lineItems.digitalItems' in the latest cart response. It is not 'productEntityId' or 'variantEntityId'.

Output Schema

NameRequiredDescriptionDefault
cartYes
messageNo
successYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations present, the description carries the full burden and does disclose a genuinely surprising rule: required modifier options must be resent or the server leaves the item unchanged, and only the buckets you need should be sent. It also explains that line_item_id comes from the previous cart tool's response rather than being a product or variant ID. It leaves gaps around permission requirements, error behaviour, and what happens to fields that are not resent, which keeps it short of a 5.

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?

The one-line summary is front-loaded, and the Steps and Rules headings make the call sequence and constraints scannable. A few reference chains ('see Configurations with no variant in the add_item_to_cart tool') push the reader into another document, which costs some efficiency.

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 mutation tool with nested objects, no annotations, and an output schema that already covers return values, the description supplies the sequencing, the ID provenance, and the modifier-resend rule. What remains thin is failure behaviour and whether quantity is absolute or incremental, both of which an agent would benefit from knowing before calling.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 50% and the nested item object is undocumented, so the description does real work here: it states that line_item_id is the entityId from the prior cart response and explicitly not productEntityId or variantEntityId, that quantity and productEntityId ride inside item, and that variantEntityId is conditional on the configuration having a variant. It even defers the no-variant case to a specific named section of add_item_to_cart, which is the only remaining ambiguity.

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?

Opens with a specific verb and resource, 'Change an item that is already in the shopping cart', then narrows the scope to quantity, variant, and modifier options on a single cart item. That wording alone separates it from the sibling add_item_to_cart, which puts a new item into the cart.

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 an explicit three-step workflow that names both neighbours (add_item_to_cart before, create_checkout_url after) and states the prerequisite that a cart must exist and contain items. It also names get_product_details as the source of modifier options, so the agent never has to guess where the option data comes from.

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