update_custom_food
Fix a custom food without re-logging: edit its name, notes, nutrients, or serving measures in place while existing diary entries stay attached.
Instructions
Edit one of your custom foods in place, keeping its diary entries.
Only what you pass changes. Entries already logged stay attached to this same food and their nutrition follows the edit, so a typo or a wrong nutrient can be fixed without re-logging anything.
Nutrients are merged into the existing profile, so correcting one value leaves the rest alone. Call list_nutrients for the accepted names.
Amounts are for one serving, the same basis get_food_details reports and
returns as serving_grams. That is the food's default measure, which is
not always 100 g: a juice measured in millilitres takes per-millilitre
values. Read the food first and the two always agree.
Args: food_id: The custom food to edit. name: New name. notes: New note text. nutrients: Nutrient name to amount per serving, merged in. measures: [{"measure_id": int, "name": str, "grams": float}] to fix a wrongly weighted measure. name and grams are each optional. Leave measure_id out to ADD a serving size instead, giving name and grams: that is how a food gets a per-piece measure such as "1 karkki" or "1 viipale" alongside plain grams, so it can be logged by the count as well as by weight.
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>"
},
"name": "update_custom_food"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| notes | No | ||
| food_id | Yes | ||
| measures | No | ||
| nutrients | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |