delete_entry
ChatGPTDelete a logged meal by entry_id (get it from list_entries). Call this when the user wants to remove an entry. The deletion is reversible server-side (soft delete) but disappears from history and totals.
delete_saved_food
ChatGPTUse this when the user wants to remove a saved food. Pass saved_food_id (from list_saved_foods or get_user_context). Meals already logged from it are not changed.
edit_entry
ChatGPTUpdate a logged meal by entry_id (get it from list_entries). Pass only the fields to change (description, meal_type, logged_at, protein_g/carbs_g/fat_g, calories_kcal, etc.). Calories are recomputed from macros unless you pass calories_kcal explicitly.
get_daily_summary
ChatGPTShow the user's totals for a day: calories and macros consumed, their goal, and what's remaining. Optionally pass date (YYYY-MM-DD in the user's local time); omit for today. The day is resolved in the user's saved timezone. Use this to answer "how am I doing today" — do not use log_meal for that.
get_user_context
ChatGPTRead the user's saved settings: timezone, unit preference, profile (age/sex/height/weight/activity/goal), active macro targets, and standing food preferences. Call this at the start of a session before estimating or logging so your estimates and advice match what the user has already told Mimi.
get_weekly_summary
ChatGPTShow the user's last 7 days: per-day and total calories/macros consumed, the daily average, and their daily goal. Optionally pass start_date (YYYY-MM-DD local) for a specific week; omit for the trailing 7 days ending today. Days resolve in the user's saved timezone.
get_weight_summary
ChatGPTShow the user's weight progress: current weight, change, trend per week, and projected goal date (when enough data exists). Call this when the user asks how their weight is trending. Needs weight logged via log_weight; trend and projection appear once there are at least 3 days of entries.
list_entries
ChatGPTList the user's logged meals, newest first. Optionally pass from/to (ISO instants) to bound a window — compute local-day boundaries using the timezone from get_user_context. Supports limit (<=100) and offset for paging. Use this to review or find an entry (e.g. before editing or deleting).
list_saved_foods
ChatGPTUse this when you need the user's saved foods, for example to find the saved_food_id for what they just ate. Optionally pass query (loose words are fine, e.g. "home ketchup") to search by name or alias; omit it for the most used foods. Supports limit (<=50).
log_meal
ChatGPTRecord a meal the user ate. Call this whenever the user reports eating or drinking something and you have estimated its macros, without waiting for an explicit "log it" instruction. Pass protein/carbs/fat (grams) and any assumptions. For timing: if the user states when they ate, pass local_time as their wall-clock time (e.g. "2026-07-16T08:00") and the server converts it using their timezone — do not do timezone math yourself. Omit both local_time and logged_at to record it as now. Do not use this to view totals; use get_daily_summary for that.
log_weight
ChatGPTRecord the user's body weight. Pass weight_kg or weight_lb (stored in metric) and an accurate logged_at (the time it was measured, else now). Call this when the user reports weighing themselves.
recommend_macros
ChatGPTCompute suggested daily macro targets from the user's saved profile (weight, and optionally age/sex/height/activity/goal). Returns an estimate — present it to the user and call set_macro_targets once they confirm (or adjust). If it returns need: weight, ask for their weight and goal first. Do not do the math yourself; this tool is the source of truth for the suggestion.
save_food
ChatGPTUse this when the user wants to save a food they eat often (or a nutrition label they photographed) so it can be logged later in one step. Pass per-serving protein/carbs/fat (grams), serving_description (e.g. "1 bar (52 g)"), serving_size and serving_unit (g or ml) when the label gives them, a short name, and source (label, manual, or from_entry). Saving under an existing name replaces that saved food. Pass saved_food_id to update a specific saved food (it may rename it; aliases are added to the existing ones, and omitted fields keep their stored values, so adding a nickname is a one-field call). If it returns possible_duplicate, ask the user whether to update the match or save a new food (allow_duplicate true). Only call this after the user agrees.
set_macro_targets
ChatGPTSave the user's daily macro targets in grams (protein_g, carbs_g, fat_g). Calories are always recomputed from the macros (4/4/9), so any calories_kcal you pass is treated as a cross-check, not stored as-is. Optionally pass effective_from (ISO, defaults to now). Call this when the user sets or changes their goal macros.
set_profile
ChatGPTSave the user's profile: timezone (required, IANA e.g. America/New_York, so daily totals use their local day), and optionally unit preference, age, sex, height, weight, activity level, goal, goal weight, target rate, and standing food preferences. Accepts metric or imperial (height_cm/height_in, weight_kg/weight_lb); values are stored in metric. Call this during onboarding and whenever the user changes any of these.
set_user_preferences
ChatGPTSave the user's standing food preferences (free text, e.g. 'vegetarian, no pork, dislikes cilantro') and/or unit preference (metric/imperial), without needing a full profile. Call this when the user states a lasting preference. These seed future estimates via get_user_context.