Update a recorded meal
update_mealChanges one meal that is already recorded, identified by its meal type and day — omit date for today, otherwise pass the customer's word (yesterday, 3 days ago, Tuesday) or YYYY-MM-DD only when they said the full date; never compute one yourself. It never creates a missing meal. Choose action 'add' when the customer only adds something they also ate with that meal: send only the added foods as items, one per food; IZeat appends them and recomputes the meal. Choose action 'revise' when the customer corrects, replaces, removes or combines several changes. Read the meal first with get_meal (it returns the rows exactly as stored, and draws nothing), then send the complete list of items as the meal should now be — copy every untouched row exactly as read, change only what the customer changed, leave out what they removed — plus a short list of the changes. Each change description must repeat the concrete customer fact, including old and new quantities or supplied calorie values when known. One revise call stores all those changes together. Never recompute totals yourself: IZeat sums the rows. Items follow the same rules as log_meal: grams or millilitres only, the customer's own measure kept in as_said, figures with decimals allowed, one source per item. Only the rows that differ are touched: a replaced row is kept in IZeat's history and points at its replacement; untouched rows stay as they are. A repeated identical request does not apply the update twice. Returns only the previous and current customer-facing meal facts with their rows, their nutrition difference, and the day so far. The returned receipt includes the concrete foods, quantities or supplied values that were changed before the new totals. Never mention internal identifiers, storage versions or retry keys to the customer. Example add: update_meal { "action": "add", "date": "2026-09-03", "meal_type": "lunch", "items": [ { "description": "plain yoghurt", "amount": 125, "unit": "g", "as_said": "one pot", "kcal": 90, "protein_g": 8, "carb_g": 7, "fat_g": 3, "source": "label" } ], "idempotency_key": "add-yoghurt-a3f9c1" }. Example revise: the customer says the steak was 180 g rather than 200 g and they also ate a yoghurt → send every row as read, the steak row with amount 180 and its figures for 180 g, plus the yoghurt row, and changes ["Steak corrected from 200 g to 180 g", "Added a plain yoghurt"]. statement is the customer-facing IZeat message. It begins with "IZeat ·" so customers can distinguish information returned by IZeat from the assistant's own response. For write operations, it also states whether the requested change was recorded in their IZeat account. Account: Sam (review@izeat.app)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | Yes | ||
| statement | Yes | Customer-visible IZeat receipt. Its value begins with "IZeat ·". |