get_respiration
Retrieve daily respiration rate data for a specified date. Useful for monitoring breathing patterns and respiratory health trends.
Instructions
Get daily respiration rate data throughout the day. Single date; for ranges use get_respiration_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:122-133 (handler)Tool registration and handler for 'get_respiration'. Registers the tool with MCP server, accepts an optional date parameter (defaults to today), calls client.getRespiration(), and returns the data as JSON.
server.registerTool( 'get_respiration', { description: 'Get daily respiration rate data throughout the day. Single date; for ranges use get_respiration_range', inputSchema: dateParamSchema.shape, }, async ({ date }) => { const data = await client.getRespiration(date); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, - src/dtos/date-params.dto.ts:8-12 (schema)Input schema for the get_respiration tool. Defines an optional 'date' parameter in YYYY-MM-DD format (defaults to today).
export const dateParamSchema = z.object({ date: dateString .optional() .describe('Date in YYYY-MM-DD format. Defaults to today if not provided'), }); - src/client/garmin.client.ts:293-296 (handler)Client method getRespiration() - the low-level handler that calls the Garmin API endpoint. Uses DAILY_RESPIRATION_ENDPOINT and defaults to today's date if none provided.
async getRespiration(date?: string): Promise<unknown> { const resolvedDate = date ?? todayString(); return this.request(`${DAILY_RESPIRATION_ENDPOINT}/${resolvedDate}`); } - src/constants/garmin-endpoints.ts:5-5 (registration)API endpoint constant DAILY_RESPIRATION_ENDPOINT mapping to '/wellness-service/wellness/daily/respiration'.
export const DAILY_RESPIRATION_ENDPOINT = '/wellness-service/wellness/daily/respiration';