Add to cart
add_to_cartAdd one or more products to the cart in a single call (put a whole request's items in one call). For several of the SAME item use quantity (e.g. "2 Chili Boxes" → quantity: 2). For DIFFERENT products use items (an array of { productId, quantity?, optionValueIds? }), each with its own quantity. For a single product, pass productId/quantity/optionValueIds directly. product_id comes from search_merchant_products/get_product_details; optionValueIds are addon/size value ids from the product's options. One merchant per cart.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "add_to_cart"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | No | Add multiple items in one call. | |
| language | No | Language for item names (en, ar, kr, bd). | |
| quantity | No | Quantity for the single product (default 1). | |
| productId | No | Single product id to add (when not using `items`). | |
| optionValueIds | No | Option value ids for the single product. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | No | Cart line items (line_id, product_id, name, quantity, prices, options). | |
| message | No | Present on an empty cart. | |
| currency | No | ||
| subtotal | No | ||
| item_count | No | ||
| merchant_id | No | ||
| merchant_city | No | ||
| merchant_name | No |