Skip to main content
Glama

Nutricity calculators

calculate_macros

Read-onlyIdempotent

Split target daily calories into protein, carbohydrate and fat — grams and kcal. Protein is derived from body weight via the same LARN-sourced goal bands as /protein-requirement (larn/active/sport); fat is a % of calories (20-35); carbs are the remainder. Uses 4/4/9 kcal per gram. Errors if protein + fat already exceed the calorie target.

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": {
      "calories": "<calories>",
      "weight": "<weight>",
      "unit": "<unit>",
      "proteinGoal": "<proteinGoal>",
      "fatPct": "<fatPct>"
    },
    "name": "calculate_macros"
  }
}

Input Schema

NameRequiredDescriptionDefault
ageNoAge in years; >=60 raises the LARN protein reference to 1.10 g/kg
unitYesmetric (kg) or imperial (lb)
fatPctYesFat % of calories (20-35)
weightYesBody weight (kg or lb)
caloriesYesTarget daily calories (kcal), e.g. from /tdee or /calorie-deficit
proteinGoalYesProtein target band (same as /protein-requirement): larn (LARN reference), active (1.2-1.6 g/kg) or sport (1.6-2.0 g/kg)

Output Schema

NameRequiredDescriptionDefault
fatKcalYes
fatGramsYes
carbsKcalYes
carbsGramsYes
proteinKcalYes
proteinGramsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations only declare readOnly and idempotent, so the description carries the algorithmic burden and does so well: it specifies the 4/4/9 kcal-per-gram convention, the 20-35% fat constraint, and the failure mode when protein plus fat exceed the calorie target. It stops short of describing rounding or the shape of the returned split, which the output schema presumably covers.

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

Conciseness5/5

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

Three dense sentences, front-loaded with the outcome, then the derivation rules, then the error condition. No filler and nothing repeated from the schema.

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 six-parameter calculator with a full output schema and read-only annotations, the description supplies the computation method and edge-case failure, which is what an agent needs to call it correctly. Minor omissions (units of returned values, rounding) are handled by the output schema.

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%, so every parameter including the age-driven 1.10 g/kg adjustment and the enum bands is already documented. The description reinforces the relationship between proteinGoal and the sibling tool and the fat percentage range, but adds little syntax or meaning the schema does not already carry, making 3 the correct baseline.

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 — splitting a calorie target into protein, carbohydrate and fat, reported in both grams and kcal — and names the derivation path (LARN goal bands shared with /protein-requirement, fat as a % of calories, carbs as remainder). An agent can tell this apart from calculate_protein_requirement or calculate_tdee without opening any schema.

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 rather than stated: the description reveals it consumes a calorie target (the schema cites /tdee or /calorie-deficit) and shares protein bands with /protein-requirement, which hints at the pipeline position. But there is no explicit when-to-use/when-not statement and no direct routing away from siblings that also compute protein.

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.

Resources