Skip to main content
Glama

Update a cart

update_cart
Destructive

Modify an open cart before checkout. op: 'add' appends items, 'remove' drops items by 0-based index, 'set' replaces the full item list, 'clear' empties the cart. Merges customer details (name, email, phone) via the customer field. Call get_cart afterwards to confirm. Cannot modify a cart that already has a checkout in progress.

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": {
      "cart_id": "<cart_id>"
    },
    "name": "update_cart"
  }
}

Input Schema

NameRequiredDescriptionDefault
opNoadd appends items; remove drops the items at the 0-based positions given in indices; set (the default) replaces the whole list with items; clear empties the cartset
itemsNoBlinds for op add or set, each with product_id, width_mm, height_mm, colour and mount_type. The server recalculates all prices
cart_idYesId of the cart, as returned when the cart was created. Carts expire after 24 hours without changes
indicesNoItem indices to remove (0-based) when op='remove'
customerNoCustomer details: real name, email and South African mobile number, plus delivery address and city. Placeholder details are refused at checkout

Output Schema

NameRequiredDescriptionDefault
itemsYes
cart_idYes
currencyYes
customerYes
total_zarYes
created_atYes
expires_atYes
item_countYes
updated_atYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / items / items / properties / operation
      Added value: +{
      +  "description": "Coulisse honeycomb only (honeycomb-blockout-coulisse, honeycomb-light-filtering-coulisse): 'tdbu' = top-down/bottom-up, up to 1300 mm wide, its own price; 'cord' (default) = cord lock, up to 3000 mm wide.",
      +  "enum": [
      +    "cord",
      +    "tdbu"
      +  ],
      +  "type": "string"
      +}
  2. Changed6 schema fields changed
    • addedInput schema / properties / cart_id / description
      Added value: +"Id of the cart, as returned when the cart was created. Carts expire after 24 hours without changes"
    • addedInput schema / properties / customer / description
      Added value: +"Customer details: real name, email and South African mobile number, plus delivery address and city. Placeholder details are refused at checkout"
    • addedInput schema / properties / customer / properties / address / description
      Added value: +"Street delivery address. A real address is required before payment"
    • addedInput schema / properties / customer / properties / city / description
      Added value: +"Delivery town or city, for example Knysna or Johannesburg"
    • addedInput schema / properties / items / description
      Added value: +"Blinds for op add or set, each with product_id, width_mm, height_mm, colour and mount_type. The server recalculates all prices"
    • addedInput schema / properties / op / description
      Added value: +"add appends items; remove drops the items at the 0-based positions given in indices; set (the default) replaces the whole list with items; clear empties the cart"
  3. Changed1 schema field changed
    • changedInput schema / properties / items / items / properties / mount_type / description
      Previous value: -"Use inside for inside mount or outside for face fix"New value: +"Use inside for inside mount or outside for outside mount"
  4. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already flag destructiveHint=true, and the description backs that up with concrete consequences: 'set' replaces the whole list and 'clear' empties the cart. It adds behavior annotations do not carry — that customer details are merged rather than replaced, that prices are server-recalculated, and that carts with an in-progress checkout are locked.

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, front-loaded with the purpose and the op vocabulary, followed by side effects and the confirmation step. No sentence is padding, and the constraint/next-step guidance sits at the end where it is easy to scan.

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?

With an output schema present, return values need no explanation, and the description covers the mutation semantics, preconditions, and follow-up call. A small gap remains: it never states that items or indices are conditionally required depending on op, leaving that inference to the schema.

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 3 is the baseline; the description earns above that by explaining that the customer object is merged into existing details and by defining each op's effect on the item list in one place. It echoes the schema on op values and indices rather than adding new detail there.

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?

"Modify an open cart before checkout" gives a specific verb and resource plus a lifecycle scope, and the four op values spell out exactly what kind of modification is possible. The pre-checkout scope and the note that a cart with a checkout in progress cannot be modified implicitly separate it from create_cart and update_checkout.

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?

It states the operating window (an open cart, before checkout), a hard exclusion (no checkout in progress), and a follow-up step (call get_cart to confirm). What is missing is explicit routing such as "use create_cart if no cart exists yet" or when to prefer update_checkout instead.

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