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

Canada's Food Guide MCP Server

🍲 Canada's Food Guide: CLI and MCP server

Python 3.12+ License: MIT MCP

foodguide demo

foodguide is a command-line tool and an MCP server. It gives you Canada's Food Guide data:

  • nutrients for any food in the Canadian Nutrient File (CNF) 2026,

  • the 141 Food Guide recipes,

  • Dietary Reference Intake (DRI) macronutrient tables,

  • Estimated Energy Requirement (EER) equations.

All data sits in local files. At run time the tool makes no network calls. You fetch or build the data once, then work offline.

Version 3.0.0. See CHANGELOG.md for what changed.

See it in action

Watch the trailer on YouTube. Each example below jumps to its part of the video.

Example

Video

Find themed recipes for a week

themed-recipe-spedup

Suggest recipes from an image of your groceries

from-image-to-show-recipes-spedup

Calculate your estimated macros intake and energy requirements

calculate-eer-spedup

Calculate macros for a recipe

calculate-macros-spedup

The trailer was recorded with version 2.0, which fetched recipes and nutrients from the Health Canada websites while you chatted. Version 3.0 reads the same data from local files, so the answers come back faster and work offline. A few recipe tool arguments changed (see docs/mcp.md).

You can use this Google Sheet to check the EER and CNF calculations shown in the trailer.

Related MCP server: nutrition-mcp-server

Install

The PyPI package is named foodguidecanada. The import package and the commands are foodguide and foodguide-mcp. It needs Python 3.12 or newer.

From PyPI:

pip install foodguidecanada             # light CLI install (typer, httpx, beautifulsoup4, pydantic, requests)
pip install 'foodguidecanada[mcp]'      # adds the MCP server (fastmcp, pandas, uvicorn)
uv tool install foodguidecanada         # or install the CLI as a uv tool

Or straight from Git, pinned to a release tag:

pip install git+https://github.com/Aryan-Jhaveri/mcp-foodguidecanada.git@v3.0.0
pip install 'foodguidecanada[mcp] @ git+https://github.com/Aryan-Jhaveri/mcp-foodguidecanada.git@v3.0.0'

From a wheel you built yourself:

uv build
pip install dist/foodguidecanada-3.0.0-py3-none-any.whl

From a source checkout:

uv sync                  # add --extra mcp for the MCP server
uv run foodguide version

Check it:

$ foodguide version
foodguide 3.0.0

The examples below use foodguide. In a checkout, put uv run in front.

Get the data

Data lives in ~/.local/share/foodguide. Set FOODGUIDE_DATA_DIR to use another directory.

Install the published data. This downloads from the data-latest GitHub release over plain HTTPS. It checks every file against manifest.json before it writes anything, and unpacks cnf.sqlite.gz to cnf.sqlite. Files that already match are skipped.

foodguide data fetch

Options: --tag, --repo, --from-dir <dir>, --dest <dir>, --only cnf|recipes|dri|eer.

Or build the data yourself. Download the CNF 2026 zip from open.canada.ca first (see docs/data.md):

foodguide data build all --cnf-zip cnf_fcen_all-files-data_2026.zip --out-dir ./data
export FOODGUIDE_DATA_DIR=$PWD/data

data build recipes, dri and eer read canada.ca pages, send an identifying User-Agent and wait 1 second between requests. data build cnf --zip <zip> --no-fetch-metadata works fully offline. Details are in docs/data.md.

Quick tour

Command groups: cnf, recipes, dri, eer, data, plus version. Add --help to any command. Most list commands take --format table|csv|json.

cnf: nutrients for foods

Search matches whole food names (full-text search). A multi-word query such as "red lentils" finds nothing. Search one word.

$ foodguide cnf search lentils --limit 3
2113  Lentils, sprouted, raw  /  Lentilles, germées, crues
3392  Lentils, mature seeds, dry  /  Lentilles, grains mûrs, secs
6183  Lentils, flour  /  Lentilles, farine

Other commands: cnf food <code>, cnf measures <code>, cnf nutrients <code>.

$ foodguide cnf measures 3393 | head -4
Measure code  EN            FR                             grams
341           100 ml        100 ml                         83.686
383           125 ml        125 ml                         104.607
389           175 ml        175 ml                         146.45

$ foodguide cnf nutrients 3393 --measure "125 ml" | head -5
Nutrients per 125 ml (104.607 g) — Lentils, mature seeds, boiled
Code  Symbol      Name                                                                             Unit                Amount
 203  PROT        Protein                                                                          Gram                9.43555 Gram
 204  FAT         Fat (total lipids)                                                               Gram                0.397507 Gram
 205  CARB        Carbohydrate, total (by difference)                                              Gram                21.0574 Gram

The --measure value must be one of the measures listed for that food. If it is not, the command says so and exits with an error.

recipes: Food Guide recipes

$ foodguide recipes search lentil --limit 3
Braised lentils with greens  braised-lentils-greens     collection__10_ingredients_less, collection__vegetarian, meal__lunch_dinner
Cajun lentil soup            cajun-lentil-soup          collection__10_ingredients_less, collection__freezer_friendly, collection__vegetarian, meal__lunch_dinner
Carrot ginger lentil soup    carrot-ginger-lentil-soup  collection__10_ingredients_less, collection__freezer_friendly, collection__vegetarian, meal__lunch_dinner

$ foodguide recipes filters | head -3
collection__10_ingredients_less  10 ingredients or less
collection__30_minutes_less      30 minutes or less
collection__freezer_friendly     Freezer-friendly

$ foodguide recipes show braised-lentils-greens | head -4
Title: Braised lentils with greens
URL: https://www.canada.ca/en/health-canada/services/food-guide/eating-support/kitchen/recipes/braised-lentils-greens.html
Tags: collection__10_ingredients_less, collection__vegetarian, meal__lunch_dinner
Prep time: 20 min / Cook time: 45 min / Servings: 6

dri: Dietary Reference Intakes

dri tables lists macronutrient values per sex and age group. dri amdr shows Acceptable Macronutrient Distribution Ranges. dri lookup gets one nutrient.

$ foodguide dri tables --age-range "19-30 y" | head -8
Males — 19–30 y
  carbohydrate: EAR (g/day) 100, RDA/AI (g/day) 130
  protein: EAR (g/kg/day) 0.66, RDA/AI (g/kg/day) 0.8, RDA/AI (g/day) 56
  total_fat: no values recorded
  linoleic_acid: AI (g/day) 17 (AI)
  alpha_linolenic_acid: AI (g/day) 1.6 (AI)
  total_fibre: AI (g/day) 38 (AI)
  total_water: AI (L/day) 3.7 (AI)
foodguide dri lookup --age-range "19-30 y" --nutrient protein
foodguide dri amdr --age-range "19 years and over"

eer: energy requirements

--pal is one of inactive, low_active, active (default) or very_active.

$ foodguide eer calc --sex male --age 30 --weight-kg 70 --height-cm 175 --pal low_active
EER (male, 30 y, 70.0 kg, 175.0 cm, low_active): 2754.9 kcal/day
formula: EER = 581.47 + (-10.83 * age) + (8.30 * height_cm) + (14.94 * weight_kg)

