add_to_cart
Add a product variant to the current store cart and preserve existing items.
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": {
"variant_id": "<variant_id>"
},
"name": "add_to_cart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cart_id | No | ||
| quantity | No | ||
| variant_id | Yes | ||
| buyer_context | No | ||
| cart_scope_id | No | ||
| source_surface | No | unknown | |
| cart_session_id | No | ||
| subject_product_id | No | ||
| recommendation_type | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | cart_result | |
| empty | No | ||
| items | No | ||
| cartId | No | ||
| totals | No | ||
| message | Yes | ||
| storeId | Yes | ||
| snapshotAt | No | ||
| cartScopeId | No | ||
| cartVersion | No | ||
| continueUrl | No | ||
| emptyReason | No | ||
| snapshotMode | No | current | |
| cartSessionId | No | ||
| lineItemCount | No | ||
| cartSessionState | No | active |