MCP server to query an exported Apple Health archive (export.zip) via SQLite.
Five tools with complete, well-structured schemas and descriptions. All parameters are typed and annotated with Field metadata. Descriptions are clear and actionable (avg ~180 chars), explaining WHAT each tool does and WHEN to use it. Tool names follow verb_noun convention (list_*, get_*). Output schemas are documented via Pydantic models (TypeInfo, SourceInfo, QuantityPoint, SleepNight, WorkoutSummary). Error handling converts exceptions to ToolError with user-facing messages. Main gaps: no pagination support (tools return all results), no confirmation pattern for destructive ops (though all are read-only), and parameter descriptions could include more constraint details (e.g., date range limits, result size caps).
Aggregate a numeric metric (steps, weight, heart rate, energy…) over a date range. Call `list_types` first to find the exact `type` string. Pick `agg` by metric kind: `sum` for cumulative (steps, active energy), `avg` for sampled (weight, heart rate). `sum` auto-deduplicates parallel devices (Watch + iPhone + apps) per day, so it does not over-count (ADR-0010); pass `source` to force one device. `avg/min/max` are not deduped. Returns [{period, value, n}].
Per-night sleep stage durations (minutes), attributed to the wake-up day. Returns [{night, asleep_min, rem_min, deep_min, core_min, awake_min, in_bed_min}]. Older nights may report only in_bed_min (legacy devices lack stage detail).
Workout summary per activity type in a date range: count, total & avg minutes.
List which sources/devices wrote a metric, with counts and date spans. Use it to see why a `sum` differs across devices, or to pick a `source` for `get_quantity`.
List which health metrics exist in this export, with row counts and date spans. Call this first to discover the exact `type` strings to pass to `get_quantity`.
No pagination or result limits documented. Tools return all matching rows without cap or offset/limit parameters. Large exports could return thousands of records, exhausting context windows.
Parameter descriptions lack explicit constraints. 'start' and 'end' have regex patterns but no guidance on valid ranges (e.g., 'must be within export date span'). 'agg' enum is clear but 'bucket' lacks examples of when to use each option.
get_quantity description references 'ADR-0010' (architecture decision record) without explaining the deduplication logic inline. LLMs cannot follow external references; the description should state: 'sum auto-deduplicates parallel devices per day to avoid over-counting.'
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | C | 65 | 2026-07-28+ | v2 |
No error recovery guidance. If a tool fails (e.g., invalid date range, missing DB), ToolError is raised but the message does not suggest next steps. E.g., 'Database not found. Run: apple-health-export-mcp-ingest <export.zip>'
Output schemas (TypeInfo, SourceInfo, etc.) are defined in queries.py but not visible in the provided source. Cannot verify field names, types, or whether they include chaining IDs needed for multi-step workflows.