get_spo2
Retrieve blood oxygen saturation (SpO2) data for a given date. Accepts a date in YYYY-MM-DD format.
Instructions
Get blood oxygen saturation (SpO2) data for a specific date. Single date; for ranges use get_spo2_range
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:136-148 (handler)Registration and handler for the get_spo2 tool. Calls client.getSpO2(date) and returns formatted JSON response.
server.registerTool( 'get_spo2', { description: 'Get blood oxygen saturation (SpO2) data for a specific date. Single date; for ranges use get_spo2_range', inputSchema: dateParamSchema.shape, }, async ({ date }) => { const data = await client.getSpO2(date); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/client/garmin.client.ts:298-301 (handler)Client method that makes the actual API request to the Garmin SpO2 endpoint. Defaults to today's date if none provided.
async getSpO2(date?: string): Promise<unknown> { const resolvedDate = date ?? todayString(); return this.request(`${DAILY_SPO2_ENDPOINT}/${resolvedDate}`); } - src/dtos/date-params.dto.ts:8-12 (schema)Input schema used by get_spo2 tool: accepts an 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'), }); - src/tools/health.tools.ts:136-148 (registration)Tool registered under name 'get_spo2' on the MCP server.
server.registerTool( 'get_spo2', { description: 'Get blood oxygen saturation (SpO2) data for a specific date. Single date; for ranges use get_spo2_range', inputSchema: dateParamSchema.shape, }, async ({ date }) => { const data = await client.getSpO2(date); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - API endpoint constant for SpO2 data: /wellness-service/wellness/daily/spo2
export const DAILY_SPO2_ENDPOINT = '/wellness-service/wellness/daily/spo2';