update_log
Correct an existing FOOD log: title, nutrition numbers, the ingredient list, meal, or time-of-day. Read get_today/get_day first — each item in recent (type "food") carries the id to pass here. Send ONLY the fields to change; values are absolute for the item as logged. Two modes, never mixed: send ingredients to REPLACE the whole list (include every ingredient you want kept — the log's totals recompute from it, so don't also send calories/macros), OR send top-level numbers to set totals directly — the existing ingredient breakdown then RESCALES proportionally so the parts always sum to the new totals (ingredient names/amounts don't change, so when the COMPOSITION changed — something added or removed — send ingredients instead). Note: ANY edit that changes a routine-created log's title or its calories — including an ingredients replacement, since totals recompute — also updates that saved routine. When logged_time changes, the log's meal may re-infer from the new hour unless you set meal explicitly. Requires a full-access token; edit one log at a time.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| meal | No | ||
| fat_g | No | ||
| title | No | ||
| log_id | Yes | The item's `id` from get_today/get_day `recent` (type "food" only). | |
| carbs_g | No | ||
| fiber_g | No | ||
| sugar_g | No | ||
| calories | No | ||
| protein_g | No | ||
| sodium_mg | No | ||
| ingredients | No | REPLACES the full ingredient list; totals recompute from it. Cannot be combined with top-level numeric fields. | |
| logged_time | No | HH:MM 24h — time-of-day only; the log's DATE never changes. |