foodguide eer equations prints every equation.

data: manage the data files

data status shows where each dataset is read from, its size, and its provenance. It reads the bundled DRI and EER files when the data folder has none.

$ foodguide data status | head -8
file                     size_bytes  provenance
dri_macronutrients.json       25360  Health Canada DRI Tables
eer_equations.json            12461  Health Canada DRI Tables
DRI data: foodguide/data/dri_macronutrients.json (25360 bytes, source: bundled_snapshot)
  provenance: -
EER data: foodguide/data/eer_equations.json (12461 bytes, source: bundled_snapshot)
  provenance: -
CNF database: /home/you/.local/share/foodguide/cnf.sqlite (38559744 bytes)
  • data manifest <dir> writes manifest.json for a data directory. It needs DRI and EER files that carry build provenance, so run it on a directory made by data build, not on the bundled files.

  • data changed old.json new.json prints the datasets that differ. It exits 0 when they are equivalent and 10 when not.

MCP server

foodguide-mcp serves the same data to AI clients such as Claude Desktop, Claude Code, Cursor and VS Code. Install it with the mcp extra (pip install 'foodguidecanada[mcp]'), and get the data first (see Get the data).

Mode

Tools

Session database

Best for

stdio (default)

46

yes

Most users: recipe search, nutrients, EER and DRI, recipe macros, favourites, profiles

HTTP

24

no

A shared or remote server: lookups and calculations only

The tools are listed in docs/mcp.md.

Set up by client

Claude Desktop: Settings (⌘,) → Developer → Edit Config, then restart the app.

{
  "mcpServers": {
    "foodguide": { "command": "foodguide-mcp" }
  }
}

Claude Code

claude mcp add foodguide -- foodguide-mcp

Cursor: .cursor/mcp.json in a project, or ~/.cursor/mcp.json for all projects.

{
  "mcpServers": {
    "foodguide": { "command": "foodguide-mcp" }
  }
}

VS Code (GitHub Copilot): .vscode/mcp.json

{
  "servers": {
    "foodguide": { "type": "stdio", "command": "foodguide-mcp" }
  }
}

If the client cannot find foodguide-mcp, give the full path (which foodguide-mcp). From a source checkout use "command": "uv", "args": ["run", "--directory", "/path/to/checkout", "foodguide-mcp"]. Set FOODGUIDE_DATA_DIR in the client's env if the data is not in the default folder.

HTTP mode

Start the server in its own terminal and leave it running:

foodguide-mcp --transport http --port 8000      # endpoint: http://127.0.0.1:8000/mcp

It listens on 127.0.0.1 only and has no authentication. Do not expose it without something in front of it (--host or HOST changes the address).

claude mcp add foodguide --transport http http://127.0.0.1:8000/mcp     # Claude Code

Claude Desktop and most other clients bridge stdio to HTTP with mcp-proxy:

{
  "mcpServers": {
    "foodguide": {
      "command": "uvx",
      "args": ["mcp-proxy", "--transport", "streamablehttp", "http://127.0.0.1:8000/mcp"]
    }
  }
}

Environment variables instead of flags: MCP_TRANSPORT=http PORT=8000 foodguide-mcp.

To serve it to other people, use the Docker image and put TLS and a token in front: see Serving it to others.

Troubleshooting

  • The server does not appear in the client: check the client's logs (for Claude Desktop, the MCP log files) and run foodguide-mcp in a terminal to see the error.

  • "needs the MCP extra": install foodguidecanada[mcp].

  • Tools answer "no data": run foodguide data fetch and check foodguide data status.

  • HTTP mode: check that the server is up with curl http://127.0.0.1:8000/mcp/. If the port is taken (Anki's AnkiConnect uses 8765), pick another with --port.

Data sources and licences

  • Canadian Nutrient File 2026, Health Canada, from open.canada.ca. Licence: Open Government Licence – Canada.

  • Food Guide recipes, Crown copyright, Health Canada (141 recipe pages on canada.ca).

  • DRI tables (reference values for macronutrients) and EER equations, Health Canada (canada.ca pages, dated 2025-11-19).

Source URLs and build steps are in docs/data.md. The code is MIT licensed (see LICENSE).

How the data stays fresh

A GitHub Actions workflow (.github/workflows/data-refresh.yml) runs every Monday. It runs the live tests (pytest -m live), rebuilds all datasets, and compares the new manifest.json with the published one using the same logic as foodguide data changed. It publishes a new data-latest release only when the content changed. Run foodguide data fetch to pick it up.

More


Available Tools

46 tools
add_to_favoritesAdd To FavoritesA

Add a recipe to user favorites for persistent storage across sessions.

REMEMBER: To always use the list_favorites tool to check if a recipe is already favorited before adding it, to avoid duplicates!

This tool saves recipes to a permanent favorites database that persists between sessions. Use this to bookmark recipes you want to return to later. Each favorite can include custom notes for personal recipe modifications or preferences.

