Skip to main content
Glama
Canada's Food Guide MCP Server

Canada's Food Guide MCP Server

Calculate Recipe Nutrition Summary

calculate_recipe_nutrition_summary

Analyze recipe ingredient unit compatibility with CNF nutrition data, populate temporary macro records, and flag conversions needing manual review before calculating recipe nutrition.

Instructions

Analyze unit matching for recipe ingredients and populate temp_recipe_macros table.

This tool performs unit matching analysis between recipe ingredients and CNF nutrition data, identifying which conversions are possible and which need manual LLM decisions. It populates the temp_recipe_macros table with detailed unit matching information for LLM review.

NEW BEHAVIOR (Unit Matching Analysis):

  • Analyzes each ingredient's unit compatibility with available CNF serving sizes

  • Identifies exact matches, possible conversions, and manual decision needs

  • Populates temp_recipe_macros with unit matching status and recommendations

  • Returns analysis summary for LLM to make conversion decisions

Use this tool to:

  • Set up unit matching analysis for recipe nutrition calculations

  • Identify which ingredients need manual conversion decisions

  • Prepare data for LLM-driven nutrition calculations

  • Get transparent view of unit conversion challenges

The tool requires that ingredients have been previously linked to CNF data using get_cnf_macronutrients_only or bulk_get_cnf_macronutrients. After running this tool, review the temp_recipe_macros table and use simple_math_calculator for final calculations.

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": {
      "input_data": "<input_data>"
    },
    "name": "calculate_recipe_nutrition_summary"
  }
}

Input Schema

NameRequiredDescriptionDefault
input_dataYesContains session_id (data location) and recipe_id (target recipe identifier)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does disclose the key behavior: this is a write operation that populates/overwrites the temp_recipe_macros table, and it deliberately stops short of final math. It also discloses required upstream state. It omits whether repeated runs overwrite existing temp rows, what happens when CNF links are missing, and any session-lifetime concerns for the temp data.

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

Conciseness2/5

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

The same facts are stated three times: the opening paragraph, the 'NEW BEHAVIOR' bullet list, and the 'Use this tool to' bullet list all repeat that it analyzes unit compatibility and populates temp_recipe_macros. Framing like 'NEW BEHAVIOR' and 'Get transparent view of unit conversion challenges' adds no actionable information. The first sentence is front-loaded, but roughly half the text is redundant.

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 two-field write tool with an output schema (so return values need no explanation), the description covers preconditions, side effects on the temp table, and the required downstream step. Combined with a nested-object schema, an agent has enough to invoke it correctly. The remaining gap is error and re-run semantics for the temp table.

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 both nested fields (recipe_id, session_id) are documented in the schema itself, so the baseline is 3. The description adds no syntax, format, or validation meaning beyond noting that the session holds recipe and CNF data. It also never names the parameters directly, leaving the schema to do all the work.

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?

The description states a concrete verb+resource: it analyzes unit compatibility between recipe ingredients and CNF serving sizes and populates temp_recipe_macros. It explicitly defines scope against siblings by naming the prerequisite tools (get_cnf_macronutrients_only, bulk_get_cnf_macronutrients) and the follow-on tool (simple_math_calculator). The only blemish is that the name/title 'Calculate Recipe Nutrition Summary' implies final calculation, which the description then disclaims.

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?

It provides an explicit 'Use this tool to:' list plus a stated precondition (ingredients must already be linked to CNF data) and a post-step (review temp_recipe_macros, then use simple_math_calculator). This is clear activation guidance. It stops short of 5 because there is no explicit 'do not use this when...' exclusion, and the misleading tool name could send an agent here for final macro calculations.

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