Remove logged foods
remove_itemsDelete logged food rows from a day by row_id, listing each removed item with its details so it can be added again. Also reports missing ids, making repeats safe.
Instructions
Delete logged food rows from a day by row_id (meals[].items[].row_id in get_day). removed lists each deleted row with what it was (meal, meal_name, row_id, name, food_type, food_id, measure_id, measure_name, measure_quantity, energy in kcal, protein/fat/carbohydrate in g, eaten), enough to add it again: with add_food, or with add_custom_item from its name and nutrition when food_id is null (a custom row); failed lists the rows still there. Ids that are not food rows on the day (already deleted, or an activity's row_id) are listed in missing, so repeating the call is safe. Preview a removal with preview_removal, which only reads; dry_run does the same here. data.ok is false when a row was missing or failed; the result's top-level ok only says the call ran.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Day as YYYY-MM-DD; when the user says today, yesterday, this week or a weekday, call get_today and count from its date. | |
| dry_run | No | Only report what would be deleted; preview_removal does it without a destructive call. | |
| row_ids | Yes | row_ids from get_day. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| error | No | describe_error() of what went wrong; docs/AGENTS.md, Results and errors. |