add_food_entry
Log a food serving to the user's FatSecret diary by providing food ID, serving ID, number of units, and meal; optionally set the entry date.
Instructions
Add a food entry to the user's food diary. Use search_foods to find food_id and get_food to find the correct serving_id. Requires OAuth 1.0 user credentials AND Diary Read/Write API access (contact FatSecret support to enable).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"food_id": "<food_id>",
"serving_id": "<serving_id>",
"number_of_units": "<number_of_units>",
"meal": "<meal>"
},
"name": "add_food_entry"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Date for the entry (YYYY-MM-DD). Defaults to today. | |
| meal | Yes | Which meal to log this food under | |
| food_id | Yes | FatSecret food ID (from search_foods) | |
| serving_id | Yes | Serving size ID (from get_food). Use the serving_id field of the desired serving. | |
| food_entry_name | No | Custom name for the diary entry (optional, defaults to food name) | |
| number_of_units | Yes | Number of servings consumed (e.g. 1 or 2.5) |