Query metrics
query_metricsEach day's figures as the Metrics Nest app shows them, or weekly or monthly buckets. One row per metric and day (one per reading for metrics read reading by reading), already combined: food and water include what was logged in the app and what other apps wrote to Health, so never add rows together. Paged: follow next_cursor while it is set; meta.truncated names the days a page covers when there are more. A window outside what the share allows is narrowed to it (meta.history_floor and history_ceiling).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "query_metrics"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | Last day, inclusive. Omitted: today in the account time zone. | |
| from | No | First day, inclusive. Omitted: six days before `to`, so the last seven days only. Pass it for anything longer, up to 366 days per call. | |
| limit | No | Rows per page, 1 to 500. | |
| client | No | For a coach: a client id from list_clients, to read that client. Omitted: your own account. | |
| cursor | No | The cursor from the previous page, to continue. | |
| metric | No | A metric name from list_metrics. Omitted: all metrics, which pages a lot. | |
| granularity | No | day (default) returns each day; week and month one row per bucket: the average as numValue, and bucket.min, max, sum and count. For a total such as steps or kcal in a week, read bucket.sum. Use week or month for any window over about three months: a decade a day at a time is thousands of rows and dozens of pages, and the same decade by month is one. |