Skip to main content
Glama

get_nutrient_contributors

Read-onlyIdempotent

Top logged foods and supplements contributing to ONE nutrient over a day or short range, highest amount first. use: "what gave me most of my sodium today", "what's driving my potassium this week". INFER, do not ask: date, days and limit; defaults are on the params. nutrient accepts common aliases (e.g. "b12", "carbs", "fibre").

FORMAT: default 'compact' replies with id (this nutrient's number in get_nutrient_summary's nutrient dictionary, whose unit then applies) instead of key/unit, and drops the per-contributor unit field it would otherwise repeat on every row. A nutrient outside that dictionary has no id, so key/unit are used whatever the format. 'verbose' always uses key/unit and keeps unit on every contributor.

DATA COMPLETENESS: totals sum the logged items that carry a value for the nutrient; coverage says how many did. Partial coverage -> say "based on foods with X data". Never call a low intake a deficiency; intake is not a lab result. Supplement vs food is reported separately. A daily supplement counts on every active day by default (the user is not expected to check it off) unless a day was explicitly marked not taken, so its share of a total can include days with no check-in.

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": {
      "nutrient": "<nutrient>"
    },
    "name": "get_nutrient_contributors"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoEnd date, or the only date when days=1. YYYY-MM-DD; omit for today (the user's own timezone).
daysNoDays ending on date; default 1.
limitNoMax contributors to return; default 10.
formatNocompact (default) packs values by nutrient id, see FORMAT. verbose spells out each nutrient's name and unit.
nutrientYesNutrient name or alias, e.g. "vitamin_d", "calcium", "b12".

Output Schema

NameRequiredDescriptionDefault
resultYesHuman-readable result text returned by the tool.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / date / description
      Previous value: -"End date (or the only date if days=1). Format: YYYY-MM-DD. Optional -- omit for today."New value: +"End date, or the only date when days=1. YYYY-MM-DD; omit for today (the user's own timezone)."
    • changedInput schema / properties / days / description
      Previous value: -"How many days, ending on date. Optional -- default 1."New value: +"Days ending on date; default 1."
    • changedInput schema / properties / format / description
      Previous value: -"compact (default) packs values by nutrient id, see FORMAT above. verbose spells out each nutrient's name and unit."New value: +"compact (default) packs values by nutrient id, see FORMAT. verbose spells out each nutrient's name and unit."
    • changedInput schema / properties / limit / description
      Previous value: -"Max contributors to return. Optional -- default 10."New value: +"Max contributors to return; default 10."
    • changedInput schema / properties / nutrient / description
      Previous value: -"Nutrient name or alias, e.g. \"vitamin_d\", \"calcium\", \"b12\". Required."New value: +"Nutrient name or alias, e.g. \"vitamin_d\", \"calcium\", \"b12\"."
  2. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already establish read-only, idempotent, closed-world behavior, and the description adds substantial context on top: how coverage is computed, how to phrase partial-coverage results, that supplement and food contributions are reported separately, and the non-obvious rule that a daily supplement counts on every active day unless explicitly marked not taken. It also guards against misuse by stating intake is not a lab result and should not be called a deficiency.

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 the purpose, then cleanly sectioned into use/defaults, FORMAT, and DATA COMPLETENESS. The FORMAT paragraph is the weakest part, packing id/unit/format edge cases into one long sentence, but no section is expendable.

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?

For a 5-parameter read tool with an output schema and full annotation coverage, the description covers what the agent needs: intent, defaults, alias handling, response-format tradeoffs, and the interpretive caveats around coverage and supplement counting. Return structure is left to the output schema, which is correct.

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 the baseline is 3, but the description genuinely adds meaning: nutrient accepts common aliases ('b12', 'carbs', 'fibre'), defaults are stated as inferable, and the format enum's semantics are explained in detail (compact returns the nutrient id from get_nutrient_summary's dictionary and drops the repeated unit field; verbose uses key/unit). The format explanation is dense enough to be slightly hard to parse, which keeps it from a 5.

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?

Names a specific verb and resource ('Top logged foods and supplements contributing to ONE nutrient') plus scope (day or short range) and ordering (highest amount first). The emphasis on 'ONE nutrient' and the reference to get_nutrient_summary's nutrient dictionary make it unambiguous which query this answers versus a general summary tool.

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?

Gives concrete user-question examples ('what gave me most of my sodium today', 'what's driving my potassium this week') and an explicit operating instruction to infer date/days/limit rather than ask, which steers agent behavior well. It stops short of naming a when-not condition or explicitly routing to get_nutrient_history/summary as alternatives, so it falls short of a 5.

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.