Log a custom food
add_custom_itemLog a food missing from the catalog by name and nutrition for the whole amount eaten; returns its row_id. Estimate protein, fat and carbs when only kcal is given.
Instructions
Log a food that is not in the catalog, by name and the nutrition of the whole amount eaten; returns its row_id. Each call adds a row unless row_id is reused. When the user gives only kcal, estimate protein_g, fat_g and carbohydrate_g for that food and tell the user they are estimates; an omitted one counts as 0 g.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | Day as YYYY-MM-DD; when the user says today, yesterday, this week or a weekday, call get_today and count from its date. | |
| meal | Yes | Meal slot. The keys are fixed, but users rename their meals in the app: match the user's words against get_day's meal_name and pass that meal's meal_key. Only the meals get_day lists exist. | |
| name | Yes | What it was, e.g. 'Kanapka z serem'. | |
| eaten | No | true when the user ate or drank it or just asks to log it; false (the default) only when they plan ahead. | |
| fat_g | No | Fat in grams. | |
| row_id | No | Optional UUID version 1 for the new row; omit it to get a new id. Repeating the add with the same row_id and values does not log a second row: when a failed add's error has a retry_row_id, repeat it with that row_id. Never a row_id from get_day: update_item changes a logged row's quantity and eaten; to change anything else, remove the row and add it again. | |
| protein_g | No | Protein in grams. | |
| energy_kcal | Yes | Energy in kcal. | |
| carbohydrate_g | No | Carbohydrate in grams. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| data | No | ||
| error | No | describe_error() of what went wrong; docs/AGENTS.md, Results and errors. |