update_custom_food
Edit an existing custom food you created by changing only the nutrients, serving details, or barcodes you provide; diary entries using it adopt the updated values.
Instructions
Edit an existing custom food (one you created) in place.
Only the arguments you pass change; everything else keeps its current value. Find the food_id with search_foods (source "Custom") or get_food_details. Diary entries that already use the food pick up the new values. Recipes cannot be edited with this tool, even though they also show as source "Custom".
Nutrient amounts are per serving: the food's default serving, or serving_grams when you pass it. To change the serving weight without re-entering nutrition, pass serving_grams alone; the stored per-100g values stay put, so the per-serving numbers scale with the new weight.
Args: food_id: ID of the custom food to edit. name: New food name. calories: Calories per serving (kcal). protein_g: Protein per serving (g). fat_g: Fat per serving (g). carbs_g: Carbs per serving (g). fiber_g: Fiber per serving (g). sugar_g: Sugar per serving (g). sodium_mg: Sodium per serving (mg). saturated_fat_g: Saturated fat per serving (g). extra_nutrients: Additional nutrients keyed by Cronometer nutrient ID (from get_daily_nutrition) and valued per serving; must not reuse an ID the named args already cover. serving_name: New name for the default serving. The app shows the serving as " "; a leading number ("2 cookies") is taken as the quantity (see serving_quantity). serving_grams: New total weight of the default serving in grams. Also resets the quantity to serving_quantity (or 1). serving_quantity: How many units make up the default serving (default 1 whenever serving_grams is passed). Without serving_grams the serving's total weight stays the same, so each unit gets lighter or heavier: changing "2 cookies = 30 g" to 3 gives "3 cookies = 30 g". To keep the per-unit weight, also pass serving_grams (45 here). Check the result with get_food_details, which lists each measure's quantity. barcodes: Replaces the food's barcodes (see add_custom_food for the accepted formats); pass [] to remove them all. To add one, pass the current barcodes from get_food_details plus the new one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| fat_g | No | ||
| carbs_g | No | ||
| fiber_g | No | ||
| food_id | Yes | ||
| sugar_g | No | ||
| barcodes | No | ||
| calories | No | ||
| protein_g | No | ||
| sodium_mg | No | ||
| serving_name | No | ||
| serving_grams | No | ||
| extra_nutrients | No | ||
| saturated_fat_g | No | ||
| serving_quantity | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |