get_daily_health_snapshot
Aggregate complete daily health metrics including heart rate, stress, body battery, sleep, HRV, respiration, SpO2, steps, floors, and intensity minutes in a single request. Defaults to today's data, or yesterday if today's is unavailable.
Instructions
Get complete daily health snapshot in a single call: summary, heart rate, stress, body battery, sleep, HRV, respiration, SpO2, steps, floors, intensity minutes. Calls ~11 endpoints in parallel. Use yesterday if today has no data yet
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Date in YYYY-MM-DD format. Defaults to today if not provided |
Implementation Reference
- src/client/garmin.client.ts:634-666 (handler)Core handler that executes the tool logic: fetches daily summary, heart rate, stress, body battery, sleep, HRV, respiration, SpO2, steps, floors, and intensity minutes in parallel, returning a combined snapshot object.
async getDailyHealthSnapshot(date?: string): Promise<Record<string, unknown>> { const resolvedDate = date ?? todayString(); const [summary, heartRate, stress, bodyBattery, sleep, hrv, respiration, spo2, steps, floors, intensityMinutes] = await Promise.all([ this.getDailySummary(resolvedDate).catch(() => null), this.getHeartRate(resolvedDate).catch(() => null), this.getStress(resolvedDate).catch(() => null), this.getBodyBattery(resolvedDate, resolvedDate).catch(() => null), this.getSleepData(resolvedDate).catch(() => null), this.getHRV(resolvedDate).catch(() => null), this.getRespiration(resolvedDate).catch(() => null), this.getSpO2(resolvedDate).catch(() => null), this.getStepsChart(resolvedDate).catch(() => null), this.getFloors(resolvedDate).catch(() => null), this.getIntensityMinutes(resolvedDate).catch(() => null), ]); return { date: resolvedDate, summary, heartRate, stress, bodyBattery, sleep, hrv, respiration, spo2, steps, floors, intensityMinutes, }; } - src/tools/snapshot.tools.ts:5-20 (registration)Registers the 'get_daily_health_snapshot' tool on the MCP server with its description, input schema, and callback that delegates to the client.
export function registerSnapshotTools(server: McpServer, client: GarminClient): void { server.registerTool( 'get_daily_health_snapshot', { description: 'Get complete daily health snapshot in a single call: summary, heart rate, stress, body battery, sleep, HRV, respiration, SpO2, steps, floors, intensity minutes. Calls ~11 endpoints in parallel. Use yesterday if today has no data yet', inputSchema: dateParamSchema.shape, }, async ({ date }) => { const data = await client.getDailyHealthSnapshot(date); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); } - src/dtos/date-params.dto.ts:8-12 (schema)Zod schema for the optional 'date' parameter used as input to the tool.
export const dateParamSchema = z.object({ date: dateString .optional() .describe('Date in YYYY-MM-DD format. Defaults to today if not provided'), }); - src/index.ts:47-47 (registration)Top-level registration call that wires the snapshot tools to the server and client.
registerSnapshotTools(server, client); - src/tools/index.ts:9-12 (helper)Re-exports registerSnapshotTools from the snapshot.tools module.
export { registerSnapshotTools } from './snapshot.tools'; export { registerTrainingTools } from './training.tools'; export { registerWellnessTools } from './wellness.tools'; export { registerChallengeTools } from './challenges.tools';