Skip to main content
Glama
turnnoblindeye

Wellness Project MCP

update_meal

DestructiveIdempotent

Update an existing meal by adding saved or new foods, correcting calories/macros, or adjusting drinks. Finds the exact meal to change and preserves unrelated data.

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.

FIND THE MEAL: use id if known. 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. Picking the wrong one corrupts the meal.

  1. ADD SAVED FOOD -> add_recipe_name. "add my usual kombucha to breakfast", "add the protein shake I saved to lunch". Do NOT use log_meal for this, that logs a second, separate meal. Additive: the recipe's food text is appended to the meal's existing food_items and each of its macros is ADDED to the meal's current value for that field, so the result is both foods together with both foods' calories, not a replacement. Matched the same way as log_meal's recipe_name (case-insensitive exact title, then substring); no match or more than one substring match throws an error naming the candidates or the user's saved titles instead of guessing. If the matched recipe has no stored value for one of calories/protein_g/fat_g/carbs_g, this throws carrying the recipe's food text: estimate just the missing field(s) and call again with the same id (or date+name) and add_recipe_name plus those field(s) set explicitly. An explicit field passed alongside add_recipe_name takes the recipe's place for that one field and is still ADDED to the meal; it does not overwrite the meal's total the way it does without add_recipe_name.

  2. ADD UNSAVED FOOD -> add_food_items. "add a banana to my breakfast", "I also had a small coffee", where the extra food is not one of the user's saved recipes. Pass the new food's own description plus calories/protein_g/fat_g/carbs_g estimated for JUST that new food, not the meal's new total and not the existing food's macros. All four are required whenever add_food_items is set (there is no recipe to fall back on): estimate them from the description, never ask the user. Additive exactly like add_recipe_name: add_food_items is appended to the existing food_items (unless food_items is ALSO passed explicitly, which replaces the description outright instead of appending) and each macro is ADDED to the meal's current value; alcohol_g is optional and adds nothing when omitted. add_food_items and add_recipe_name are mutually exclusive: never set both in the same call. Adding both a saved recipe and separate ad-hoc food means two update_meal calls, one per addition.

  3. CORRECT A VALUE -> plain fields, both add_* unset. "that was 400 calories, not 600", "actually it was just eggs, no toast", "make it 500 calories": the meal's stored total needs to become a specific NEW number, not grow. Each of food_items/calories/protein_g/fat_g/carbs_g/alcohol_g you pass REPLACES the meal's current value for that field outright, so send the corrected TOTAL for that field, never an amount to add.

Reaching for mode 3 when the meal is GROWING is the exact bug this tool used to have: it silently REPLACES the whole meal with just the new food and throws away what was already logged.

If add-vs-correct intent is ambiguous, ask before updating.

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.

Input Schema

TableJSON 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.
nameNoSubstring of the food description (case-insensitive) to disambiguate multiple meals on the same date. Only used when id is omitted.
fat_gNoUpdated fat in grams. Same REPLACE-vs-ADD rule as calories above, including required-with-add_food_items.
fluidsNoOptional drinks consumed in this intake. Omit when no drink amount is known. Hydration is persisted only when the user enabled hydration tracking.
carbs_gNoUpdated carbohydrates in grams. Same REPLACE-vs-ADD rule as calories above, including required-with-add_food_items.
caloriesNoUpdated 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.
alcohol_gNoUpdated 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.
meal_typeNoUpdated 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.
protein_gNoUpdated protein in grams. Same REPLACE-vs-ADD rule as calories above, including required-with-add_food_items.
food_itemsNoUpdated 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.
add_food_itemsNoOptional. 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.
add_recipe_nameNoOptional. 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.
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.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYesHuman-readable result text returned by the tool.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.2.1

TDQS

A4.1/5.0
Behavior1/5

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

The description is rich in behavioral detail, covering replace-vs-add semantics, hydration deletion, matching errors, and the historical silent-replace bug. However, it directly contradicts the idempotentHint=true annotation: add_recipe_name and add_food_items 'ADD' macros to the meal's current value, so retrying the same call would append the food again and produce a different result. This is an annotation contradiction.

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

Conciseness4/5

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

The description is long but well organized with labeled sections and front-loaded sibling differentiation. Some parameter details are restated from the schema, but the length is justified by the high complexity of three interacting modes and a 14-parameter surface.

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 14-parameter mutation tool with zero required parameters, this description is unusually complete: locating the meal, all three modes, mutual exclusions, ambiguity handling, hydration side effects, error behavior, and defaults are all covered. An output schema exists, so return-value documentation is unnecessary.

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 description coverage is 100%, and the description still adds substantial meaning: it explains the interaction between add_* and plain fields, the required-with-add_food_items rule, target_meal_type never being written while meal_type is, matching/error behavior, and hydration fluid semantics. This goes far beyond the schema and materially improves correct invocation.

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?

States a specific verb and resource: 'Update an existing meal', and immediately differentiates from log_meal by requiring the current message to explicitly change, correct, or add to an already logged meal. The boundary is unambiguous: a plain food statement is a new entry and should use log_meal.

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?

Gives explicit when-to-use guidance ('Use only when the current message explicitly changes, corrects, or adds to a meal already logged') and when not to ('A plain food statement... use log_meal'). It also routes within the tool across the three modes and instructs the agent to ask when add-vs-correct intent is ambiguous.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/turnnoblindeye/wellness-project-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server