Update UCP Shopping Cart
update_cartReplace 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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Active cart identifier (ucart_<20 hex chars>) to update. | |
| cart | Yes | Updated cart fields. | |
| meta | No | UCP protocol request metadata (meta.ucp-agent and meta.idempotency-key). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ucp | Yes | Negotiated UCP protocol metadata and capability intersection. |