get_resting_heart_rate
Retrieve your resting heart rate for a given date to monitor cardiovascular health trends.
Instructions
Get resting heart rate data for a specific date
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Date in YYYY-MM-DD format. Defaults to today if not provided |
Implementation Reference
- src/tools/health.tools.ts:64-76 (registration)Tool registration for 'get_resting_heart_rate' in the MCP server, with input schema from dateParamSchema and handler delegating to GarminClient.getRestingHeartRate
server.registerTool( 'get_resting_heart_rate', { description: 'Get resting heart rate data for a specific date', inputSchema: dateParamSchema.shape, }, async ({ date }) => { const data = await client.getRestingHeartRate(date); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/tools/health.tools.ts:70-76 (handler)Handler function for get_resting_heart_rate -- calls client.getRestingHeartRate(date) and returns JSON-stringified result
async ({ date }) => { const data = await client.getRestingHeartRate(date); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/client/garmin.client.ts:272-277 (helper)Client method that makes the actual API request to Garmin Connect using RHR_ENDPOINT (/userstats-service/wellness/daily), passing displayName, date range, and metricId=60
async getRestingHeartRate(date?: string): Promise<unknown> { const resolvedDate = date ?? todayString(); return this.request( `${RHR_ENDPOINT}/${this.displayName}?fromDate=${resolvedDate}&untilDate=${resolvedDate}&metricId=${RHR_METRIC_ID}`, ); } - src/dtos/date-params.dto.ts:8-12 (schema)Input schema (dateParamSchema) used by get_resting_heart_rate -- validates optional date string in YYYY-MM-DD format
export const dateParamSchema = z.object({ date: dateString .optional() .describe('Date in YYYY-MM-DD format. Defaults to today if not provided'), }); - API endpoint constant used by RHR request
export const RHR_ENDPOINT = '/userstats-service/wellness/daily'; export const DAILY_STEPS_ENDPOINT = '/usersummary-service/stats/steps/daily'; - Metric ID constant (60) used in the Resting Heart Rate API request
export const RHR_METRIC_ID = 60;