add_to_cart
Add a product to an existing cart by providing cart ID, product ID, and optional quantity. Validates product availability and returns the updated cart.
Instructions
Add a product to an existing cart.
Args: cart_id: The cart identifier (e.g. "crt_..."). product_id: The product identifier (e.g. "prod_001"). quantity: Number of units to add (default 1).
Validates that the product exists and has sufficient inventory. Returns the updated UCP cart, or an error message on failure.
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>",
"product_id": "<product_id>"
},
"name": "add_to_cart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cart_id | Yes | ||
| quantity | No | ||
| product_id | Yes |