Refine a compared basket
refine_basketCreates a new basket snapshot with a new basket_id and re-compares prices without changing the original basket or re-searching unchanged items. The returned ID identifies the new snapshot for subsequent edits, saving and handoff. Supports item removal, product swaps, additions, chain restrictions and changes to how many chains the basket splits across. Chain totals include the chain's delivery fee, shown separately as deliveryFee (null means the fee is unknown and that total may exclude delivery). favorite: exact means that chain's product is one of the user's Bite favorites for the item. A chain without it has no favorite field and uses Bite's usual match. Signed in, the user's saved cards and clubs (add_benefit_program) are applied and the result lists which chains used card prices; otherwise totals are public prices and no card or club is mentioned.
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": {
"basket_id": "<basket_id>"
},
"name": "refine_basket"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| add | No | Items to add to the basket. | |
| swap | No | Replace an item with another product, e.g. {"item":"חלב","replacement":"חלב 1% תנובה"}. | |
| items | No | Edits by item id (used by the Bite card): set quantity, pick a product for every chain, or remove. | |
| chains | No | Only consider these chains (ids or names, e.g. ["shufersal","rami-levy"]). | |
| locale | No | Language of a "message" reply. Default "he". | |
| remove | No | Items to drop, as the user named them. | |
| basket_id | Yes | The basketId returned by compare_basket, compare_my_list or a previous refine_basket; pass it here as basket_id. | |
| max_chains | No | Most chains to split across. Default 2. | |
| reply_format | No | "message" returns a short ready-to-send chat message with the main numbers instead of the full card data. Default "card". |