Skip to main content
Glama
Wellness Project MCP

Wellness Project MCP

update_meal

Destructive

Update an existing logged meal by correcting or adding foods, macros, drinks, caffeine, time, type, or date, including macro-only enrichment for imported meals without creating duplicates.

Instructions

Update an existing meal. Use only when the current message explicitly changes, corrects, or adds to a meal already logged. Never infer an update from earlier chat history. A plain food statement ("coffee with milk") is a new entry: use log_meal, even if that meal type already exists today.

IMPORTED MEAL ENRICHMENT: for Cronometer, Fitbit/Google Health, FatSecret, Apple Health and Health Connect meals, explicit macro-only corrections are ALLOWED and stored as separate, sync-protected enrichments ON THE SAME IMPORTED MEAL. This includes calories, protein_g, carbs_g, fat_g and alcohol_g through one shared function. User- or AI-estimated values are labeled estimates, never represented as provider measurements. Do NOT call log_meal to create a duplicate. Never replace imported food_items, meal type, date or add/remove foods, fluids or caffeine using this tool; those remain owned by the source app. Omit unchanged macros. A new provider sync must not overwrite the enriched fields.

FIND THE MEAL: call directly, no preliminary list for an ID or additive totals. Use id if known (it is in list_meals output and in the chat history's saved-records note after a log). Otherwise use date (YYYY-MM-DD, defaults to today) plus name and/or target_meal_type to narrow the existing row. target_meal_type finds the current type and is never written; meal_type sets a new type. If the match is not exactly one row, nothing changes. On multiple matches, ask the user which meal they mean; never select a candidate id yourself. Send only fields that change.

THREE MODES: add_saved: add_recipe_name appends recipe food and ADDS its macros to current totals. Match: case-insensitive exact title, then substring; relay no-match/ambiguous errors. Stored recipe macros, including 0, are authoritative; explicit macros replace the recipe's contribution only for a correction or changed food/quantity. Missing recipe macros: estimate only the missing fields from returned food text and retry with the same selector and add_recipe_name. add_unsaved: add_food_items plus the four core macros (calories/protein_g/fat_g/carbs_g) for ONLY the new food; estimate those core values, never ask for them. Text appends; core macros ADD to current totals. alcohol_g: optional, omitted adds nothing. add_both: set add_recipe_name and add_food_items; ordinary core macro fields describe ONLY the unsaved addition. Recipe contributes its stored core macros. correct: both add_* unset; supplied fields REPLACE stored values. Send corrected totals, omit unchanged fields. Changed food_items: the four core macros for the WHOLE corrected meal; list_meals only if needed stored values are unavailable this turn. Additions and explicit value corrections need no pre-read. food_items: when supplied, replaces the description even in add modes. SATURATED FAT / FIBER: expanded nutrients, never required for an update. The estimator or a saved recipe's nutrient panel can fill omitted values, and core-macro updates work without them. 0 is a real value only when known, never a placeholder. ambiguous_add_vs_correct: ask before updating.

ESTIMATE: estimate (same format as log_meal's ESTIMATE section) supplies the nutrient estimate for whatever food this call changes -- the add_unsaved/add_both addition's own food, or, for a mode-3 food_items replacement, the WHOLE corrected meal. Omit to let the server estimate instead; never required.

MEAL TIME: meal_time changes this meal's local HH:MM clock, or null clears an incorrect time. Omit to preserve it. A move_to_date without a new meal_time clears the old clock; supply both together when the original eating time is known.

MOVE TO A DIFFERENT DATE -> move_to_date. "move Tuesday's lunch to Wednesday": date/name/target_meal_type only SELECT which meal to update; they never move it. Set move_to_date to actually change the stored date, keeping the same id.

REMOVE ONE ADDED COMPONENT -> remove_item_name. Only works for a food previously recorded on THIS meal (add_recipe_name, add_food_items, or log_meal's own estimated items). If the meal has no such recorded item, this throws telling you to use mode 3 with corrected totals instead. An estimated item (log_meal's own food, no add_recipe_name/add_food_items involved) carries a name and gram estimate but no recorded calorie/macro split for that one item, so a precise subtraction isn't possible: this throws asking you to also send calories/protein_g/fat_g/carbs_g (the meal's corrected TOTALS after removing it) in the SAME call, which performs the removal and applies those totals together, in that order -- do this rather than a separate correcting call. Removing an item re-estimates the meal's nutrient panel from what remains (its updated food text and items), rather than leaving a stale estimate for food that's gone -- pass estimate here too to supply that re-estimate yourself instead of letting the server do it.

DRINKS / HYDRATION WHEN UPDATING: a food update must not silently erase an already-linked hydration event. For changes unrelated to drinks, omit fluids and the existing hydration is preserved. When ADDING a drink with add_food_items/add_recipe_name, fluids contains only the newly added drink(s) and they are appended to the meal's hydration. When CORRECTING the meal's drinks with both add_* fields omitted, fluids is the complete corrected drink list and replaces the linked hydration only after replacement rows have been safely inserted. If the correction removes every drink, explicitly send fluids: [] and the linked hydration is deleted. Whenever a drink volume is known or reasonably inferable, include it. Drinks only; exclude food moisture.

CAFFEINE / DRINKS WHEN UPDATING: keep the two sidecars explicit in the same update_meal call. fluids is the hydration side and caffeine is the caffeine side; when a drink change affects both, send both. Omit either one when that side is unchanged so existing linked data is preserved. When ADDING caffeinated food/drink with add_food_items/add_recipe_name, caffeine contains only the new dose(s) and they are appended. When CORRECTING the meal's caffeine with both add_* fields omitted, caffeine is the complete corrected dose list and replaces linked caffeine only after replacement rows have been safely inserted. If the correction removes every caffeine dose, explicitly send caffeine: []. Each retained/new dose needs caffeine_mg and may optionally include source_type; its date follows the meal date.

SAVE AS RECIPE: when the user asks to save an already-logged meal as a reusable recipe, set save_as_recipe=true. This may be the only requested action: identify the real meal with id or the normal selectors and do not invent a food or macro edit. A follow-up like "save that as a recipe" after a successful log should use the known meal id plus save_as_recipe=true. Do not tell the user recipes cannot be saved from chat.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "update_meal"
  }
}

