Skip to main content
Glama
Loopback Training Server

Loopback Training Server

get_nutrition

Retrieve daily nutrition totals synced from HealthKit, including calories, macros, sodium and micronutrients per logged day, to review food intake across a date range.

Instructions

Get daily nutrition totals synced from HealthKit (food logging apps).

Returns one row per day that has logged food: energy (kcal), carbs, protein, fat, saturated fat, fiber, sugar, sodium, potassium, cholesterol, water, caffeine, plus any extra micronutrients under micros, the number of logged entries and which apps wrote them.

Days with no logging have NO row — absence means "not tracked", not "ate nothing". A row with partial: true was synced while the day was still in progress, so its totals are incomplete; exclude those from any average.

ONLY energy_kcal, carbs_g, protein_g and fat_g are daily totals. sodium_mg, fiber_g, sugar_g, saturated_fat_g, cholesterol_mg, potassium_mg and every key in micros are LOWER BOUNDS — food databases record them on only a fraction of entries, so the day sums whichever foods happened to carry the field. Nothing in the payload marks them, and a plausible-looking value is not evidence of completeness. Never infer a deficiency or an excess from one (observed: ~200 mg potassium on a 2,600 kcal day). Null water_ml/caffeine_mg means unreported, not zero.

For trends over more than a couple of weeks, prefer get_nutrition_summary — it aggregates per week or month and aligns intake with weight and training load, at a fraction of the tokens.

Args: start_date: Start date (YYYY-MM-DD) end_date: End date (YYYY-MM-DD), defaults to today limit: Max days returned, newest first (default 60)

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

Input Schema

NameRequiredDescriptionDefault
limitNo
end_dateNo
start_dateYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.36

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so unusually well: it explains missing rows, partial-day sync flags, null-means-unreported semantics, and the critical caveat that seven named fields plus everything under `micros` are lower bounds rather than true totals, with an observed counterexample.

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?

Front-loaded with purpose, then progressively finer caveats, and each paragraph does real work. It is on the long side for a three-parameter read, and "a plausible-looking value is not evidence of completeness" restates the preceding sentence, which is the only clear trimming opportunity.

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 and no annotations exist, so the description must describe both the payload shape and its traps, which it does completely: field list, micros bucket, entry/app counts, partial flag, null handling, and the lower-bound list. An agent can call this correctly and interpret the result without further help.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 does: it gives the YYYY-MM-DD format, states end_date defaults to today (the schema only shows null), and documents that limit returns days newest-first with a default of 60.

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?

Opens with a specific verb and resource ("Get daily nutrition totals synced from HealthKit") and immediately states the grain of the return ("one row per day that has logged food"), which separates it from the sibling aggregate tool get_nutrition_summary named later.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly routes the agent: "For trends over more than a couple of weeks, prefer get_nutrition_summary" with a stated reason (aggregation at a fraction of the tokens). It also gives an exclusion rule (drop `partial: true` rows from averages) and an interpretation rule (absence means not tracked).

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