add_food_entry
Log a food item to your Cronometer diary by specifying food ID, measure ID, and gram weight. Automatically assigns to the correct meal based on your account settings.
Instructions
Add a food entry to the Cronometer diary.
Use search_foods to find food_id and measure_id, then get_food_details to confirm serving sizes and gram weights.
Args: food_id: Numeric food ID from search_foods results. measure_id: Measure/unit ID from get_food_details. grams: Weight of the serving in grams. date: Date to log as YYYY-MM-DD (defaults to today). translation_id: Translation ID from search results (usually 0). diary_group: LEAVE THIS AS "auto" unless the user explicitly named a meal. Do NOT infer it yourself from the time -- you do not know the user's timezone or which meals their account has, and guessing "snacks" at 11pm has repeatedly filed food under Morning Snacks. On "auto" the server reads the user's local clock and their own configured meals and picks correctly.
Only pass a value when the user said one, e.g. "add it to
lunch". Matching is case-insensitive on a substring of
the account's real meal names; the error lists them.The response includes a logged_to block naming the meal it chose, the local time, and the timezone. Tell the user which meal it went to -- that is how a misfiled entry gets caught immediately rather than days later.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | ||
| grams | Yes | ||
| food_id | Yes | ||
| measure_id | Yes | ||
| diary_group | No | auto | |
| translation_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |