update_custom_food
Edit a custom food in place to fix typos or wrong nutrients while keeping all logged diary entries attached and updating their nutrition automatically.
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.
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 |