Skip to main content
Glama

Query metrics

query_metrics
Read-onlyIdempotent

Each 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

NameRequiredDescriptionDefault
toNoLast day, inclusive. Omitted: today in the account time zone.
fromNoFirst day, inclusive. Omitted: six days before `to`, so the last seven days only. Pass it for anything longer, up to 366 days per call.
limitNoRows per page, 1 to 500.
clientNoFor a coach: a client id from list_clients, to read that client. Omitted: your own account.
cursorNoThe cursor from the previous page, to continue.
metricNoA metric name from list_metrics. Omitted: all metrics, which pages a lot.
granularityNoday (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.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already establish a safe, idempotent read, and the description adds substantial behavior on top: pre-aggregated values that must not be summed, cursor-driven paging with next_cursor, meta.truncated describing covered days, and silent narrowing of out-of-range windows via meta.history_floor/history_ceiling. These are exactly the surprises that would otherwise cause wrong aggregates or missing-data assumptions.

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 what a row is, then aggregation caveat, then paging, then window clamping — a sensible information order with no filler. Sentences are dense and occasionally compound, but every clause carries operational meaning.

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, the description correctly carries the burden of describing the return shape (row-per-day/bucket, numValue, bucket.stat fields, meta.truncated, history floor/ceiling) and paging protocol. Minor gaps remain: it calls the token 'next_cursor' while the parameter is 'cursor', and it does not state units or value typing for the figures.

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 goes beyond the schema by explaining the semantic consequence of the date window (clamping to the share's allowed range) and the cost implication of granularity choice. It does not add field-level detail beyond what the schema already documents for metric, limit, client, or cursor.

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 description states a specific verb and resource plus the exact row shape: one row per metric and day, or one row per week/month bucket, with a parenthetical contrast for metrics read reading-by-reading. That implicitly separates it from per-reading and log-style siblings, but it never names an alternative tool to route to, so sibling differentiation is inferred 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?

Clear operative guidance: switch to week/month for windows over about three months (with the reason — a decade daily is thousands of rows and dozens of pages), and never sum rows because food/water already merge app and Health data. What's missing is when to choose this over query_intraday or query_logs, so the agent must infer the boundary.

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