Recommend alternative products
recommend_alternativesFind alternatives to an Alza product by code, ranking by cheaper price, same brand, or better customer rating; falls back to category search when no listed alternatives match.
Instructions
Find alternatives to one product ("something like this but cheaper / better / same brand"). Candidate pool = Alza's own alternatives list for the product (mobile API, keyed by the numeric commodity id taken from the product URL); if that list is empty, or nothing in it survives the mode filter, falls back to a same-category search_products (poolSource says which was used). Heuristics: cheaper = strictly lower price, cheapest first; same-brand = brand match (source brand vs. the candidate's name), then rating desc, price asc; better-specs = rating >= source rating (unrated dropped), then rating desc, price asc — it ranks by customer rating, it does not compare spec tables, so shortlist then compare with get_product params. The source product is always excluded. Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Alza product code of the product to find alternatives for, e.g. 'RI054b5'. Same as the `code` from `search_products`. | |
| mode | No | Ranking mode. 'cheaper': strictly lower price than the source, cheapest first. 'same-brand': same brand as the source, best rating first then lower price. 'better-specs': rated at least as high as the source (unrated excluded), best rating first then lower price — a rating heuristic, NOT a spec-table comparison. Omit to get Alza's own alternatives order. | |
| limit | No | Maximum number of alternatives to return. Default 5, max 20. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | ||
| source | Yes | Scraped product detail (JSON-LD sourced; stable fields listed, rest passthrough). | |
| poolSource | Yes | ||
| alternatives | Yes | ||
| candidatesConsidered | Yes |