Look up barcode
lookup_barcodeLook up a packaged food by EAN/UPC barcode (Open Food Facts). Returns nutrients per 100 g and serving size. Use it whenever a photo shows a barcode: read the digits (usually 13, or 8/12) from the image and look them up BEFORE estimating anything, then log with log_food_from_database (pass the returned food object and the eaten grams). If nothing is found, fall back to label values in the photo or an estimate with log_food. The user's own saved version of a product (save_food, or edited in the app) comes first. If the result has a warning, or the nutrition label in the photo shows different numbers, the label wins: log with log_food using the label's values.
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": {
"barcode": "<barcode>"
},
"name": "lookup_barcode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| barcode | Yes | Digits of the EAN-13 / UPC-A barcode |