build_basket
MANDATORY for shopping lists. When the user gives you 2 or more grocery items, call this tool ONCE with the full list. Do NOT call decompose_product, search_products, or batch_search per item: this tool searches every item in parallel with built-in query analysis (category routing, brand aliases, subcategory boost) and returns a basket with per-item cheapest pick, per-retailer options, basket total, retailer totals, and a shareable share_url. If the user named the stores they shop at, pass them in 'retailers'; otherwise omit it to search all four.
VALIDATION (mandatory before rendering): The search engine uses keyword matching, so wrong products leak through. Items flagged with a 'review' field on their cheapest pick are LIKELY WRONG and need your attention first. Then scan ALL picks (flagged or not) and check: (1) Is the product actually what was asked for? (e.g. 'frozen chips' is NOT 'frozen blueberries', 'sweet potato' is NOT 'potato', 'chicken fingers crumbed' is NOT 'chicken breast') (2) Is the size/form correct? (e.g. 400g pack is not a valid match for '2kg') (3) Is the selected option the cheapest CORRECT product, not just the cheapest product? If a pick is wrong: pick the correct product from by_retailer options for that item, or mark as '(check in store)'. Recalculate basket_total from your corrected picks.
OUTPUT FORMAT: Line 1: 'Cheapest basket: $X.XX' (use corrected basket_total). Then ONE markdown table with columns: Item | Product | Store | Price | Size. Then one line: 'View and share this basket: '. Use '(check in store)' in the Product cell for items in items_missing or where no correct product exists. No preamble, no per-item narration, no follow-up offers.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | Shopping list items exactly as the user wrote them, e.g. ['4 bananas', 'whole chicken', '12 free range eggs', 'full cream milk 2L', 'spaghetti', 'sliced white bread']. Include any size/quantity in the string ('2L', '1kg', '12 pack') so the cheapest CORRECT size is chosen. | |
| retailers | No | Only return results from these stores. Omit to search all four. |