Input Schema

NameRequiredDescriptionDefault
idNoMeal ID, if already known. Alternative to date + name/target_meal_type, see FIND THE MEAL above.
dateNoDate the meal was logged. Format: YYYY-MM-DD. Used with name and/or target_meal_type to find the meal when id is omitted; defaults to today if id and date are both omitted. This only SELECTS which meal to update -- see move_to_date below to actually change a meal's stored date.
nameNoSubstring of the food description (case-insensitive) to disambiguate multiple meals on the same date. Only used when id is omitted.
fat_gNoFat (g). See THREE MODES.
fluidsNoOptional drinks consumed in this intake, including liquid ingredients in shakes or smoothies. Omit when no drink amount is known. Hydration is persisted only when the user enabled hydration tracking.
carbs_gNoCarbohydrates (g). See THREE MODES.
fiber_gNoOptional expanded nutrient: dietary fiber (g).
caffeineNoOptional caffeine doses in this intake. Keep each dose simple: caffeine amount is required and type is optional. The dose date follows the intake/meal date. If the user gave exact milligrams, preserve them exactly; otherwise estimate from the described food or drink.
caloriesNoCalories (kcal) never kJ
estimateNoThe compact 3-line nutrient estimate for the food this call adds or the WHOLE corrected meal on a food_items replacement. See ESTIMATE above for the format. Omit to have the server estimate instead -- never blocks the write either way. A block whose parts exceed their whole (saturated fat over fat, fiber over carbs) is discarded and re-estimated. NUTRIENT ID DICTIONARY (id=name, unit is the name's suffix; ug=mcg). Every id means exactly this nutrient, never guess the order: undefined
alcohol_gNoAlcohol (g). See THREE MODES.
meal_timeNoLocal HH:MM in 24-hour time for when this meal was eaten. Set to correct a timestamp; explicit null clears it. See MEAL TIME above.
meal_typeNoUpdated meal type to WRITE onto the meal (e.g. reclassify a Snack as Dinner), only when the user asks to change the type. A "For my breakfast:"-style label at the start of the message is the pill the user had open, not a request to change it. Optional, omit if not changing. Never inferred from add_recipe_name. Distinct from target_meal_type above, which FINDS a meal by its current type and is never written.
protein_gNoProtein (g). See THREE MODES.
food_itemsNoReplacement food description; omit to preserve or append. See THREE MODES.
user_statedNoWhich of fiber_g and saturated_fat_g the user said themselves; list a field only when the user stated the number, never for your own estimate.
move_to_dateNoMove this meal to a different date. Format: YYYY-MM-DD. Distinct from date above, which only finds the meal; this is what actually changes it, keeping the same id. Optional, omit if not moving the meal.
add_food_itemsNoUnsaved food description to add; omit unless adding unsaved food. See THREE MODES.
recipe_fiber_gNoOptional recipe-component fiber (g) for add_both.
save_as_recipeNoTrue only when the user explicitly asks to save this meal as a reusable recipe. The recipe is copied from the final persisted meal. On update_meal, this can be the only requested action; use the real meal id or normal selectors and do not invent an edit.
add_recipe_nameNoSaved recipe name or close phrase to add; omit unless adding saved food. See THREE MODES.
saturated_fat_gNoOptional expanded nutrient: saturated fat (g).
remove_item_nameNoName or substring of a previously-recorded item to remove from this meal (see REMOVE ONE ADDED COMPONENT above). Normally exclusive of every other field below -- only id/date/name/target_meal_type may accompany it, to select the meal, plus optionally estimate for the remaining meal -- EXCEPT when the tool has already refused this exact removal asking for corrected totals: then also send calories/protein_g/fat_g/carbs_g together with remove_item_name in the retry.
target_meal_typeNoWhich meal type to FIND on the date, e.g. Breakfast, to disambiguate multiple meals logged that day -- "update today's breakfast" is target_meal_type: "Breakfast". Case-insensitive, only used when id is omitted. This is NEVER written to the meal; it only narrows the search, exactly like name above. Distinct from meal_type below, which SETS the new type to write. If no meal of this type is logged on the date, the call throws naming the meal types that ARE logged that day and changes nothing -- it never falls back to whichever meal the date happens to match.
recipe_saturated_fat_gNoOptional recipe-component saturated fat (g) for add_both.

Output Schema

NameRequiredDescriptionDefault
resultYesHuman-readable result text returned by the tool.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed28 schema fields changedv1.3.0
    • changedInput schema / properties / add_food_items / description
      Previous value: -"Optional. Description of food to ADD to this meal that ISN'T a saved recipe, e.g. \"a banana\", \"small coffee with cream\" (see ADD FOOD THAT WASN'T SAVED above). Requires calories/protein_g/fat_g/carbs_g to be set to the estimated macros of just this new food -- never the meal's new total. Appends this text onto the meal's existing food_items and adds the macro fields onto the meal's current values; never use this to replace a meal outright (omit it and pass food_items/calories/etc. directly for that). Mutually exclusive with add_recipe_name -- never set both; if adding a saved recipe and separate ad-hoc food, make two calls."New value: +"Unsaved food description to add; omit unless adding unsaved food. See THREE MODES."
    • changedInput schema / properties / add_recipe_name / description
      Previous value: -"Optional. Name (or a close phrase) of one of the user's saved recipes to FOLD INTO this meal, e.g. \"kombucha\", \"protein shake\" (see FOLD IN A SAVED RECIPE above). Adds the recipe's food text and macros onto the meal's current values; never use this to replace a meal outright (omit it and pass food_items/calories/etc. directly for that). Distinct from log_meal's recipe_name, which SETS a new meal's fields instead of adding to one that already exists. Mutually exclusive with add_food_items -- never set both."New value: +"Saved recipe name or close phrase to add; omit unless adding saved food. See THREE MODES."
    • changedInput schema / properties / alcohol_g / description
      Previous value: -"Updated alcohol in grams. Same REPLACE-vs-ADD rule as calories above, except this one stays optional even with add_recipe_name or add_food_items set: omitting it just adds nothing."New value: +"Alcohol (g). See THREE MODES."
    • addedInput schema / properties / caffeine
      Added value: +{
      +  "description": "Optional caffeine doses in this intake. Keep each dose simple: caffeine amount is required and type is optional. The dose date follows the intake/meal date. If the user gave exact milligrams, preserve them exactly; otherwise estimate from the described food or drink.",
      +  "items": {
      +    "properties": {
      +      "caffeine_mg": {
      +        "description": "Caffeine in milligrams. Preserve an explicit user amount exactly; otherwise estimate from the described intake.",
      +        "type": "number"
      +      },
      +      "source_type": {
      +        "description": "Optional broad caffeine type.",
      +        "enum": [
      +          "coffee",
      +          "espresso",
      +          "tea",
      +          "energy_drink",
      +          "soda",
      +          "pre_workout",
      +          "supplement",
      +          "other"
      +        ],
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "caffeine_mg"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
    • changedInput schema / properties / calories / description
      Previous value: -"Updated total calories (kcal). Optional, omit if not changing (or, with add_recipe_name, if the recipe already has a stored value). REPLACES the current value unless add_recipe_name or add_food_items is also set, in which case this is the AMOUNT BEING ADDED (the new food's own calories, not the meal's new total), added onto the meal's current value. Required whenever add_food_items is set, since there is no saved recipe to fall back on."New value: +"Calories (kcal) never kJ"
    • changedInput schema / properties / carbs_g / description
      Previous value: -"Updated carbohydrates in grams. Same REPLACE-vs-ADD rule as calories above, including required-with-add_food_items."New value: +"Carbohydrates (g). See THREE MODES."
    • changedInput schema / properties / date / description
      Previous value: -"Date the meal was logged. Format: YYYY-MM-DD. Used with name and/or target_meal_type to find the meal when id is omitted; defaults to today if id and date are both omitted."New value: +"Date the meal was logged. Format: YYYY-MM-DD. Used with name and/or target_meal_type to find the meal when id is omitted; defaults to today if id and date are both omitted. This only SELECTS which meal to update -- see move_to_date below to actually change a meal's stored date."
    • addedInput schema / properties / estimate
      Added value: +{
      +  "description": "The compact 3-line nutrient estimate for the food this call adds or the WHOLE corrected meal on a food_items replacement. See ESTIMATE above for the format. Omit to have the server estimate instead -- never blocks the write either way. A block whose parts exceed their whole (saturated fat over fat, fiber over carbs) is discarded and re-estimated.\n\nNUTRIENT ID DICTIONARY (id=name, unit is the name's suffix; ug=mcg). Every id means exactly this nutrient, never guess the order:\nundefined",
      +  "type": "string"
      +}
    • changedInput schema / properties / fat_g / description
      Previous value: -"Updated fat in grams. Same REPLACE-vs-ADD rule as calories above, including required-with-add_food_items."New value: +"Fat (g). See THREE MODES."
    • addedInput schema / properties / fiber_g
      Added value: +{
      +  "description": "Optional expanded nutrient: dietary fiber (g).",
      +  "type": "number"
      +}
    • changedInput schema / properties / fluids / description
      Previous value: -"Optional drinks consumed in this intake. Omit when no drink amount is known. Hydration is persisted only when the user enabled hydration tracking."New value: +"Optional drinks consumed in this intake, including liquid ingredients in shakes or smoothies. Omit when no drink amount is known. Hydration is persisted only when the user enabled hydration tracking."
    • changedInput schema / properties / fluids / items / properties / beverage_type / description
      Previous value: -"Broad drink type. Default water. Use other when the exact drink is not in the enum and preserve its name in beverage_name."New value: +"Broad drink type. Default water. Energy drinks are accepted and stored as other; preserve the exact drink in beverage_name."
    • changedInput schema / properties / fluids / items / properties / beverage_type / enum
      Previous value: -[
      -  "water",
      -  "electrolyte",
      -  "sports_drink",
      -  "coffee",
      -  "tea",
      -  "juice",
      -  "milk",
      -  "soda",
      -  "broth",
      -  "other"
      -]New value: +[
      +  "water",
      +  "electrolyte",
      +  "sports_drink",
      +  "coffee",
      +  "tea",
      +  "juice",
      +  "milk",
      +  "soda",
      +  "broth",
      +  "other",
      +  "energy_drink"
      +]
    • removedInput schema / properties / fluids / items / properties / unit
      Removed value: -{
      -  "description": "Volume unit. Default ml.",
      -  "enum": [
      -    "ml",
      -    "fl_oz"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / fluids / items / properties / volume
      Removed value: -{
      -  "description": "Consumed drink volume in the supplied unit.",
      -  "type": "number"
      -}
    • addedInput schema / properties / fluids / items / properties / volume_ml
      Added value: +{
      +  "description": "Millilitres. Convert any other unit first.",
      +  "type": "number"
      +}
    • changedInput schema / properties / fluids / items / required
      Previous value: -[
      -  "volume"
      -]New value: +[
      +  "volume_ml"
      +]
    • changedInput schema / properties / food_items / description
      Previous value: -"Updated food description. Optional, omit if not changing. With add_recipe_name and add_food_items both omitted, this REPLACES the current description outright. With either one present and this omitted, the new food's text (the recipe's stored food_items, or add_food_items itself) is appended instead. Passing this alongside add_recipe_name/add_food_items overrides the append with this exact text."New value: +"Replacement food description; omit to preserve or append. See THREE MODES."
    • addedInput schema / properties / meal_time
      Added value: +{
      +  "description": "Local HH:MM in 24-hour time for when this meal was eaten. Set to correct a timestamp; explicit null clears it. See MEAL TIME above.",
      +  "nullMeansClear": true,
      +  "type": "string"
      +}
    • changedInput schema / properties / meal_type / description
      Previous value: -"Updated meal type to WRITE onto the meal (e.g. reclassify a Snack as Dinner). Optional, omit if not changing. Never inferred from add_recipe_name. Distinct from target_meal_type above, which FINDS a meal by its current type and is never written."New value: +"Updated meal type to WRITE onto the meal (e.g. reclassify a Snack as Dinner), only when the user asks to change the type. A \"For my breakfast:\"-style label at the start of the message is the pill the user had open, not a request to change it. Optional, omit if not changing. Never inferred from add_recipe_name. Distinct from target_meal_type above, which FINDS a meal by its current type and is never written."
    • addedInput schema / properties / move_to_date
      Added value: +{
      +  "description": "Move this meal to a different date. Format: YYYY-MM-DD. Distinct from date above, which only finds the meal; this is what actually changes it, keeping the same id. Optional, omit if not moving the meal.",
      +  "type": "string"
      +}
    • changedInput schema / properties / protein_g / description
      Previous value: -"Updated protein in grams. Same REPLACE-vs-ADD rule as calories above, including required-with-add_food_items."New value: +"Protein (g). See THREE MODES."
    • addedInput schema / properties / recipe_fiber_g
      Added value: +{
      +  "description": "Optional recipe-component fiber (g) for add_both.",
      +  "type": "number"
      +}
    • addedInput schema / properties / recipe_saturated_fat_g
      Added value: +{
      +  "description": "Optional recipe-component saturated fat (g) for add_both.",
      +  "type": "number"
      +}
    • addedInput schema / properties / remove_item_name
      Added value: +{
      +  "description": "Name or substring of a previously-recorded item to remove from this meal (see REMOVE ONE ADDED COMPONENT above). Normally exclusive of every other field below -- only id/date/name/target_meal_type may accompany it, to select the meal, plus optionally estimate for the remaining meal -- EXCEPT when the tool has already refused this exact removal asking for corrected totals: then also send calories/protein_g/fat_g/carbs_g together with remove_item_name in the retry.",
      +  "type": "string"
      +}
    • addedInput schema / properties / saturated_fat_g
      Added value: +{
      +  "description": "Optional expanded nutrient: saturated fat (g).",
      +  "type": "number"
      +}
    • addedInput schema / properties / save_as_recipe
      Added value: +{
      +  "description": "True only when the user explicitly asks to save this meal as a reusable recipe. The recipe is copied from the final persisted meal. On update_meal, this can be the only requested action; use the real meal id or normal selectors and do not invent an edit.",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / user_stated
      Added value: +{
      +  "description": "Which of fiber_g and saturated_fat_g the user said themselves; list a field only when the user stated the number, never for your own estimate.",
      +  "items": {
      +    "enum": [
      +      "fiber_g",
      +      "saturated_fat_g"
      +    ],
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  2. First observedv1.2.1

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations only declare destructiveHint=true and idempotentHint=false; the description goes well beyond that with non-obvious behavior: multi-match changes nothing and requires asking the user, corrections replace while add modes append, hydration replacement happens only after new rows are safely inserted, provider syncs must not overwrite enrichments, and several failure paths throw with specific remediation. It also discloses ordering semantics (remove_item_name plus corrected totals applied together, removal first).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Strongly front-loaded and organized under clear headers (IMPORTED MEAL ENRICHMENT, FIND THE MEAL, THREE MODES, DRINKS, CAFFEINE), so it is navigable despite its length. However it runs to roughly a thousand words, and the hydration and caffeine sections restate the same append/replace/empty-list pattern twice, plus the removal paragraph is a dense run-on. Several sentences could be compressed without losing guidance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 25-parameter destructive tool with four behavioral modes, this covers the selector-vs-write distinction, mode selection, nutrient estimation fallbacks, sidecar preservation, recipe saving, and the refusal-then-retry path for item removal. An output schema exists, so return values need not be explained, and nothing material for correct invocation appears missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema: the target_meal_type vs meal_type distinction (find vs write), add_saved vs add_unsaved vs add_both vs correct field combinations, omit-unchanged semantics, fluids as hydration vs caffeine as the separate sidecar with explicit [] to delete, and the remove_item_name exclusivity rule with its single documented exception. These are interaction rules the schema alone cannot express.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Opens with a specific verb+resource ("Update an existing meal") and immediately contrasts it with the sibling that an agent would otherwise confuse it with: a plain food statement is a new entry and belongs in log_meal. The three modes (add_saved, add_unsaved/add_both, correct) define the scope of "update" precisely rather than leaving it as a generic patch.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit when/when-not and named alternatives throughout: "Never infer an update from earlier chat history", "Do NOT call log_meal to create a duplicate", "call directly, no preliminary list", "list_meals only if needed stored values are unavailable this turn", and "ambiguous_add_vs_correct: ask before updating". The imported-meal section also carves out what this tool may never change (food_items, meal type, date, added foods/fluids/caffeine for imported meals), which is exactly the exclusion guidance an agent needs.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.