Skip to main content
Glama

Recipe Nutrition Calculator

Round values for an FDA Nutrition Facts label

round_nutrition_label
Read-onlyIdempotent

Applies the FDA Nutrition Facts rounding rules from 21 CFR 101.9(c) to unrounded per-serving values: calories (under 5 = 0, nearest 5 up to 50, nearest 10 above), fat and saturated fat (nearest 0.5 g under 5 g), sodium (nearest 5 mg up to 140 mg, nearest 10 above), carbohydrate, fiber, sugars, added sugars and protein (nearest gram, "less than 1g" rules). Adds percent Daily Value from the 2,000-calorie DRVs (fat 78 g, saturated fat 20 g, sodium 2,300 mg, carbohydrate 275 g, fiber 28 g, added sugars 50 g). Rules copied from the eCFR text.

Input Schema

NameRequiredDescriptionDefault
kcalYesCalories per serving, unrounded.
fat_gNoTotal fat, g per serving.
carbs_gNoTotal carbohydrate, g per serving.
fiber_gNoDietary fiber, g per serving.
sugars_gNoTotal sugars, g per serving.
protein_gNoProtein, g per serving.
sat_fat_gNoSaturated fat, g per serving.
sodium_mgNoSodium, mg per serving.
added_sugars_gNoAdded sugars, g per serving.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive, and closed-world behavior, so the bar is lower. The description still adds real substance: the exact rounding tiers per nutrient, the added-sugars/fiber 'less than 1g' handling, and the specific DRV values used for percent Daily Value — all beyond what annotations provide.

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?

A single dense paragraph that front-loads the governing regulation and then enumerates rule groups efficiently; nothing is filler. The nested parentheticals make it slightly harder to scan, keeping it just below a 5.

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 pure computation tool with no output schema, the description should hint at the return shape; it names what is produced (rounded values plus percent Daily Value) and implies some outputs may be strings via the 'less than 1g' rule, but never enumerates output fields. That is a minor gap, not a blocking one.

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 coverage is 100% and every parameter already carries a description with units and bounds, so the baseline is 3. The description adds meaning by mapping nutrients to their specific rounding treatment (e.g., sodium rounds to 5 mg up to 140 mg, then 10), which is useful but partially redundant with the schema's unit labels.

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 — applies FDA Nutrition Facts rounding rules from 21 CFR 101.9(c) — to explicitly scoped inputs (unrounded per-serving values). This is clearly distinct from the sibling tools that calculate, look up, or scale nutrition; nothing overlaps.

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 phrase 'to unrounded per-serving values' tells the agent the required input state, which implicitly positions this tool as the step after calculate_recipe_nutrition. It does not, however, explicitly name a sibling or state when not to use it, so it stops short of a 5.

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.