compute_meal
Calculate per-item and total nutrients and glycemic load for a meal of up to 30 foods by ID, amount, and unit, returning named errors and lower-bound warnings instead of manual addition.
Instructions
Per-item and total nutrients and glycemic load for a meal of 1 to 30 items, each a food id, amount and unit as in get_nutrition. Use this for any total instead of adding numbers yourself. If an item fails, the error names it and no totals are returned. Totals listed in total_incomplete are lower bounds, and glycemic_load_missing names the items the meal's glycemic load leaves out. A dish's folate, vitamin C and vitamin B12 are totals of its raw ingredients, with no cooking losses applied; each item names them in raw_ingredient_totals, and a meal total that includes a dish carries the same caveat. Values are rounded to 2 decimals, so 0.0 can be a small amount; a value the source does not report is null, never 0.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | ||
| total | Yes | Nutrient amounts, the sum over the items. | |
| glycemic_load | Yes | ||
| total_incomplete | Yes | ||
| glycemic_load_missing | Yes |