Skip to main content
Glama

Calculate the nutrients of a meal

calc_meal
Read-only

Sums nutrients for a meal from TACO food IDs using grams or household measures, and reports totals with lower bounds when nutrient data is missing.

Instructions

Sum nutrients over a list of TACO foods (ids from search_food). Each item has either grams or a household_measure with quantity (e.g. "colher de sopa" x 2, covered foods only; see convert_household_measure). Totals are lower bounds when an item has no data for a nutrient: the response says which. Defaults to energy, protein, fat, carbohydrate, fiber and sodium.

Input Schema

NameRequiredDescriptionDefault
itemsYesFoods in the meal. The same food may appear more than once.
nutrientsNoNutrient keys to total. Omit for energy, protein, fat, carbohydrate, fiber and sodium.

Output Schema

NameRequiredDescriptionDefault
itemsYesThe meal items in the order received.
notesYesCaveats about this answer.
sourceYesCitation for the data.
totalsYesOne entry per requested nutrient, in table order.
completeYesTrue when every requested nutrient has data for every item (no total is a lower bound).
total_gramsYesSum of the item quantities.
household_sourceNoCitation for the household measure weights; set when any item used one.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true; the description adds real behavioral context beyond that: totals are lower bounds when an item lacks nutrient data, and the response flags which items were affected. It also discloses that household measures are only available for curated foods. Return shape details are left to the output schema.

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?

Three sentences, front-loaded with the core action, then input modes, then the caveat about lower bounds and defaults. Dense but every sentence carries information; the parenthetical example is slightly bulky but earns its place by clarifying household measures.

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?

With an output schema present, the description doesn't need to explain return values, and it still covers the one caveat an agent must know (lower-bound totals) plus input prerequisites. Nothing needed to invoke it correctly is missing.

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

Parameters3/5

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

Schema description coverage is 100%, so the per-field docs (grams as edible portion, quantity defaulting to 1, household_measure examples) already carry the detail. The description adds only the either/or rule between grams and household_measure and the default nutrient set, both of which are also stated in the schema. Baseline 3 applies.

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 ('Sum nutrients over a list of TACO foods') and immediately pins the scope: it aggregates over food ids, not looks them up. That distinguishes it cleanly from search_food (which supplies the ids) and get_nutrients (single-food lookup).

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

Usage Guidelines4/5

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

Routes the agent to the two prerequisite tools by name ('ids from search_food', 'see convert_household_measure'), which is exactly the context needed before calling. It stops short of explicit exclusions, e.g. when to use compare_foods or get_nutrients instead of summing a meal.

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