log_food
Log meals by entering food items, amounts, or barcodes; matches nutrition data from USDA and Open Food Facts, then returns daily totals.
Instructions
Log food. Usually pass the user's words as text ("2 eggs, toast and a protein shake", "lunch: 200g chicken, 1 cup rice"); it is split into items and each is matched to USDA FoodData Central or Open Food Facts. For one item: name (or barcode, or a food_id from lookup_food) with grams, or amount + unit (cup, slice, tbsp, oz, ml...). Pass kcal/protein/carbs/fat when the user reads them off a label. meal: breakfast, lunch, dinner or snack (default from the words, else the time of day). Each item has a status: ok / manual count; unknown (no match; see candidates) and needs_amount do not count until fixed with edit_food. Returns the items and the day's totals so far.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fat | No | ||
| kcal | No | ||
| meal | No | ||
| name | No | ||
| text | No | ||
| unit | No | ||
| carbs | No | ||
| grams | No | ||
| amount | No | ||
| barcode | No | ||
| food_id | No | ||
| protein | No |