# Change meal

> Changes a meal, or marks a planned meal as eaten.

`WRITE update_meal`

Only what your assistant sends changes. Items change one at a time, by the ids the meal returned: a new portion, a food removed, or a food added. When you eat a meal you planned, your assistant marks it eaten here rather than logging it again.

It takes the same input as [Update a meal](https://splot.health/docs/api/meals/update) in the API, plus `photos`.

## Inputs

| Input | Type | Description |
| --- | --- | --- |
| `id` | string | Required. |
| `state` | string | logged for food eaten; planned only for a plan the person asked to save. One of `planned` or `logged`. |
| `eatenAt` | date-time | When it was eaten, or for a plan when it will be, with its UTC offset. |
| `timezone` | string | The IANA timezone where the meal is eaten, such as America/New_York. Up to 100 characters. |
| `name` | string or null | Up to 2,000 characters. |
| `notes` | string or null | Up to 2,000 characters. |
| `images` | array | Photos already saved on this record to keep, or public https image links. New photos from the conversation go in photos, never here. Up to 20 items. |
| `items` | object |  |
| `photos` | array | Photos the person attached in this conversation to keep with this record: pass the attachments themselves, never file paths. Up to 6 items. |

### Items

| Input | Type | Description |
| --- | --- | --- |
| `add` | array | Foods to add, as create_meal items. Up to 100 items. |
| `change` | array | New portions by item id, or both null to clear one. Up to 100 items. |
| `remove` | array | Ids of items to drop. Up to 100 items. |

## What your assistant is told

The tool's own instructions, word for word, as every assistant receives them.

> Change a saved meal; only what you pass changes. Mark a planned meal as eaten with state logged (and eatenAt if the time differs) rather than creating it again; move, rename or annotate a meal the same way. A field left out keeps its value, and null clears name or notes. Items change one at a time by the item ids the meal returned: items.change sets a portion, items.remove drops items, and items.add adds foods as in create_meal; to swap a food, remove it and add the other. Ask one short question first if a food or portion is unclear. Pass photos the person attached as photos to add them; images replaces the saved photos, and a saved photo left out is deleted. Confirm the change only after success.
