MetricBridge (formerly Health Export AI)
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| HEALTH_LISTEN | No | Set to '1' to enable LAN push receiver | |
| PAIRING_SECRET | No | Optional pairing code from the iOS app to gate access | |
| HEALTH_DATA_DIR | No | Path to the directory containing .health-cache.json from Health Export AI. Default: ~/Library/Mobile Documents/iCloud~ai~healthexport~app/Documents | ~/Library/Mobile Documents/iCloud~ai~healthexport~app/Documents |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_mcp_statusA | Health check: data source, how many metrics/workouts are available, which optional context files exist, the most recent data date, a compact |
| get_freshnessA | How current the exported files are, so you can decide whether to trust what you read or ask the user to refresh. |
| list_metricsA | List every available Apple Health metric with its unit, day count, and date range. Use this to discover metric names before querying. |
| get_health_metricsA | 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 |
| get_trendsA | Compare the most recent N-day window against the prior N days for a metric: change, percent change and direction (up/down/flat). Also returns |
| compare_periodsA | Compare a metric between two arbitrary date periods (A vs B): each aggregate plus the change and percent change. Pass periodA/periodB explicitly, or pass anchor {eventId, days} to build both periods around a logged event (the before/after question, with the event day excluded from both sides). |
| get_structured_exportA | Return clean structured JSON for the chosen metrics/date range. Paginated: the result carries |
| get_intradayA | The current hour-by-hour window from the iOS app's HOURLY automations (health-intraday.json, app 1.4+): each metric's hourly points (t, v = the hour's value) plus its latest value. The window covers a 48-hour span, yesterday 00:00 local to now, and the file is REPLACED on every run, so this is a live recent view, not history; use get_health_metrics for day-level questions. Discrete metrics (heart rate, SpO2, respiratory rate, HRV, resting heart rate) carry the hour's Min and Max beside v (the hour's mean) when the app version writes them; older exports cover today only and have no Min/Max. Returns available:false with setup guidance when no hourly automation has delivered yet. |
| query_health_dataA | Natural-language convenience: pass a question and get routed structured results. Prefer the specific tools above when you can, and call list_metrics first to see how much history exists, since this tool answers over whatever the file holds. |
| list_eventsA | Logged context events: medication starts, habit changes, doctor visits, life events, shift blocks, episodes, travel, and any type a newer app adds. Merges the app's health-events.json with health-events-agent.json (events logged with add_event); every event carries source "app" or "agent". Optional {type, tag, start, end} filters; a range event matches a window it overlaps. Sorted ascending by date. Returns available:false when neither file exists; absence means nothing was logged or exported, not that nothing happened. |
| add_eventA | Log a context event the user tells you about (a medication start, a habit change, a visit, a trip) so later analysis can segment around it. Writes ONLY health-events-agent.json in the export folder, never Apple Health and never a file the iOS app writes; the app shows these events read-only. Returns the stored event with its id (starting "agent-"). Idempotent: repeating a call with the same clientEventId (or, without one, the same date, type, title and endDate) returns the event already logged instead of adding a duplicate. Ask the user before logging anything they did not state. Refused in demo mode, when the folder is not writable, and on an encrypted export without HEALTH_EXPORT_PASSPHRASE (the file is sealed like the rest of the export when the passphrase is set). |
| remove_eventA | Remove an event that was logged with add_event (id starting "agent-", source "agent" in list_events) from health-events-agent.json. Events logged in the iOS app are refused: they are edited in the app. Removing an id that is already gone changes nothing and says so. Refused in demo mode and when the folder is not writable. |
| get_profileA | The context fields the user explicitly opted in to sharing (health-profile.json): conditions, medications, goals, allergies, notes. Returns the fields plus a presentFields list. An absent field was withheld by the user or never enabled; absence must never be read as "none". |
| get_workoutsA | Query the workouts cache with {activityType (a name like Running, or a raw HealthKit id like 37), start, end} filters and pagination ({limit} default 50 max 200, {cursor} from a previous nextCursor). Records are returned exactly as stored, including the newer optional keys (avgHeartRate, maxHeartRate, running dynamics, cycling power, intervals, hasRoute) when the app exported them; older caches simply lack those keys and nothing is fabricated. Also returns summary {count, byActivityType} over everything that matched. |
| get_sleep_sessionsA | Clustered sleep sessions from health-sessions.json with {start, end, day} filters. Sessions are attributed to the WAKING day, matching the daily cache's sleep_analysis, so the two surfaces never disagree; a split night appears as separate sessions with the same day. Duplicate copies of one night left by older app versions (sharing an end time with, or lying inside, a longer session on the same day) are collapsed to the longer one and counted in |
| get_cycle_contextA | Cycle context derived from user-logged period starts (health-cycles.json): day-in-cycle and a coarse phase label (follicular from day 1 to the observed midpoint of that cycle, luteal for the remainder). Derived from logged periods only, never predictive, and no ovulation estimate is made. Optional {date} for a single day; default returns per-day context for the last cycle. |
| correlate_metricsA | Pearson correlation between two metrics' daily values: {metricA, metricB, lag (0 to 3, default 0), start, end}. lag pairs metricA on day d with metricB on day d+lag, so lag 1 compares against the FOLLOWING day. Returns alignedPairs, r (withheld below 10 aligned pairs), and both means. The answer always carries the association-not-causation caveat; treat every r as alignment in this file, not mechanism. |
| resolve_metricA | Look a metric name up in the canonical naming and unit table. Accepts the export's own name (step_count), a HealthKit identifier (StepCount, HKQuantityTypeIdentifierStepCount), a display title (Step Count) or a common alias (steps, hrv, spo2, weight) and returns the canonical metric, its unit (percentages are 0 to 1 fractions), the unit variants other apps use with the exact formula into the canonical unit, and whether this export holds it. Pass {value, unit} to convert one value, e.g. 180 lb to kg. A word naming several metrics (distance, calories) comes back ambiguous with candidates, and a different measure (RMSSD vs the SDNN that Apple Health stores) is refused with the reason: nothing is guessed. get_health_metrics, get_trends, compare_periods, get_structured_export and correlate_metrics accept the same aliases and report |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| daily_brief | A short morning readout of the most recent day against its trailing week. |
| weekly_review | This week against last week across sleep, heart and activity. |
| doctor_visit_prep | A one-page data brief to bring to an upcoming appointment. |
| what_changed_since_last_visit | Changes in the data since the most recent logged doctor visit. |
| sleep_quality | A descriptive read of recent sleep: duration, stages, split nights. |
| sleep_regularity | How consistent sleep and wake times are, in minutes, with the sessions cited. |
| hrv_trend | Heart rate variability over the last month, segment-honest. |
| training_week_in_review | The last 7 days of workouts with intensity and structure. |
| race_week_prep | The training block a coach would want to see before race week. |
| zone_minutes_summary | Time by heart rate band across recent workouts, relative to this file. |
| experiment | Run an n-of-1 before/after read around a logged intervention event. |
| medication_before_after | Before/after read around a logged medication start. |
| glp1_dose_step_compare | Per-dose-step segments for weight and related metrics, honestly bounded. |
| sobriety_milestone | The data story since a logged quit date, with the early window reported separately. |
| shift_block_compare | On-shift days against off days using the day filter. |
| travel_honest_monthly_review | A monthly review with timezone-change days excluded and accounted for. |
| cycle_aware_trend_read | Read a metric trend against cycle phase, comparing like phase with like phase. |
| caregiver_daily_checkin | A calm daily check-in that separates data gaps from changes in the numbers. |
| glucose_day_summary | One day of glucose in the consensus reporting metrics, no advice. |
| long_term_activity_narrative | The multi-year activity story at monthly resolution. |
| data_coverage_audit | What this export actually contains: surfaces, ranges, gaps. |
| profile_aware_context_bootstrap | Open a session with the user's opted-in context loaded and its limits stated. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 18 tools
Most tools target distinct resources or analyses, but several retrieval tools overlap: get_health_metrics, get_structured_export, and query_health_data all return metric data over a date range, and get_mcp_status includes freshness information also covered by get_freshness. The descriptions help clarify preferred use cases, but an agent still has to choose carefully between these pairs.
The tool set consistently uses snake_case verb_noun names: get_*, list_*, add_event, remove_event, query_health_data, correlate_metrics, resolve_metric, and compare_periods. The pattern is predictable throughout, with no mixed conventions.
Eighteen tools are slightly above the typical compact range but reasonable for a health-data bridge covering metrics, workouts, sleep, events, freshness, profile, and cycle context. Each tool has a defensible role, though the set could be tightened by consolidating overlapping retrieval and freshness tools.
The surface is broad and well covered: metric discovery and resolution, day-level and intraday retrieval, trends, period comparison, correlation, workouts, sleep sessions, cycle context, profile, freshness/status, and event logging. Minor gaps remain, such as no update_event operation and limited workout-route detail, but core workflows are complete.