update_meal
Correct a food already logged to the user's diary — fix a wrong calorie/macro value, quantity, or name, or move an entry to a different meal. Identify the entry by its id and local_date (both from get_day) and the food by its item_index within that entry's items[]. Only the fields you send change; the macros you send are MERGED onto the existing ones (so sending just kcal leaves protein/carb/fat as they were). This overwrites the value IN PLACE — there is no history of the previous value. Editing never moves an entry to another day (to do that, delete and re-log). SAFETY: all calorie and macro values here — including carbohydrates — are ESTIMATES (from USDA / Open Food Facts or the user's own entry), approximate and not lab-measured or per-batch. They are for general nutrition tracking ONLY. Do NOT use them for insulin dosing, carb-counting for a bolus, blood-glucose prediction, or any other medical decision, and do NOT compute a dose or glucose estimate from them. For anything medical, direct the user to the product's own label and their care team.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The entry id to edit (from get_day). | |
| meal | No | Move the entry to a different meal label. | |
| name | No | ||
| note | No | ||
| macros | No | Corrected macros — only the components you send are changed. | |
| fluid_ml | No | Corrected fluid/hydration volume, in millilitres. | |
| quantity | No | Portion as stated, e.g. '2' or '1 cup'. | |
| item_index | No | Which food in the entry's items[] to edit (0-based). Required when changing a food's name/quantity/macros/caffeine/fluid; omit for an entry-level change (meal/note). | |
| local_date | Yes | YYYY-MM-DD diary date of the entry (from get_day). | |
| caffeine_mg | No | Corrected caffeine content, in milligrams. |