cart_add
Add units of a product to the customer's cart. The price is always the shop's own; it cannot be given. A product with variants needs its variant_id: without it you get need=options with the choices (the shop shows them as buttons): ask which one the customer wants and call again with that variant_id. If the product is already in the cart it returns already_in_cart and adds nothing (unless the customer asked for more in this message): to change how many there are, use cart_update with the exact number.
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": {
"product_id": "<product_id>"
},
"name": "cart_add"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| qty | No | ||
| product_id | Yes | ||
| session_id | No | Only if your client does not keep the MCP session (the Mcp-Session-Id header): the session_id that an earlier answer of this server gave you. It keeps the same cart between calls. | |
| variant_id | No |