Skip to main content
Glama
MetricBridge (formerly Health Export AI)

MetricBridge (formerly Health Export AI)

get_freshness

Read-onlyIdempotent

Check how current your exported Apple Health files are before trusting them or asking the user to refresh. Flags stale core files and stale local copies.

Instructions

How current the exported files are, so you can decide whether to trust what you read or ask the user to refresh. stale is judged on the core files (the daily cache and health-sessions.json), never on the hourly intraday file: true when their newest write is older than stale_after_hours (default 26, or HEALTH_STALE_AFTER_HOURS, or your maxAgeHours), or when this machine holds a stale copy. state is fresh, stale, stale_copy, no_data, locked or demo. stale_copy means the phone's manifest (.health-manifest.json) or iCloud says the phone wrote a newer version of a core file than the one on this machine (stale_copy lists each file with localWrittenAt, phoneWrittenAt and reason); relay the recommendation, which says how to make iCloud Drive download it. Also returns age_hours, as_of (when the phone wrote the daily cache), last_data_date, data_lag_days, per-file write times with each file's match against the manifest, stale_files, manifest_behind (the manifest lags the data, not stale), sessions_last_night (present or absent; without a manifest, advisory only, people skip nights) and, on a Mac, an advisory icloud status per core file. Same rule as the status --max-age cron gate. When no export is found, recommendation also names the companion iOS app's App Store page and website (the same links as app.appStoreUrl and app.unlockUrl); when the newest readable export is older than the server's own window (not a stricter maxAgeHours), it names the website. Both carry fixed campaign labels. Cheap: call it again before a long analysis.

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": "get_freshness"
  }
}

Input Schema

NameRequiredDescriptionDefault
maxAgeHoursNoTreat the data as stale when the newest write is older than this many hours (greater than 0, at most 8760). Default 26, or HEALTH_STALE_AFTER_HOURS when set.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.6.3

TDQS

A4.5/5.0
Behavior5/5

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

Goes far beyond the readOnly/idempotent annotations: it defines exactly how staleness is judged (core files only, never the intraday file), the threshold precedence (default 26, HEALTH_STALE_AFTER_HOURS, maxAgeHours), and every state value including the non-obvious stale_copy and manifest_behind cases. It also discloses side-adjacent behavior such as embedded campaign-labeled links and the 'advisory only' caveat for sessions_last_night.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose is front-loaded, but the body is a dense single paragraph that mixes threshold rules, state enumeration, return-field inventory, and link/campaign behavior. Every clause is arguably informative, yet the lack of structure makes it harder to scan than it needs to be.

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?

There is no output schema, and the description compensates by naming the returned fields (state, age_hours, as_of, last_data_date, data_lag_days, stale_files, manifest_behind, sessions_last_night, icloud) and explaining the ambiguous ones. Edge cases such as no export found and manifest-behind-data are covered, leaving nothing essential for a correct call unstated.

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 adds real meaning the schema does not: the precedence chain between maxAgeHours, the 26-hour default, and the environment variable, plus the note that the rule mirrors the `status --max-age` cron gate.

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?

Opens with a specific, agent-relevant purpose: reporting how current the exported files are so the agent can decide whether to trust results. This is unmistakably distinct from sibling read tools like get_structured_export or query_health_data, and the follow-on rules elaborate on the same single job rather than blurring it.

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 an explicit decision context ('decide whether to trust what you read or ask the user to refresh') and a concrete reuse instruction ('Cheap: call it again before a long analysis'). It stops short of naming alternatives or explicit when-not conditions, but the intended call pattern is clear.

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