nutrients_per_serving
Calculate energy and key nutrients for a single Open Food Facts product by barcode, scaling per-100 g values to a label serving, serving count, or gram amount.
Instructions
Energy and key nutrients for one Open Food Facts product, scaled from per-100 g data to one label serving, a number of servings, or a gram amount. Pass grams when the product has no serving size. Salt is in grams. If both grams and servings are set, grams wins.
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": "nutrients_per_serving"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| grams | No | Amount in grams. If set, servings is ignored. | |
| barcode | Yes | Barcode printed on the package (EAN-8, UPC-A, or EAN-13). Digits only; spaces and dashes are ignored. | |
| servings | No | Number of label servings. Defaults to 1 when grams is omitted. |