Skip to content

Log or plan meal

Logs a meal you ate, or plans one for later.

WRITEcreate_meal

Your assistant uses it when you tell it what you ate, or ask it to plan a meal. It finds each food with Search foods first, and makes a new food only when nothing matches. Photos you attach are saved with the meal.

It takes the same input as Create a meal in the API, plus photos.

InputTypeDescription
eatenAtdate-timeRequired. When it was eaten, or for a plan when it will be, with its UTC offset.
timezonestringRequired. The IANA timezone where the meal is eaten, such as America/New_York. Up to 100 characters.
itemsarrayRequired. The foods in the meal, each with its portion. 1 to 100 items.
statestringlogged for food eaten; planned only for a plan the person asked to save. One of planned or logged. Defaults to logged.
imagesarrayPhotos 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.
namestring or nullA name for the meal as a whole, such as Sunday brunch. Up to 2,000 characters.
notesstring or nullNotes the person wants kept with the meal. Up to 2,000 characters.
requestIdstringA short id of your own for this save, different for every save, such as dinner-2026-11-22. Send the same one again when trying after an error or a timeout: Splot returns what it already saved rather than saving it twice.
photosarrayPhotos the person attached in this conversation to keep with this record: pass the attachments themselves, never file paths. Up to 6 items.
InputTypeDescription
foodobjectAn existing food: the library and key list_foods returned for it.
newFoodobjectA food that is in neither My foods nor the catalogue. It is saved to My foods so the meal or recipe can point at it. For an estimate, give nutrition per serving (base serving, basisAmount 1) with source origin estimate and a description of what it is based on, and use 1 serving.
quantitynumber or nullHow much was eaten, in unit. Leave quantity and unit out only when the person wants an entry without a portion.
unitstring or nullThe food's base unit (g, ml or serving) or one of its measure labels, as list_foods shows them. Convert other units first, such as 1 oz = 28.35 g. Up to 2,000 characters.
varietystring or nullFor a common food, which of its varieties it was, such as gala for an apple, by the id the food lists. The nutrition stays the food's own. Up to 100 characters.

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

Save a meal the person asked to log or plan. Find each food with list_foods first and pass a match as food (its library and key); use newFood only when nothing matches, never for a product the catalogue has. If the food or portion is unclear, ask one short question first (for example: chicken or bean burrito, and one or two?), without asking again for what the person already said. Use state logged for food eaten, and planned only for a plan the person asked to save, since suggestions alone are not a request. To log a meal that was planned, use update_meal instead of creating another. For planning, read get_targets first and respect the diet, dislikes and allergies the person mentions. Pass photos the person attached as photos. Say the meal is saved only after this returns its id; give every save its own requestId, and after an error or timeout try again with the same one.

Last updated