Logging Tools
Save, change and delete the meals, supplements, water and body measurements the user logs.
Each tool saves one entry the way the app saves it. Times are ISO-8601 instants (e.g. 2026-10-16T13:05:00Z) within the last 30 days; omit them for now. The same entry sent again within 10 minutes is treated as a retry and saved once. Tell the user what you saved.
log_meal
A meal or snack. Give at least one number, known or estimated, and tell the user that estimated numbers can be fixed with update_meal.
| Parameter | Notes |
|---|---|
mealLabel | Required. Short name, e.g. "Oatmeal with banana" |
eatenAt | When it was eaten |
kcal, proteinG, carbsG, fatG, fiberG, sugarG, sodiumMg | Nutrients, in kcal, grams and milligrams |
description | Longer description of what was in it |
log_supplement
A supplement or medication dose, e.g. "Magnesium glycinate 400 mg".
| Parameter | Notes |
|---|---|
name | Required. E.g. "Vitamin D3" |
serving | As the user said it, e.g. "2000 IU" or "1 capsule" |
takenAt | When it was taken |
log_water
| Parameter | Notes |
|---|---|
ml | Required. Millilitres (1 fl oz = 29.6 ml) |
takenAt | When |
log_measurement
A body measurement the user took themselves.
| Parameter | Notes |
|---|---|
type | Required. weight, blood_pressure, body_fat (percent) or waist |
value | The reading, for weight, body_fat or waist |
unit | kg or lb for weight; cm or in for waist |
systolic, diastolic | mmHg, for blood_pressure |
measuredAt | When it was measured |
Changing and deleting entries
The user's own entries only: another account's id answers as not found. The AI app asks before running each one. The same change sent again within 10 minutes returns the first answer (duplicate: true) and changes nothing twice.
update_meal
Changes only the fields given; the rest of the meal (items, place, photo) stays. If the meal was changed in the app since it was read, nothing changes and the answer says to read it again. Returns the meal before and after.
| Parameter | Notes |
|---|---|
mealId | Required. From log_meal, or a meal's id in getMeals |
mealLabel, eatenAt, description | New values |
kcal, proteinG, carbsG, fatG, fiberG, sugarG, sodiumMg | New numbers; the others stay |
delete_meal
Deletes the meal and its photo. Parameter: mealId. Returns what was deleted.
update_supplement
For a supplement: name, serving, takenAt or nutrients (which replace the old ones). For a water entry: ml and takenAt. Required: entryId, from log_supplement or log_water, or the id in getSupplementsAndWater. Returns the entry before and after.
delete_supplement
Deletes a supplement or water entry. Parameter: entryId.
delete_measurement
Deletes a weight, blood pressure, body fat or waist reading the user entered. Readings from a scale, watch or other connected device are refused: they are changed in the device's app. To correct a reading, delete it and log the right one. Parameter: entryId from log_measurement.
Permission: log:write

