Skip to main content
Glama

Calculate recipe nutrition

calculate_recipe_nutrition
Read-onlyIdempotent

Calculate a recipe's nutrition totals, per serving, and per 100 g from food numbers and gram amounts. Get clear meal breakdowns for any recipe.

Instructions

Calculate the nutrition of a recipe or meal from food numbers and gram amounts. Returns totals, per serving and per 100 g. Uses the stored values as-is: if you pass raw ingredients, cooking losses are not modelled.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesIngredients as food number + grams.
languageNoLanguage for food and nutrient names: 'en' (English) or 'sv' (Swedish). Defaults to the server setting.
servingsNoNumber of servings the recipe makes.
nutrientsNoNutrients to include, by code (e.g. 'PROT', 'ENERC_KCAL', 'VITD') or name fragment (e.g. 'iron', 'vitamin b'). Omit for the default set.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

The annotations already indicate a safe, read-only, idempotent operation. The description adds meaningful behavioral context beyond that: results are computed from stored values as-is, and cooking losses are not modelled when raw ingredients are passed. This is exactly the kind of caveat that helps an agent reason about correctness.

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

Conciseness5/5

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

Three sentences with no redundancy. The first sentence states the main purpose and input, the second the return structure, and the third an important limitation. All information is front-loaded and earns its place.

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

Completeness4/5

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

For a read-only calculation tool with a fully described schema, the description covers the essentials: purpose, input format, output shape, and a key modelling limitation. Since there is no output schema, the explicit mention of returned totals, per-serving, and per-100g values is valuable. It could be slightly more explicit about how servings affect results, but overall it is complete.

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?

All four parameters are fully described in the schema, so the baseline is 3. The description adds general context about food numbers and gram amounts but does not need to repeat parameter-level details. It does not meaningfully enhance the schema's parameter documentation.

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?

The description uses a specific verb ('calculate'), names the resource ('nutrition of a recipe or meal'), and specifies the input type ('food numbers and gram amounts'). It also states the output forms (totals, per serving, per 100 g), which clearly separates it from food-search siblings.

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?

The description gives clear context for when to use the tool: when calculating recipe/meal nutrition from food numbers and gram amounts. However, it does not explicitly contrast it with siblings such as get_food or compare_foods, so the guidance is clear but lacks explicit exclusions or alternatives.

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