Skip to main content
Glama

Recipe Nutrition Calculator

Calculate nutrition for a whole recipe and per serving

calculate_recipe_nutrition
Read-onlyIdempotent

Parses ingredient lines ("2 cups flour", "1 stick butter" as 8 tbsp, "3 large eggs", "1 lb ground beef"), converts cups, spoons and counted items to grams with USDA household measure weights for that specific food, and sums USDA FoodData Central nutrients. Returns per-line grams and matches, recipe totals, per-serving values, and the per-serving values rounded by the FDA Nutrition Facts rules (21 CFR 101.9) with percent Daily Value. Lines it cannot match are listed, never guessed.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "lines": "<lines>"
    },
    "name": "calculate_recipe_nutrition"
  }
}

Input Schema

NameRequiredDescriptionDefault
linesYesIngredient lines, one per item, amount first: "2 cups all-purpose flour", "1/2 cup butter", "2 large eggs", "200 g chicken breast", "1 tsp salt".
servingsNoNumber of servings the recipe makes. Default 1.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), and the description goes well beyond them: it discloses the conversion methodology (USDA household measure weights per food), the full return payload (per-line grams and matches, totals, per-serving, FDA-rounded with %DV), and crucially the failure behavior — unmatched lines are listed, never guessed. That failure-mode disclosure is exactly the kind of context annotations cannot carry.

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 capability statement is front-loaded and the return-value inventory follows; no filler sentences. The first sentence is very long and packs parsing, conversion, and summation into one clause chain, which costs a little readability.

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?

There is no output schema, and the description compensates fully by enumerating the return fields and the FDA rounding basis. Combined with 100% schema coverage on inputs, an agent has everything needed to call this correctly and interpret results.

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

Parameters4/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; the description adds real meaning by explaining how 'lines' are interpreted (amount first, household units converted to grams via USDA weights) and that 'servings' drives the per-serving outputs. It stops short of stating unit/edge-case rules for the lines array beyond the examples the schema already gives.

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

Purpose4/5

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

Specific verb chain (parses, converts, sums) with a concrete resource (recipe nutrition) and worked examples of the input format, so the agent knows exactly what it does. It never names the sibling tools it overlaps with (lookup_ingredient_nutrition for single items, round_nutrition_label for FDA rounding, scale_recipe_nutrition for rescaling), so differentiation is left to inference.

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

Usage Guidelines3/5

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

Usage is implied by the scope statement (whole recipe, totals plus per-serving), but there is no explicit 'use this when' or 'use X instead' guidance. The mention of FDA rounding hints at overlap with round_nutrition_label without resolving it.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.