Compare products
compare_productsUse this when the user wants to compare packaged foods, such as "which of these barcodes has the least sugar?". Pass one to five barcodes and optionally sugars (default), salt or kcal. Returns a ranking from lowest to highest per 100 g with each product's other nutrition, Nutri-Score and NOVA group, and lists barcodes that were invalid, not found or lacked data. Crowd-sourced data: check the physical labels.
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": {
"barcodes": "<barcodes>"
},
"name": "compare_products"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| field | No | What to rank by, per 100 g: sugars (default), salt or kcal | |
| barcodes | Yes | Barcodes to compare, up to 5 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| unit | Yes | ||
| basis | Yes | ||
| field | Yes | ||
| order | Yes | ||
| notice | Yes | ||
| ranked | Yes | ||
| status | Yes | ||
| invalid | No | ||
| message | No | ||
| no_data | No | ||
| not_found | No | ||
| attribution | Yes |