Calorie Counter & Food Diary
log_caloriesLog what I ate and count calories. Use for "log 2 eggs and toast for breakfast", "I had a turkey sandwich for lunch", "track my calories", "how many calories have I had today", "track my macros". Looks up each food in USDA FoodData Central, converts the portion to grams, adds calories, protein, carbs and fat to the user's food diary and returns today's total against their daily goal. Send foods with a quantity and US unit (each, cup, tbsp, oz, slice). Call with no foods to read today's totals. Keep the returned diary_id and pass it on later calls.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | YYYY-MM-DD in the user's local time. Defaults to today (UTC). | |
| meal | No | snack | |
| foods | No | What the user ate, e.g. [{"name":"banana","quantity":1,"unit":"each"},{"name":"peanut butter","quantity":2,"unit":"tbsp"}]. | |
| recipe | No | Log servings of a recipe from plan_week or generate_recipe. | |
| diary_id | No | Food diary id from an earlier log_calories call. Omit on first use; a new diary is created. Remember and reuse it. | |
| daily_goal | No | Daily calorie goal; saved on the diary. |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| day | Yes | ||
| date | Yes | ||
| logged | Yes | ||
| diary_id | Yes | ||
| nutrition_source | Yes | ||
| unresolved_foods | Yes | Ingredients that could not be matched to USDA FoodData Central; their calories are NOT included. Ask the user for a weight (oz/g) or a clearer name. |