Skip to main content
Glama

update_cart_item

DestructiveIdempotent

Set the absolute quantity of a basket line using its item_id from get_cart, not product_id. Zero removes the line; use add_cart_item to increment instead. Returns the refreshed basket; no order or payment. OAuth scopes: cart:write. Changes buyer or order state.

Input Schema

NameRequiredDescriptionDefault
item_idYesBasket line item_id from this consenting buyer's get_cart response, not product_id or another buyer's item.
quantityYesNew ABSOLUTE quantity for this basket line, not an increment. Zero removes the line.

Output Schema

NameRequiredDescriptionDefault
emptyYes
itemsYes
currencyYes
subtotalYes
orderableYes
total_quantityYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Goes beyond the annotations (destructiveHint=true, idempotentHint=true) by disclosing the destructive edge case (zero deletes the line), the required OAuth scope cart:write, the return value ('refreshed basket'), and the absence of order/payment side effects. This is exactly the extra context annotations cannot carry.

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?

Four short sentences, zero filler, and the core semantics (absolute set, item_id source) are front-loaded before the caveats and scope note. Every sentence carries distinct information.

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?

Covers the mutation semantics, the destructive zero case, the auth scope, and confirms no downstream order/payment effects, while an output schema already documents the refresh response. Nothing an agent needs to call this safely is missing.

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 the baseline is 3, but the description adds discriminative meaning the schema states less forcefully: item_id must come from this buyer's get_cart and is 'not product_id', and quantity is absolute rather than an increment. Marginal but genuine added value over the schema.

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 precise verb+resource+semantics: 'Set the absolute quantity of a basket line'. It immediately distinguishes the operation from add_cart_item (increment) and remove_cart_item (removal), so an agent can route correctly without opening any schema.

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?

Explicit when-to-use and when-not-to-use: zero removes the line, and 'use add_cart_item to increment instead' names the alternative and the condition that selects it. It also tells the agent where item_id comes from (get_cart), closing the main misuse path.

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