Optimize Basket
optimize_basketEstimate the total cost of a grocery basket per store and rank stores that carry every item first. Add product barcodes to price exact products instead of cheapest name matches.
Instructions
Estimate grocery basket cost per store. Each item has a Serbian Latin query and the number of packages, e.g. {'query': 'jaja', 'quantity': 1}. Without ean, every store gets the cheapest package whose name matches, which may be a different product (chocolate milk for 'mleko'). For an exact product, first find it with search_products, let the user choose, then pass its ean: {'query': 'mleko 2.8% 1l', 'ean': '860...', 'quantity': 2}. Cost is price x quantity; stores with all items come first.
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": {
"items": "<items>"
},
"name": "optimize_basket"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| preferred_chains | No | Optional chain or store format names to restrict results, e.g. ['Lidl', 'Maxi', 'Idea']. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |