Skip to main content
Glama

Get Nutrient Stats

get_nutrient_stats
Read-only

One or more nutrients over a date range, such as "how were my carbs last month?" or "am I over on sugar?". For each nutrient: the amount on each logged day, min, average and max, the average as a percent of the user's target, days the target was met, and the foods that supplied most of it. Nutrients with a maximum (sugars, added sugars, salt, saturated fat) report the limit and the days over it instead. Averages only count days with diary entries. possibly_incomplete_days lists logged days well under both the energy target and the user's usual day (under 70% and 75%), which are often only partly logged; average_without_incomplete_days leaves them out. Up to 90 days and 8 nutrients.

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": {
      "codes": "<codes>",
      "start_date": "<start_date>",
      "end_date": "<end_date>"
    },
    "name": "get_nutrient_stats"
  }
}

Input Schema

NameRequiredDescriptionDefault
codesYesNutrient codes from list_components, such as ["CHOAVL", "SUGAR", "FIBC"] for net carbs, sugars and fibre.
end_dateYesLast day, YYYY-MM-DD.
start_dateYesFirst day, YYYY-MM-DD.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnly, non-destructive and closed-world, and the description adds substantial non-obvious behavior: averages only count days with diary entries, the 70%/75% heuristic behind possibly_incomplete_days, and how limit-style nutrients differ. The only unwritten behavior is what happens on invalid codes or out-of-range dates.

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?

The content is dense and information-rich with little filler, but the opening is a sentence fragment and the body is a long run-on inventory of return fields rather than a front-loaded summary. It is longer than it needs to be for a three-parameter tool, though most sentences do earn their place.

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?

With no output schema and no output-schema coverage from annotations, the description takes on the return-value burden and does so thoroughly, enumerating per-day amounts, min/avg/max, target percentages, days met, and top contributing foods. Error handling and what an empty result looks like are the only gaps for a tool of this complexity.

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 the codes/start_date/end_date meanings are already documented, and the description's reference to codes only echoes the schema's list_components hint. It does add the undocumented caps of 90 days and 8 nutrients, which are not encoded as maxItems/maxLength in the schema, but that is a single incremental contribution.

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 states the resource (one or more nutrients) and the scope (a date range), and the two sample questions immediately give the agent a recognizable task shape. It never names a sibling tool, so differentiation from get_nutrient_contributions or get_nutrient_gaps must be inferred from the described return fields rather than stated.

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?

The quoted user questions ("how were my carbs last month?", "am I over on sugar?") act as concrete use-case triggers, and the note about nutrients with a maximum switching to limit/over-limit reporting clarifies which mode applies. There are no explicit exclusions or pointers to alternative tools for related questions.

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