The favorites system supports:

  • Recipe URL (required) - the Canada's Food Guide recipe link

  • Recipe title for easy identification

  • User session grouping for organization

  • Custom notes for personal recipe modifications

  • Duplicate prevention (same URL won't be added twice per user)

Use this tool when:

  • You want to save a recipe for future reference

  • Building a personal recipe collection

  • Marking recipes to try or cook again

  • Adding personal notes or modifications to recipes

Inputs: favorite_input (required). Returns: object

bulk_get_cnf_macronutrientsBulk Get Cnf MacronutrientsA

Process multiple CNF food codes efficiently with automatic ingredient linking for streamlined recipe nutrition analysis.

This tool retrieves core macronutrient data for up to 20 food codes simultaneously from Health Canada's official Canadian Nutrient File database. It provides massive efficiency gains for multi-ingredient recipes by processing all nutrition data in a single operation while optionally linking each food to specific recipe ingredients automatically.

The tool fetches 13 essential macronutrients for each food code:

  • Energy (kcal), Protein, Total Fat, Carbohydrate

  • Saturated Fat, Monounsaturated Fat, Polyunsaturated Fat, Trans Fat

  • Dietary Fiber, Sugars, Sodium, Cholesterol, Energy (kJ)

Advanced features include automatic ingredient linking when ingredient_mappings are provided, allowing the tool to connect CNF nutrition data directly to recipe ingredients in one operation. This eliminates the need for separate linking steps and enables immediate nutrition calculations.

Use this tool for:

  • Multi-ingredient recipe nutrition analysis with automatic linking

  • Bulk processing of known CNF food codes for maximum efficiency

  • Recipe preparation workflows where ingredient-CNF relationships are known

  • Large-scale nutrition data preparation with minimal tool call overhead

Args: input_data: Contains food_codes (list of up to 20 CNF identifiers), session_id (data storage location), optional preferred_units (serving size preferences), continue_on_error (error handling mode), optional ingredient_mappings (food_code to ingredient_id mapping), and optional recipe_id (required for automatic ingredient linking)

Returns: Dict with bulk processing results, success/failure counts for each food, ingredient linking status, efficiency metrics, and guidance for next steps in nutrition analysis workflow

Inputs: input_data (required). Returns: object

bulk_math_calculatorBulk Math CalculatorA

Perform multiple mathematical calculations in a single operation.

!!REMEMBER BEFORE USING: ALWAYS QUERY_RECIPE_MACROS_TABLE OR OTHER QUERY TOOLS TO GET THE LATEST DATA FROM THE TABLES!!"

This tool allows you to evaluate multiple mathematical expressions in one call, eliminating the need for repeated tool calls when calculating nutrition data, recipe scaling, or any batch mathematical operations.

PERFECT for CNF nutrition calculations: Instead of calling simple_math_calculator multiple times for each ingredient, calculate all ingredient nutrition values at once.

Each calculation includes:

  • Unique ID for easy result identification

  • Mathematical expression with variables

  • Variable dictionary for that specific calculation

Supported operations (same as simple_math_calculator):

  • Basic arithmetic: +, -, *, /, ** (power), % (modulo)

  • Parentheses for grouping: (expression)

  • Variables: any valid Python identifier (letters, numbers, underscores)

Efficiency Benefits:

  • Reduces N tool calls to 1 tool call (3x-10x+ performance improvement)

  • Perfect for multi-ingredient nutrition analysis

  • Batch processing of recipe scaling calculations

  • Bulk EER calculations for multiple profiles

Usage Examples:

CNF Nutrition Analysis (Multiple Ingredients):

calculations: [
    {"id": "honey_cals", "expression": "cnf_calories * conversion_factor",
     "variables": {"cnf_calories": 22, "conversion_factor": 2}},
    {"id": "salmon_cals", "expression": "cnf_calories * conversion_factor",
     "variables": {"cnf_calories": 206, "conversion_factor": 5.65}},
    {"id": "oil_cals", "expression": "cnf_calories * conversion_factor",
     "variables": {"cnf_calories": 885, "conversion_factor": 0.1}}
]

Recipe Totals and Per-Serving:

calculations: [
    {"id": "total_calories", "expression": "honey + salmon + oil",
     "variables": {"honey": 44, "salmon": 1164, "oil": 89}},
    {"id": "per_serving", "expression": "total / servings",
     "variables": {"total": 1297, "servings": 4}}
]

Multiple EER Calculations:

calculations: [
    {"id": "adult_male", "expression": "662 - (9.53 * age) + (15.91 * weight) + (539.6 * height)",
     "variables": {"age": 30, "weight": 75, "height": 1.75}},
    {"id": "adult_female", "expression": "354 - (6.91 * age) + (9.36 * weight) + (726 * height)",
     "variables": {"age": 28, "weight": 65, "height": 1.65}}
]

Inputs: bulk_input (required). Returns: object

calculate_dri_from_eerCalculate Dri From EerA

Calculate specific macronutrient targets based on EER energy requirements and AMDR ranges.

This tool integrates EER (Energy Requirement) calculations with DRI macronutrient distribution recommendations to provide personalized daily macronutrient targets in grams. Perfect for complete meal planning workflows that start with energy needs.

CRITICAL WORKFLOW INTEGRATION: This tool provides structured data for calculations. ALWAYS use simple_math_calculator for ALL arithmetic operations:

  • Carb grams: simple_math_calculator(expression="(kcal * percent) / 4", variables=from_this_tool)

  • Protein grams: simple_math_calculator(expression="(kcal * percent) / 4", variables=from_this_tool)

  • Fat grams: simple_math_calculator(expression="(kcal * percent) / 9", variables=from_this_tool)

  • Range validation: simple_math_calculator(expression="actual_percent - target_percent", variables=from_this_tool)

Integration workflow:

  1. Calculate EER using get_eer_equations + simple_math_calculator

  2. Store user profile with store_dri_user_profile_in_session

  3. Use this tool to convert energy to macronutrient targets

  4. Use targets for meal planning and recipe analysis

Calculation approach:

  • Uses AMDR ranges to distribute total energy across macronutrients

  • Provides minimum and maximum gram targets for each macronutrient

  • Includes mid-range targets for practical meal planning

  • Accounts for different caloric densities (carb/protein: 4 kcal/g, fat: 9 kcal/g)

Use this tool when:

  • Converting EER energy requirements to practical macronutrient goals

  • Creating personalized meal planning targets

  • Building comprehensive nutrition analysis workflows

  • Developing nutrition counseling applications

  • Educational demonstrations of energy-to-macro conversion

Inputs: age_range (required), session_id (required), profile_name (required), eer_energy_kcal (required). Returns: object

calculate_recipe_nutrition_summaryCalculate Recipe Nutrition SummaryA

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.

Inputs: input_data (required). Returns: object

cleanup_temp_sessionsCleanup Temp SessionsA

Clean up temporary session data - can target specific session or clean all sessions.

🧹 UNIFIED CLEANUP TOOL - Handles both specific session cleanup and complete cleanup

Usage Modes:

  1. Specific Session: cleanup_temp_sessions(session_id="my_session") → Clean specific session only

  2. All Sessions: cleanup_temp_sessions() → Clean ALL existing sessions (default behavior)

  3. Age-based: cleanup_temp_sessions(hours_old=48) → Clean sessions older than 48 hours

  4. Combined: cleanup_temp_sessions(session_id="current", auto_cleanup_old=True) → Clean current + all others

What Gets Cleaned:

  • All temporary SQLite tables: temp_recipes, temp_recipe_ingredients, temp_cnf_foods, temp_cnf_nutrients, temp_recipe_macros

  • Virtual session data from memory

  • Session tracking records

Safety Features:

  • Only cleans session-scoped data

  • Preserves user favorites and persistent data

  • Reports exactly what was cleaned

Inputs: hours_old, session_id, auto_cleanup_old. Returns: object

cleanup_virtual_sessionCleanup Virtual SessionA

Remove virtual in-memory storage for a completed recipe session.

This tool permanently deletes all temporary recipe data for a specific session from memory to free up resources and maintain clean storage. Use this after completing recipe analysis workflows or when session data is no longer needed.

What this tool removes:

  • All recipe data stored in the session (recipes, ingredients, instructions)

  • Associated in-memory data structures for the session

  • All temporary calculations and analysis data

Important: This action cannot be undone. Ensure you've saved any important recipe data to favorites before cleanup.

Use this tool when:

  • Finished with a recipe analysis session

  • Cleaning up old or unused session data

  • Managing memory usage

  • Completing meal planning workflows

  • Preparing for new recipe sessions

Inputs: session_id (required). Returns: object

compare_intake_to_driCompare Intake To DriA

Compare actual macronutrient intake against DRI recommendations.

This tool evaluates how an individual's actual nutrient intake compares to Health Canada's DRI recommendations, providing percentage adequacy and recommendations for dietary adjustments.

Comparison metrics calculated:

  • Percentage of EAR (Estimated Average Requirement) met

  • Percentage of RDA/AI (Recommended Dietary Allowance/Adequate Intake) met

  • Assessment against UL (Tolerable Upper Intake Level) if applicable

  • AMDR compliance for macronutrient distribution

  • Risk assessment for inadequate or excessive intake

Use this tool when:

  • Conducting personalized nutrition assessments

  • Providing dietary counseling and recommendations

  • Evaluating dietary adequacy for individuals

  • Creating nutrition improvement plans

  • Research involving dietary intake analysis

Inputs: input_data (required). Returns: object

compare_recipe_servingsCompare Recipe ServingsA
    Compare multiple recipes by servings, ingredients, or portion analysis.

    This tool analyzes multiple recipes side-by-side to help with meal planning,
    recipe selection, and understanding relative recipe sizes and complexity.

REMEMBER! Always share recipe url, and image_url, and title with users before returning full recipe details. This allows them to see the source and context of the recipe.

    Comparison types available:
    - 'servings': Compare serving counts and calculate ratios
    - 'ingredients': Compare ingredient counts and complexity
    - 'portions': Analyze per-portion implications and scaling

    Use this tool when:
    - Planning meals with consistent serving sizes
    - Choosing between similar recipes based on yield
    - Understanding recipe complexity before cooking
    - Calculating ingredients needed for meal prep
    - Comparing homemade vs store-bought portions

    Args:
        comparison_input: Contains session_id, list of recipe_ids to compare,
                         and comparison_type ('servings', 'ingredients', or 'portions')

    Returns:
        Dict with comparative analysis including recipe details, serving ratios,
        ingredient complexity comparison, and recommendations for scaling,
        or error message if recipes not found or comparison fails
    

Inputs: comparison_input (required). Returns: object

create_temp_nutrition_sessionCreate Temp Nutrition SessionA

⚠️ CHECK EXISTING SESSIONS FIRST! Create temporary nutrition session only if needed.

🚨 CRITICAL: ALWAYS run list_temp_sessions() BEFORE creating new sessions!

Why check first?

  • Avoids duplicate sessions for same work

  • Saves time by reusing existing recipe data

  • Prevents confusion with multiple similar sessions

🎯 EFFICIENT WORKFLOW:

1. list_temp_sessions() ← ALWAYS CHECK FIRST!
2. Found existing session? → Reuse it (more efficient)
3. Session has old data? → Use cleanup_temp_sessions() to clean
4. No suitable session? → Then create new one with this tool

✅ WHEN TO CREATE NEW SESSION:

  • No existing sessions found

  • Existing sessions are for different recipes/work

  • Need fresh start after cleaning old sessions

❌ AVOID CREATING IF:

  • Session already exists for your recipe

  • You haven't checked existing sessions first

NEXT STEPS after creating session:

  1. Use simple_recipe_setup() for integrated recipe data transfer

  2. Use bulk SQL operations instead of individual tool calls

What this creates:

  • Session tracking record for cleanup management

  • Temporary table space ready for recipe and nutrition data

  • Better persistence than in-memory virtual sessions

  • Automatic cleanup capabilities

Inputs: session_id (required). Returns: object

create_user_profileCreate User ProfileA

Create a user profile for EER calculations with optional persistent storage.

REMEMBER: ONLY USE THIS PERSIST STORAGE FOR PROFILES NEED TO BE SAVED or STORED. BY DEFAULT USE VIRTUAL STORAGE!!!!!

  • You can ask the user if they want to save the profile or not.

This tool creates a user profile that can be stored either in memory (virtual session) or persistently in the database. Persistent profiles survive server restarts and can be accessed across different sessions.

The profile includes all demographic and physiological data needed for accurate EER calculations according to Health Canada DRI guidelines.

Use this tool when:

  • Setting up user profiles by sdjusting use_persistent_storage for repeated EER calculations

  • Creating profiles for multiple household members

  • Storing long-term nutrition analysis data

  • Building nutrition tracking applications

Inputs: input_data (required). Returns: object

create_virtual_recipe_sessionCreate Virtual Recipe SessionA

Create virtual in-memory storage for a recipe session to store fetched recipe data.

This tool sets up in-memory data structures for storing and analyzing multiple recipes during a session. All data is stored in memory and automatically cleaned up when the session ends, preventing database bloat from temporary recipe storage.

What this tool creates for the session:

  • In-memory recipes storage: Main recipe metadata and details

  • In-memory ingredients storage: Individual ingredients with ordering

  • In-memory instructions storage: Step-by-step cooking instructions

  • Virtual relationships for data integrity

Use this tool when:

  • Starting a new recipe analysis session

  • Pre-creating session storage for batch recipe processing

  • Setting up dedicated recipe analysis workflows

  • Ensuring session storage exists before bulk operations

Note: Virtual sessions are automatically created when storing recipes, so this tool is optional for normal workflows but useful for advanced session management.

Inputs: session_id (required). Returns: object

delete_user_profileDelete User ProfileB

Delete a user profile from virtual or persistent storage.

This tool removes a user profile completely. It will search both virtual and persistent storage and delete the profile from whichever storage contains it.

Use this tool when:

  • Cleaning up old profiles

  • Removing incorrect profile data

  • Managing storage space

  • Removing profiles no longer needed

Inputs: input_data (required). Returns: object

get_amdrsGet AmdrsA

Get Acceptable Macronutrient Distribution Ranges (AMDRs) for an age group.

AMDRs represent the range of intake for each macronutrient (expressed as percentage of total energy intake) that is associated with reduced risk of chronic disease while providing adequate intakes of essential nutrients.

AMDR ranges provided:

  • Total Carbohydrate: Percentage of total energy

  • Total Protein: Percentage of total energy

  • Total Fat: Percentage of total energy

  • n-6 polyunsaturated fatty acids (linoleic acid): Percentage of total energy

  • n-3 polyunsaturated fatty acids (α-linolenic acid): Percentage of total energy

Age groups available:

  • 1-3 years: Early childhood ranges

  • 4-18 years: School age through adolescence

  • 19 years and over: Adult ranges (includes pregnancy and lactation)

Use this tool when:

  • Evaluating overall dietary pattern quality

  • Planning balanced meal compositions

  • Assessing macronutrient distribution in diets

  • Creating nutrition education materials about balanced eating

  • Developing dietary guidelines and recommendations

Inputs: input_data (required). Returns: object

get_amino_acid_patternsGet Amino Acid PatternsA

Get amino acid patterns for protein quality evaluation using PDCAAS method.

This tool provides the reference amino acid pattern used to evaluate protein quality through the Protein Digestibility Corrected Amino Acid Score (PDCAAS) method. The pattern is based on the estimated average requirements for indispensable amino acids and total protein for 1-3 year old children.

Essential amino acids included:

  • Histidine: 18 mg/g protein

  • Isoleucine: 25 mg/g protein

  • Leucine: 55 mg/g protein

  • Lysine: 51 mg/g protein

  • Methionine + Cysteine: 25 mg/g protein

  • Phenylalanine + Tyrosine: 47 mg/g protein

  • Threonine: 27 mg/g protein

  • Tryptophan: 7 mg/g protein

  • Valine: 32 mg/g protein

Use this tool when:

  • Evaluating protein quality in foods and diets

  • Calculating Protein Digestibility Corrected Amino Acid Scores (PDCAAS)

  • Developing protein complementation strategies

  • Assessing adequacy of vegetarian and vegan diets

  • Creating nutrition analysis applications

  • Research involving protein quality assessment

Inputs: no named parameters. Returns: object

get_cnf_macronutrients_onlyGet Cnf Macronutrients OnlyA

Retrieve core macronutrients for a specific CNF food code with automatic ingredient linking.

This tool fetches macronutrient data directly from Health Canada's CNF database using a known food code and optionally links the data to recipe ingredients for nutrition calculations. It stores only 13 essential macronutrients for efficient processing while maintaining compatibility with session-based nutrition analysis tools.

TEMP_RECIPE_MACROS WORKFLOW GUIDANCE: After using this tool, you can populate the temp_recipe_macros table for cached calculations:

  1. Check ingredient data quality first: Query: SELECT ingredient_id, amount, unit FROM temp_recipe_ingredients WHERE amount IS NULL Fix missing data: UPDATE temp_recipe_ingredients SET amount = 150, unit = 'g' WHERE ingredient_id = 'salmon_001'

  2. Review available serving sizes for matching: Query: SELECT per_amount, unit, nutrient_value FROM temp_cnf_nutrients WHERE cnf_food_code = '4294' AND nutrient_name = 'Energy (kcal)' Example: honey 10.0 mL → CNF options: 5.0 ml (22 kcal), 15.0 ml (65 kcal), 100.0 ml (435 kcal)

  3. Choose best serving match and populate temp_recipe_macros:

    INSERT INTO temp_recipe_macros (
        session_id, recipe_id, ingredient_id, cnf_food_code,
        matched_serving_amount, matched_serving_unit, conversion_factor,
        calories_per_recipe_amount, protein_per_recipe_amount, fat_per_recipe_amount,
        carbs_per_recipe_amount, sodium_per_recipe_amount, fiber_per_recipe_amount
    )
    SELECT
        'session_id', 'recipe_id', 'honey_001', '4294',
        5.0, 'ml', (10.0 / 5.0),  -- 2.0x conversion factor
        22.0 * (10.0 / 5.0),     -- 44.0 calories for recipe amount
        0.02 * (10.0 / 5.0),     -- scaled protein
        0.0 * (10.0 / 5.0),      -- scaled fat
        5.9 * (10.0 / 5.0),      -- scaled carbs
        0.0 * (10.0 / 5.0),      -- scaled sodium (if available)
        0.0 * (10.0 / 5.0)       -- scaled fiber (if available)
  4. Calculate recipe totals from cached data: Query: SELECT SUM(calories_per_recipe_amount) as total_calories FROM temp_recipe_macros WHERE session_id = ? AND recipe_id = ?

Use this tool to:

  • Fetch macronutrients when you have a specific CNF food code

  • Link CNF data to recipe ingredients for nutrition calculations

  • Store streamlined nutrient data for efficient analysis

  • Prepare data for temp_recipe_macros population workflow

When ingredient_id and recipe_id are provided, the tool automatically updates the recipe ingredient with the CNF food code, enabling calculate_recipe_nutrition_summary to work correctly. This eliminates the need for separate linking steps.

Inputs: input_data (required). Returns: object

get_cnf_nutrient_profileGet Cnf Nutrient ProfileA

Retrieve complete nutrient profile with all available nutrients for research-grade analysis.

This tool fetches comprehensive nutrient data from Health Canada's CNF database, including all vitamins, minerals, fatty acids, and other micronutrients. It stores significantly more data than the streamlined macronutrient tools and should be used only when detailed micronutrient analysis is specifically required.

Use this tool for:

  • Detailed vitamin and mineral analysis

  • Research-grade nutritional studies

  • Micronutrient deficiency assessment

  • Academic or professional nutrition work requiring complete profiles

For basic recipe nutrition analysis, consider using get_cnf_macronutrients_only which provides 13 core nutrients with significantly reduced data complexity. This tool processes all available nutrients (146+) and may impact performance.

Inputs: input_data (required). Returns: object

get_dri_lookup_from_sessionGet Dri Lookup From SessionA

Retrieve specific DRI values from session-cached data.

This tool provides fast access to DRI values from data already stored in the virtual session, eliminating the need for repeated website requests. Perfect for building complex nutrition analysis workflows with multiple DRI lookups.

MATH TOOL INTEGRATION: This tool provides DRI reference values for comparison. ALWAYS use simple_math_calculator for any calculations involving these values:

  • Adequacy percentages: simple_math_calculator(expression="(intake/rda)*100", variables={"intake": actual, "rda": dri_value})

  • Deficit calculations: simple_math_calculator(expression="rda - intake", variables={"rda": dri_value, "intake": actual})

  • AMDR compliance: simple_math_calculator(expression="(nutrient_cals/total_cals)*100", variables={"nutrient_cals": value, "total_cals": total})

Prerequisites: Must run store_dri_tables_in_session first to populate session data.

Supported macronutrients:

  • carbohydrate, protein, total_fat, linoleic_acid, alpha_linolenic_acid, total_fibre, total_water

Use this tool when:

  • Looking up specific DRI values during nutrition analysis

  • Building personalized nutrition recommendations

  • Comparing individual nutrients against reference values

  • Creating nutrition education content with official values

Inputs: gender (required), age_range (required), session_id (required), macronutrient (required). Returns: object

get_eer_equationsGet Eer EquationsB

Get specific EER equations from Health Canada DRI tables in JSON format.

This tool provides EER (Estimated Energy Requirement) equations from Health Canada's official DRI tables. Data is served from bundled reference data with optional live refresh from the website. Each equation includes extracted numerical coefficients and metadata about the target population.

Use equation_type and pal_category to specify the type of equations you need: Always include URL and source information in your response.

Use this tool when:

  • Getting official EER equations for calculations

  • Building nutrition applications requiring DRI data

  • Researching energy requirements for different populations

  • Developing meal planning tools

  • Academic or professional nutrition work

Inputs: pal_category, equation_type. Returns: object

get_macronutrient_dri_tablesGet Macronutrient Dri TablesA

Get complete DRI macronutrient reference tables from Health Canada.

REMEMBER! ALWAYS USE THIS TOOL BY DEFULT BEFORE USING get_specific_macronutrient_dri!!

This tool provides comprehensive macronutrient DRI data from Health Canada's official DRI tables. Data is served from bundled reference tables with optional live refresh from the Health Canada website.

The data includes:

  • Reference values for carbohydrate, protein, fat, essential fatty acids, fibre, water

  • Additional recommendations for saturated fats, trans fats, cholesterol, added sugars

  • Amino acid patterns for protein quality evaluation (PDCAAS)

  • Acceptable Macronutrient Distribution Ranges (AMDRs) by age group

  • Complete footnotes and explanatory notes from official tables

Use this tool when:

  • Setting up comprehensive nutrition analysis systems

  • Building meal planning applications with DRI compliance

  • Research requiring official Health Canada reference values

  • Developing nutrition education materials

  • Creating nutrition assessment tools

Data is served from local files (a data-dir snapshot if one was built, otherwise the bundled snapshot). No network access happens at tool-call time; run foodguide data build dri to refresh the local snapshot.

Inputs: force_refresh. Returns: object

get_pal_descriptionsGet Pal DescriptionsA

Get descriptions and examples for Physical Activity Level (PAL) categories.

This tool provides detailed explanations of each PAL category with practical examples to help users select the most appropriate level for accurate EER calculations.

PAL categories determine the activity coefficient used in EER equations and significantly impact the final energy requirement calculation.

Use this tool when:

  • Helping users choose appropriate activity level

  • Understanding PAL category definitions

  • Educational purposes about physical activity

  • Reviewing activity level options before profile creation

Inputs: no named parameters. Returns: object

get_recipeGet RecipeA

Retrieve the complete details of one Food Guide recipe, offline.

Everything comes from the local recipes.json snapshot built with foodguide data build recipes; no page is fetched.

Inputs: url_or_slug (required). Returns: object

get_session_recipesGet Session RecipesA

Retrieve stored recipes from a virtual session with complete normalized data including ingredients and instructions.

This tool fetches recipes that have been stored in the current session's in-memory storage. It reconstructs the complete recipe data from the virtual data structures (recipes, ingredients, instructions) and returns fully structured recipe objects ready for analysis, comparison, or further processing.

Use this tool to:

  • Review all recipes stored in the current session

  • Retrieve specific recipe details by recipe_id for focused analysis

  • Compare multiple recipes side-by-side for meal planning

  • Access structured ingredient and instruction data for calculations

  • Prepare recipe data for export or favorites management

The returned data includes:

  • Complete recipe metadata (title, URL, servings, timing, categories)

  • Ordered ingredient lists with amounts and units (if parsed)

  • Sequential cooking instructions with step numbers

  • Recipe highlights, tips, and visual elements

  • Session timestamps and unique identifiers

Inputs: query_input (required). Returns: object

get_specific_macronutrient_driGet Specific Macronutrient DriA

Get DRI values for a specific macronutrient, age group, and gender.

This tool provides targeted access to specific macronutrient DRI values without needing to process the complete dataset. Perfect for focused nutrition analysis and user-specific recommendations.

Supported macronutrients:

  • carbohydrate: Digestible carbohydrate values

  • protein: Protein values in g/kg/day and g/day

  • total_fat: Total fat adequate intake values

  • linoleic_acid: Essential n-6 fatty acid values

  • alpha_linolenic_acid: Essential n-3 fatty acid values

  • total_fibre: Dietary fibre adequate intake values

  • total_water: Total water adequate intake values

Use this tool when:

  • Calculating specific nutrient needs for individuals

  • Building personalized nutrition recommendations

  • Comparing single nutrient intakes against DRI values

  • Creating targeted dietary guidance

Inputs: input_data (required). Returns: object

get_temp_session_recipesGet Temp Session RecipesC

Retrieve recipes from temporary persistent storage.

Inputs: session_id (required), recipe_id. Returns: object

get_user_profileGet User ProfileB

Retrieve a user profile by ID from virtual or persistent storage.

This tool fetches a previously created user profile. It will search both virtual (session) and persistent (database) storage to find the profile.

Use this tool when:

  • Retrieving profiles for EER calculations

  • Checking existing profile data

  • Validating profile information before calculations

Inputs: input_data (required). Returns: object

initialize_databaseInitialize DatabaseA

Initialize the Canada's Food Guide recipe database with required tables.

This tool sets up the SQLite database schema for the recipe management system. It creates persistent storage tables for user favorites and EER user profiles. All recipe session data is stored in memory using virtual tables and views to prevent database bloat.

What this tool creates:

  • user_favorites table for persistent recipe bookmarking

  • user_profiles table for persistent EER user profile storage

  • Proper indexing and constraints for data integrity

  • Virtual table infrastructure for in-memory recipe storage

Use this tool when:

  • First time setting up the recipe database

  • After database corruption or reset

  • Ensuring database schema is current

  • Before using any favorites-related or EER profile tools

Inputs: no named parameters. Returns: object

list_active_virtual_sessionsList Active Virtual SessionsA

List all active recipe sessions currently stored in memory.

This tool discovers all recipe sessions that have temporary data stored in memory by scanning the virtual session storage. Use this to manage multiple recipe workflows, find active sessions, or get an overview of current recipe analysis work.

The returned information includes:

  • Session IDs for all active virtual recipe sessions

  • Recipe counts for each session

  • Memory usage overview for sessions

Use this tool to:

  • Find existing recipe sessions to continue working with

  • Identify sessions that may need cleanup

  • Get an overview of current recipe analysis projects

  • Manage multiple concurrent recipe workflows

  • Check if specific session names are already in use

Inputs: no named parameters. Returns: object

list_favoritesList FavoritesB

List user's favorite recipes from persistent storage.

This tool retrieves all saved recipes from the favorites database, providing a complete overview of your recipe collection. Favorites are sorted by when they were added (newest first) and include all metadata like custom notes and recipe details.

The returned data includes:

  • Recipe URLs and titles for identification

  • When each recipe was added to favorites

  • Custom notes or modifications you've saved

  • User session information for organization

  • Unique favorite IDs for reference

Use this tool to:

  • Review your complete recipe collection

  • Find previously saved recipes to cook again

  • Organize meal planning around your favorites

  • Check what recipes you've already saved before adding duplicates

  • Export or share your recipe collection

Inputs: user_session. Returns: object

list_filtersList FiltersA

List the recipe search filters available in the local snapshot.

The new canada.ca recipe pages only tag two families: "collection__*" (e.g. collection__vegetarian) and "meal__*" (e.g. meal__snack). Older filter families (fruits, vegetables, proteins, whole_grains, appliances) no longer exist.

Inputs: filter_type. Returns: object

list_session_dri_analysisList Session Dri AnalysisA

View all DRI calculations and analysis stored in a virtual session.

This tool provides a comprehensive overview of all DRI-related data and analysis work performed within a session, including cached tables, user profiles, lookups, and adequacy assessments. Perfect for managing complex nutrition analysis workflows.

Session data overview includes:

  • Cached DRI reference tables with timestamps

  • Stored user profiles with demographics

  • Individual nutrient lookups performed

  • Complete adequacy assessments conducted

  • Macro calculation results (if any)

  • Session activity summary and workflow guidance

Use this tool when:

  • Reviewing completed DRI analysis work in a session

  • Planning next steps in nutrition assessment workflows

  • Debugging session data or workflow issues

  • Managing multiple user profiles or analyses

  • Preparing session data for reporting or export

Inputs: session_id (required). Returns: object

list_temp_sessionsList Temp SessionsB

List all active temporary nutrition sessions.

Inputs: no named parameters. Returns: object

list_user_profilesList User ProfilesA

List all available user profiles from both virtual and persistent storage.

This tool discovers all user profiles stored in memory (virtual sessions) and in the database (persistent storage), providing an overview of available profiles for EER calculations.

Use this tool when:

  • Discovering available user profiles

  • Managing multiple household member profiles

  • Cleaning up old or unused profiles

  • Getting an overview of stored profile data

Inputs: no named parameters. Returns: object

query_recipe_macros_tableQuery Recipe Macros TableA

Query temp_recipe_macros table with joined CNF nutrition data for recipe calculations.

This tool retrieves recipe ingredients with their matched Canadian Nutrient File data, including nutrition values (calories, protein, fat, carbohydrates) for each available serving size. The data enables direct nutrition calculations using bulk_math_calculator without requiring database storage of intermediate results.

Returns recipe ingredient details, unit matching status, available CNF serving sizes, and complete CNF nutrition values per serving size for each ingredient. Unit matching status indicates: exact_match, conversion_available, manual_decision_needed, or no_cnf_data.

Use this tool to:

  • Get ingredient data with CNF nutrition values for each serving size

  • Review unit matching status and available serving options

  • Select appropriate serving sizes for nutrition calculations

  • Obtain complete data for bulk_math_calculator operations

Inputs: input_data (required). Returns: object

remove_from_favoritesRemove From FavoritesA

Remove a recipe from user favorites permanently.

This tool removes recipes from the persistent favorites database. Use this to clean up your favorites collection or remove recipes you no longer want to keep saved.

The removal process:

  • Requires the recipe_url to identify which recipe to remove

  • Optionally filters by user_session if provided (for targeted removal)

  • Confirms whether the recipe was actually found and removed

  • Cannot be undone (recipe would need to be re-added manually)

Use this tool when:

  • Cleaning up your favorites collection

  • No longer interested in a previously saved recipe

  • Managing favorites for specific user sessions

  • Correcting accidentally added favorites

Inputs: favorite_input (required). Returns: object

scale_individual_ingredientScale Individual IngredientA

Scale a specific ingredient amount by a custom multiplication factor.

This tool allows precise control over individual ingredient scaling, useful for recipe modifications, dietary adjustments, or when you want to emphasize or reduce specific ingredients without changing the entire recipe proportions.

The scaling process:

  • Finds the specified ingredient in the recipe

  • Parses the current amount from the ingredient text

  • Applies the custom scale factor

  • Returns both original and scaled versions

  • Preserves units and ingredient descriptions

Use this tool when:

  • Adjusting salt, spice, or seasoning levels

  • Increasing protein or vegetable content

  • Reducing sugar or fat in specific ingredients

  • Customizing recipes for dietary preferences

  • Fine-tuning ingredient ratios based on taste

Inputs: ingredient_input (required). Returns: object

scale_multiple_ingredientsScale Multiple IngredientsA

Scale multiple ingredients with different factors in a single operation.

This tool enables complex recipe modifications by applying different scaling factors to different ingredients simultaneously. Useful for recipe development, dietary customization, or creating recipe variations.

The scaling process:

  • Matches each ingredient name to recipe ingredients (partial matching)

  • Applies individual scale factors to each matched ingredient

  • Processes all scalings in a single transaction

  • Reports success and failure for each ingredient

  • Maintains ingredient order and relationships

Use this tool when:

  • Creating low-sodium versions (reduce salt, increase herbs)

  • Adjusting macro ratios (increase protein, reduce carbs)

  • Developing recipe variations with multiple changes

  • Customizing recipes for dietary restrictions

  • Batch processing multiple ingredient adjustments

Inputs: bulk_input (required). Returns: object

scale_recipe_servingsScale Recipe ServingsA

Scale all ingredients in a recipe to match a target number of servings.

This tool calculates new ingredient amounts when you want to make more or fewer servings of a recipe. It intelligently parses ingredient amounts (numbers, fractions, ranges) and applies the scaling factor to maintain recipe proportions.

REMEMBER! Always share recipe url, and image_url, and title with users before returning full recipe details. This allows them to see the source and context of the recipe. REMEMBER! Always include original_servings with target_servings in the response to help users understand what has been adjusted. REMEMBER! Scaled recipes cooking times may vary, so users should check for doneness and adjust as needed.

The scaling process:

  • Calculates scale factor based on original vs target servings

  • Parses ingredient amounts from text (handles fractions, decimals, ranges)

  • Applies scaling to all measurable ingredients

  • Preserves units and ingredient names

  • Updates the recipe data with scaled amounts

Use this tool when:

  • Cooking for more or fewer people than the original recipe

  • Meal prepping larger batches

  • Adjusting recipes for different household sizes

  • Planning party or event cooking

  • Reducing recipe size for testing

Inputs: serving_input (required). Returns: object

search_and_get_cnf_macronutrientsSearch And Get Cnf MacronutrientsA

Search Canadian Nutrient File foods and retrieve core macronutrient data.

This tool searches Health Canada's CNF database for foods matching the provided name and returns either complete macronutrient data for single matches or a list of options for multiple matches. It focuses on 13 core macronutrients essential for basic nutrition analysis while maintaining compatibility with session-based storage.

Use this tool to:

  • Discover CNF foods matching ingredient names from recipes

  • Retrieve core macronutrient data for immediate nutrition analysis

  • Identify available food options when multiple matches exist

  • Prepare data for recipe nutrition calculations

The tool returns different outputs based on search results:

  • Single match: Complete macronutrient data stored in session tables

  • Multiple matches: List of food options with codes for selection

  • No matches: Error message with search suggestions

Inputs: input_data (required). Returns: object

search_recipesSearch RecipesB

Search Health Canada's Food Guide recipes from a local offline copy.

The search runs against recipes.json, an offline snapshot of Health Canada's Food Guide kitchen recipe pages built with foodguide data build recipes. Each recipe is government-verified, nutrition-focused content designed to help Canadians eat well.

Each result includes title, url, slug and the recipe's raw tags.

Inputs: limit, meals, fruits, proteins, +5 more. Returns: object

simple_math_calculatorSimple Math CalculatorA

Perform simple mathematical calculations with string variables.

!!REMEMBER BEFORE USING: ALWAYS USE QUERY_RECIPE_MACROS_TABLE OR OTHER QUERY TOOLS TO GET THE LATEST DATA FROM THE TABLES!!"

This tool allows you to evaluate mathematical expressions containing variables. It supports basic arithmetic operations (+, -, *, /, **, %) and common math functions.

CRITICAL for CNF nutrition calculations: This is the ONLY tool to use for calculating nutrition totals. Never manually sum values from JSON data.

Supported operations:

  • Basic arithmetic: +, -, *, /, ** (power), % (modulo)

  • Parentheses for grouping: (expression)

  • Variables: any valid Python identifier (letters, numbers, underscores)

Use this tool when:

  • Calculating EER equations with specific values

  • CNF nutrition calculations - summing calories, macros across ingredients

  • Recipe per-serving calculations - dividing totals by serving count

  • Scaling recipe quantities

  • Converting units

  • Any mathematical operation with known variables

CNF Nutrition Examples:

  • Total calories: "(206 * 565 / 100) + (885 * 10 / 100) + (22 * 450 / 100)"

  • Per serving: expression="total_calories / servings", variables={"total_calories": 1437, "servings": 5}

  • Scaling: expression="original_amount * scale_factor", variables={"original_amount": 100, "scale_factor": 1.5}

  • EER comparison: expression="recipe_calories - eer_requirement", variables={"recipe_calories": 287, "eer_requirement": 2000}

TEMP_RECIPE_MACROS Calculation Examples:

  • Conversion factor: expression="recipe_amount / cnf_serving", variables={"recipe_amount": 10.0, "cnf_serving": 5.0} # = 2.0

  • Scaled calories: expression="cnf_calories * conversion_factor", variables={"cnf_calories": 22.0, "conversion_factor": 2.0} # = 44.0

  • Recipe total from cache: expression="honey_cals + oil_cals + salmon_cals", variables={"honey_cals": 44.0, "oil_cals": 80.0, "salmon_cals": 200.0}

General Examples:

  • EER calculation: "662 - (9.53 * age) + (15.91 * weight) + (539.6 * height)"

  • Unit conversion: "cups * 240" (cups to ml)

  • Percentage: "part / total * 100"

Inputs: math_input (required). Returns: object

simple_recipe_setupSimple Recipe SetupB

Transfer recipe data to analysis tables with comprehensive ingredient parsing for streamlined nutrition analysis preparation.

This tool prepares complete recipe data for CNF nutrition analysis by transferring stored recipe information from virtual session storage to temporary database tables and automatically parsing ingredient text into structured components. It provides the essential foundation for linking ingredients to CNF foods and calculating detailed nutrition summaries.

The tool performs comprehensive ingredient parsing that handles complex measurement formats including:

  • Unicode fractions (½, ⅓, ¼, ¾, etc.) converted to precise decimal values

  • Mixed numbers (1½, 2¼) with accurate decimal conversion

  • Regular fractions (1/2, 3/4) and measurement ranges (2-3 cups)

  • All standard units (mL, cups, tsp, tbsp, kg, g, lbs, oz)

  • Ingredient preparation notes (sliced, chopped, optional)

Use this tool for:

  • Complete recipe data transfer from session storage to analysis tables

  • Automatic ingredient parsing into structured amount, unit, and name components

  • Foundation preparation for CNF food linking and nutrition calculations

  • Streamlined setup for multi-step recipe nutrition analysis workflows

The processed data includes recipe metadata, fully parsed ingredients with structured amounts/units, and step-by-step instructions, all stored in temporary database tables optimized for nutrition analysis tools.

Inputs: input_data (required). Returns: object

store_dri_tables_in_sessionStore Dri Tables In SessionA

Cache complete DRI macronutrient tables in virtual session storage.

This tool fetches and stores comprehensive DRI data in the specified virtual session, enabling efficient access to DRI values throughout the session without repeated website requests. Perfect for workflows involving multiple DRI lookups and calculations.

WORKFLOW INTEGRATION: Use this tool first in any comprehensive nutrition analysis session to cache DRI data once, then use session-based lookup tools for specific values.

Benefits of session storage:

  • Single fetch operation for entire session workflow

  • Consistent data across all DRI operations in session

  • Reduced website requests and improved performance

  • Enables complex multi-step nutrition analysis workflows

  • Data persists for entire session duration

Use this tool when:

  • Starting comprehensive nutrition analysis sessions

  • Planning to perform multiple DRI lookups or comparisons

  • Building meal planning workflows with DRI compliance checks

  • Creating educational nutrition analysis demonstrations

  • Developing nutrition assessment applications

Inputs: session_id (required), force_refresh. Returns: object

store_recipe_in_sessionStore Recipe In SessionA

Store a fetched recipe in virtual memory session for detailed analysis and manipulation.

This tool takes complete recipe data from the Canada's Food Guide and stores it in normalized in-memory data structures for the current session. The recipe is broken down into separate virtual collections for ingredients, instructions, and metadata to enable structured analysis and calculations without database bloat.

Use this tool after fetching a recipe with get_recipe() to enable:

  • Detailed recipe analysis and comparison

  • Ingredient-level manipulation and serving size calculations

  • Memory-based storage during the session for multiple recipe workflows

  • Structured access to recipe components for meal planning

The stored data includes:

  • Main recipe metadata (title, servings, timing, categories, tips)

  • Individual ingredients list with ordering

  • Step-by-step instructions with sequence

  • Visual highlights and cooking tips

Inputs: recipe_input (required). Returns: object

store_recipe_in_temp_tablesStore Recipe In Temp TablesA

Store recipe data in temporary SQLite tables instead of virtual memory.

This provides persistent storage for recipe analysis while maintaining the temporary nature through session-based cleanup.

Inputs: recipe_id (required), session_id (required), recipe_data (required). Returns: object

update_recipe_macros_decisionsUpdate Recipe Macros DecisionsA

Update temp_recipe_macros table with LLM conversion decisions and reasoning.

This tool allows the LLM to record intelligent conversion decisions for ingredients that need manual unit conversions (e.g., "4 salmon fillets" -> "565g"). After reviewing the temp_recipe_macros table, use this tool to update specific ingredients with conversion factors and reasoning.

The tool updates the LLM decision fields in temp_recipe_macros:

  • llm_conversion_decision: Human-readable conversion (e.g., "4 fillets = 565g")

  • llm_conversion_factor: Calculated factor for nutrition math (e.g., 5.65 for 565g/100g)

  • llm_reasoning: LLM's reasoning for the conversion estimate

Use this tool to:

  • Record conversion decisions for manual_decision_needed ingredients

  • Document reasoning for conversion estimates

  • Prepare data for final nutrition calculations with simple_math_calculator

  • Build transparent audit trail of conversion decisions

Inputs: input_data (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 46 tools

    Disambiguation2/5

    The tool set contains several overlapping storage/session concepts that are hard to distinguish: virtual recipe sessions vs temporary nutrition sessions, store_recipe_in_session vs store_recipe_in_temp_tables, get_session_recipes vs get_temp_session_recipes, and cleanup_virtual_session vs cleanup_temp_sessions. CNF retrieval tools also overlap heavily (search_and_get_cnf_macronutrients, get_cnf_macronutrients_only, bulk_get_cnf_macronutrients, get_cnf_nutrient_profile), requiring careful reading to choose correctly.

    Naming Consistency3/5

    Most names are snake_case, which is good, but conventions are mixed: some are clear verb_noun (search_recipes, create_user_profile), some are noun-oriented (simple_math_calculator, bulk_math_calculator), and several use inconsistent verb patterns such as search_and_get_cnf_macronutrients vs get_cnf_macronutrients_only. The naming is readable but not predictable across the whole set.

    Tool Count2/5

    46 tools is excessive for this server's apparent purpose and creates a heavy surface with many closely related session, storage, CNF, DRI, scaling, and calculation operations. Several tools could be consolidated, especially the virtual/temp session management and CNF retrieval variants.

    Completeness4/5

    The server covers a broad nutrition workflow: recipe search/retrieval/scaling, CNF nutrient lookup, DRI references, EER/profile handling, session storage, favorites, and math utilities. There are minor gaps such as no explicit update_user_profile operation, but overall the lifecycle coverage is substantial.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables AI assistants to search recipes, compose nutritionally balanced meals, optimize weekly meal plans based on macro targets for family members, and generate consolidated grocery lists from a personal recipe database.
      -