Skip to main content
Glama
PhilipAD

Health Export AI

by PhilipAD

get_health_metrics

Read-onlyIdempotent

Retrieve Apple Health metric values over a date range and aggregate them by average, sum, min, max, or latest for trend analysis and daily tracking.

Instructions

Get values for a metric (or all metrics) over an optional date range, with an aggregate (avg/sum/min/max/latest). The core data-retrieval tool. Every result carries a coverage block giving the metric's real firstDate/lastDate/days: check it before trusting a long window, and note that aggregate is always computed over the full range even when points are rolled up. Single-metric answers also list any logged point events inside the window as segmentBoundaries. A day the app rebuilt after samples arrived late (or were deleted) carries recomputed_at, and a metric with rebuilt or possibly stale past days carries a recompute block (backfilled_days, recomputed_at, capped); untouched days carry neither.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endNoYYYY-MM-DD
limitNoMaximum data points to return (default 365, max 3000). The server rolls up rather than truncating.
startNoYYYY-MM-DD
metricNoMetric name, e.g. step_count, heart_rate, sleep_analysis. Omit for all.
filterDaysNoRestrict to days covered by matching logged events (health-events.json): endDate ranges cover every day inclusive, point events cover their single day, negate:true keeps only days NOT covered. The answer states how many days matched. Example: HRV on night-shift blocks vs days off.
aggregationNo
granularityNoRoll daily values up before returning them. 'auto' (default) picks the finest granularity that fits the response budget, so a multi-year range returns monthly points instead of thousands of daily ones.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv1.4.0
    • addedInput schema / properties / filterDays
      Added value: +{
      +  "description": "Restrict to days covered by matching logged events (health-events.json): endDate ranges cover every day inclusive, point events cover their single day, negate:true keeps only days NOT covered. The answer states how many days matched. Example: HRV on night-shift blocks vs days off.",
      +  "properties": {
      +    "eventTag": {
      +      "description": "Event tag to match, e.g. nights.",
      +      "type": "string"
      +    },
      +    "eventType": {
      +      "description": "Event type to match, e.g. shift, medication, travel.",
      +      "type": "string"
      +    },
      +    "negate": {
      +      "description": "Keep only days NOT covered by matching events.",
      +      "type": "boolean"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed2 schema fields changedv1.2.2
    • addedInput schema / properties / granularity
      Added value: +{
      +  "description": "Roll daily values up before returning them. 'auto' (default) picks the finest granularity that fits the response budget, so a multi-year range returns monthly points instead of thousands of daily ones.",
      +  "enum": [
      +    "auto",
      +    "day",
      +    "week",
      +    "month",
      +    "quarter",
      +    "year"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / limit
      Added value: +{
      +  "description": "Maximum data points to return (default 365, max 3000). The server rolls up rather than truncating.",
      +  "type": "integer"
      +}
  3. First observedv1.0.0

TDQS

A4/5.0
Behavior5/5

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

Annotations only cover read-only/idempotent/openWorld, but the description goes well beyond that, disclosing response semantics: a coverage block with real firstDate/lastDate/days, that aggregate is computed over the full range even when points are rolled up, segmentBoundaries for point events, and the recompute/recomputed_at blocks for rebuilt or stale days. These are genuine behavioral traits an agent could not derive from annotations or schema.

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-loads the core purpose and the aggregate summary, then tapers into edge-case response details. Every sentence carries real information about return semantics, though the trailing coverage/recompute sentences are dense and could be tightened.

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 must carry return-value burden and does: it explains coverage, segmentBoundaries, recomputed_at, and the recompute block. Given seven parameters and a nested filterDays object, parameter specifics lean on the schema, but for a complex read tool the description is largely complete.

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 86%, so baseline is 3, but the description adds meaning beyond the schema by explaining the aggregate-vs-granularity interaction: 'aggregate is always computed over the full range even when points are rolled up.' It also names the aggregate options, reinforcing the enum semantics. It does not add much on start/end/limit, so it sits modestly above baseline.

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?

States a specific verb and resource ('Get values for a metric or all metrics over an optional date range') plus the aggregation modes, and positions itself as 'the core data-retrieval tool.' An agent can tell it is a general metrics reader, but it does not explicitly differentiate from close siblings like query_health_data, get_trends, or get_intraday.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Implies usage by calling itself the core data-retrieval tool and warns to check coverage 'before trusting a long window,' which is useful operational guidance. However, it never states when to prefer it over the several overlapping sibling tools (get_trends, compare_periods, get_intraday, query_health_data), leaving that routing to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.