Skip to main content
Glama
Loopback Training Server

Loopback Training Server

get_nutrition_summary

Check whether nutrition supports training by comparing intake, body weight, and training load across weekly or monthly periods.

Instructions

Diet, body weight and training load aligned on the same periods.

This is the tool for "is my nutrition supporting my training?". Each period carries:

  • nutrition: average intake per LOGGED day (partial days excluded)

  • days_logged / days_in_period: how much of the period that average actually covers — 2 of 7 days is an anecdote, not a weekly average

  • protein_g_per_kg: protein against the period's average body weight

  • body: weight start/end/avg and the change across the period

  • training: workouts, distance, duration and energy burned

  • expenditure: energy OUT — active_kcal_avg (movement + exercise), basal_kcal_avg (resting), tdee_kcal_avg (their sum), and balance_kcal_avg (intake minus TDEE), each with its own day count

Not every block is in every response: body and expenditure depend on what this athlete's data covers. Work with the blocks you get rather than asking after the ones you don't.

Active energy already includes workout burn: TDEE is active + basal, and adding training.energy_kcal on top double-counts every session. Basal is null until the athlete's app build syncs it, in which case TDEE and balance are null too and active alone is what you have. Today is excluded from expenditure — health metrics have no partial-day flag, so a day in progress holds only the hours elapsed.

Balance is a direction with a magnitude, not a measurement: intake is self-reported and skews low, which biases the computed deficit larger, and basal is HealthKit's estimate — the two errors compound rather than cancel. body carries the unmodelled cross-check: weight_change (a least-squares fit across the readings' span, not last-minus-first), weight_sd (the scatter it sits in) and weigh_ins (how many readings back both).

Averages cover energy, macros and the rest of the nutrient columns — but only energy_kcal, carbs_g, protein_g and fat_g are true totals. The averages of sodium_mg, fiber_g, sugar_g, saturated_fat_g, cholesterol_mg and potassium_mg are averages OF LOWER BOUNDS, because food databases record those on only some entries. Never read one as a deficiency or an excess; their trends track logging detail as much as diet.

Read days_logged before drawing any conclusion, and remember intake is self-reported: food logging typically under-reports, so treat the trend and the macro split as the signal rather than absolute calorie totals. Weight change over a single week is mostly glycogen and hydration; look across 3-4 weeks before calling it a trend.

Coaching stance:

  • Under-fuelling matters more than over-fuelling for an endurance athlete. A persistent deficit alongside hard training is worth flagging even when the athlete asked about weight loss — cross-check how sessions have been going, and recovery metrics if you have them, before saying it's working.

  • Endurance-relevant anchors: carbohydrate availability around hard/long sessions, protein ~1.6-2.0 g/kg for an athlete in training, and fiber timing before key sessions.

  • If the athlete wants real micronutrient or sodium status, the answer is a blood test or a dietitian, not this data. Say that plainly.

  • You are not a dietitian. Flag patterns worth a professional's attention (persistent large deficits, very low intake, an athlete asking about restriction) rather than prescribing an intake plan.

Args: start_date: Start date (YYYY-MM-DD) end_date: End date (YYYY-MM-DD), defaults to today period: "week" (default) or "month" timezone: IANA zone (e.g. "Europe/Amsterdam") used to attribute workouts to a local day; defaults to UTC

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": {
      "start_date": "<start_date>"
    },
    "name": "get_nutrition_summary"
  }
}

Input Schema

NameRequiredDescriptionDefault
periodNoweek
end_dateNo
timezoneNo
start_dateYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.36

TDQS

A4.1/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so thoroughly: it warns that training.energy_kcal must not be added to TDEE, that basal/TDEE/balance go null until the app build syncs, that today is excluded from expenditure, and that intake is self-reported and biases deficits larger. It also discloses computed-field semantics (weight_change as a least-squares fit, weight_sd, weigh_ins) and conditional block presence — exactly the behavior an agent cannot get from the schema.

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?

It is long but front-loaded and well-structured, with the core question, the block enumeration and the caveats ordered by how early an agent needs them. Nearly every sentence adds interpretation-critical information (double counting, lower-bound nutrient averages, days_logged); the coaching-stance section is the most compressible portion but still earns its place for correct framing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

No output schema exists, so the description must describe the return payload itself, and it does: every per-period block and its fields are enumerated, including day counts, energy-out decomposition and the balance metric. It also states the limitations an agent would otherwise misread as data errors, making the definition complete for a complex multi-block summary tool.

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 0%, so the description must compensate, and its Args block documents all four parameters with formats, defaults and meaning: YYYY-MM-DD for start_date, end_date defaulting to today, period as 'week' (default) or 'month' (adding an enum the schema lacks), and timezone as the IANA zone that attributes workouts to a local day, defaulting to UTC. Only minor gaps remain, such as how start_date interacts with period granularity.

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 opening line names a specific resource and scope ('Diet, body weight and training load aligned on the same periods') and the framing question 'is my nutrition supporting my training?' pins down what the tool answers. It does not explicitly name a sibling it is not (e.g. get_nutrition, get_training_summary), so differentiation is left to inference from the combined-blocks description.

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 through the framing question rather than stated as an explicit when/when-not rule, and no alternative tool is named. The line 'Work with the blocks you get rather than asking after the ones you don't' gives an actionable operating instruction, which lifts it above pure silence.

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