Skip to main content
Glama

Quantum Atlas Universal Commerce Storefront (UCP)

Update UCP Shopping Cart

update_cart
Idempotent

Replace line items or buyer locality context on an active ucart_* shopping cart and recompute USD cent totals. Use this to adjust quantities or add/remove variants before converting to checkout; do not use on canceled carts. Parameters: pass top-level id ("ucart_*") and cart.line_items (full-replace list preserving line_items[].id for existing lines and item.id for variants) plus optional cart.context and cart.buyer. Behavior: idempotent full-state replacement on active carts; rejects canceled or expired carts.

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

Input Schema

NameRequiredDescriptionDefault
idYesActive cart identifier (ucart_<20 hex chars>) to update.
cartYesUpdated cart fields.
metaNoUCP protocol request metadata (meta.ucp-agent and meta.idempotency-key).

Output Schema

NameRequiredDescriptionDefault
ucpYesNegotiated UCP protocol metadata and capability intersection.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true and destructiveHint=false, so the description earns credit for going further: it spells out full-state replacement semantics (omitted lines are dropped, not merged), that totals are recomputed in USD cents, and that canceled or expired carts are rejected. It does not mention the UCP agent profile / idempotency-key expectations, though those live in the schema.

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?

Three labeled sentences — purpose, parameters, behavior — with the highest-value constraint (full replacement) placed before the parameter detail. Dense but front-loaded and free of filler; the parenthetical id-format asides are the only slightly crowded element.

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 three-parameter, deeply nested mutation with an output schema present, the description covers what changes, what gets destroyed, the idempotency model, and the failure mode (canceled/expired rejection). The remaining gap is operational: it never tells the agent that meta.ucp-agent and meta.idempotency-key are expected on calls, which matters for a replay-safe write.

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 id, cart.line_items, item.id, quantity bounds, context and buyer fields. The description restates the shape (top-level id, cart.line_items, optional cart.context and cart.buyer) and adds a modest hint about preserving line_items[].id for existing lines, but adds little syntax or meaning the schema does not already carry.

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?

The first sentence gives a specific verb (Replace), the exact resource (line items or buyer locality context on an active ucart_* cart), and the side effect (recompute USD cent totals). The scoping phrase 'active ucart_* cart' versus 'before converting to checkout' lets an agent separate this from the checkout-side siblings without opening a 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?

It states a positive use case ('adjust quantities or add/remove variants before converting to checkout') and an explicit exclusion ('do not use on canceled carts'), which is stronger than most mutation definitions. It stops short of naming a specific alternative such as update_checkout for post-conversion changes, leaving that routing to inference.

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