Get Nutrient Stats
get_nutrient_statsOne 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
| Name | Required | Description | Default |
|---|---|---|---|
| codes | Yes | Nutrient codes from list_components, such as ["CHOAVL", "SUGAR", "FIBC"] for net carbs, sugars and fibre. | |
| end_date | Yes | Last day, YYYY-MM-DD. | |
| start_date | Yes | First day, YYYY-MM-DD. |