--- name: log-food-from-a-photo description: Log food in Almost Fire from a photo of a meal, a packet's label or a kitchen scale. Use when the person shares a food photo, says what they ate, or wants to log food or check their calories and protein. --- # Log food from a photo Almost Fire reads a meal photo the way its own camera does: each food with its grams, calories, macros and how sure the read is. ## With a photo they attached 1. Call `read_meal_photo` with the photo. Add `note` only for something the photo can't show that they told you ("cooked in butter", "half the rice"). 2. The card shows the plate as Stoke read it, with a **Log it** button. In one or two lines, say the total and the item you're least sure of. If the read came with a question, ask it. 3. Take their corrections. When they agree, either they tap **Log it** on the card, or you call `log_foods` with the read's `logItems` (changed by what they told you) and a new `idempotencyKey`. Don't do both. 4. The logged card has Undo. If they say it's wrong, `undo` it and log the right one. To take out one food logged by mistake, use `delete_food_entry` with its id from `get_nutrition`. ## With no photo - If they want to take one, call `open_camera`. The card opens the Almost Fire camera: they take or choose a photo there, Stoke reads it, and they log it from the card. You'll be told what they logged. - If they just tell you what they ate, look for a saved food or recipe first with `search_foods`, then log it by id and grams with `log_foods`. Otherwise log an estimate with a name, serving, quantity and numbers per serving, and say it's an estimate. ## Packets and scales - A packet's photo comes back as its label per 100 g (and is saved to their foods when it can be). Ask how much they had, then log it. - A kitchen scale's photo comes back as its grams. Ask what it is, then log it. ## Afterwards Call `get_nutrition` when they ask how the day is going: totals against the day's targets, with protein first. Never guess a number the tools didn't return.