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

Canada's Food Guide MCP Server

Bulk Math Calculator

bulk_math_calculator

Evaluate multiple math expressions in one call to calculate nutrition values, scale recipes, and process batch totals, reducing repeated tool calls.

Instructions

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}}
]

Input Schema

NameRequiredDescriptionDefault
bulk_inputYesContains list of calculations, each with id, expression, and variables

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

A4/5.0
Behavior3/5

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

With no annotations, the description carries the full disclosure burden. It does well on what is supported (operators, parentheses, Python-style identifiers) and what each result contains (id, expression, variables), but it never says how failures behave — whether one malformed expression aborts the whole batch, what happens on division by zero or an undeclared variable, or whether evaluation order matters. The 'REMEMBER' preamble is a data-freshness directive rather than disclosure about this tool's own behavior.

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

Conciseness3/5

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

Purpose is front-loaded, but the body is bloated: three full worked examples, plus bolded efficiency-benefit bullets that restate the opening claim ('Reduces N tool calls to 1'). The all-caps 'REMEMBER' sentence reads as an injected instruction rather than tool documentation and disrupts structure.

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?

An output schema exists, so the description needn't explain return values, and the nested calculations array is well illustrated by examples. What remains uncovered is failure semantics for a batch compute tool and whether values are unit-aware — meaningful for nutrition use, but not enough to call the definition incomplete.

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 baseline is 3, but the description adds real meaning beyond the schema: the operator set (+, -, *, /, **, %), parenthesised grouping, and the rule that variable names are any valid Python identifier. The worked examples also show how ids, expressions, and variable dictionaries relate in practice.

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 first sentence states a specific verb and resource: 'Perform multiple mathematical calculations in a single operation.' It immediately contrasts with the sibling 'simple_math_calculator,' so an agent can tell batch from single-expression math without opening either schema.

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 implicitly and explicitly names the alternative ('Instead of calling simple_math_calculator multiple times') and gives concrete use contexts (CNF nutrition, recipe scaling, EER profiles). What's missing is a crisp exclusion rule, e.g. 'use simple_math_calculator when you only have one expression,' which is left to inference.

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