get-daily-respiration
Retrieve daily respiration rate data from Garmin Connect for a specified date to monitor respiratory patterns.
Instructions
Get respiration rate data for a date
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | YYYY-MM-DD, defaults to today |
Implementation Reference
- src/tools.ts:418-432 (registration)Tool registration for 'get-daily-respiration' on the MCP server. Calls the Garmin wellness API endpoint 'wellness-service/wellness/daily/respiration/{date}' to fetch respiration rate data for a given date (defaults to today).
server.tool( "get-daily-respiration", "Get respiration rate data for a date", { date: z.string().optional().describe("YYYY-MM-DD, defaults to today"), }, async ({ date }) => { const client = getClient(); const d = date ?? todayDate(); const data = await client.get( `wellness-service/wellness/daily/respiration/${d}` ); return jsonResult(data); } ); - src/tools.ts:418-432 (handler)The handler function that executes the tool logic: gets the Garmin client, resolves the date (defaulting to today), and fetches respiration data from the wellness API.
server.tool( "get-daily-respiration", "Get respiration rate data for a date", { date: z.string().optional().describe("YYYY-MM-DD, defaults to today"), }, async ({ date }) => { const client = getClient(); const d = date ?? todayDate(); const data = await client.get( `wellness-service/wellness/daily/respiration/${d}` ); return jsonResult(data); } ); - src/tools.ts:418-432 (schema)Input schema: accepts an optional 'date' parameter (YYYY-MM-DD string, defaults to today). Output is the raw JSON response from the Garmin API.
server.tool( "get-daily-respiration", "Get respiration rate data for a date", { date: z.string().optional().describe("YYYY-MM-DD, defaults to today"), }, async ({ date }) => { const client = getClient(); const d = date ?? todayDate(); const data = await client.get( `wellness-service/wellness/daily/respiration/${d}` ); return jsonResult(data); } ); - src/test.ts:337-343 (helper)Test definition for 'get-daily-respiration' used in the test plan/runner. Calls the tool and throws if it returns an error.
{ name: "get-daily-respiration", run: async (server) => { const result = await callTool(server, "get-daily-respiration"); if (result.isError) throw new Error(getToolText(result)); }, }, - src/tools.ts:951-951 (helper)Test plan documentation (within the run-tests tool) listing get-daily-respiration as a test case that should return respiration data.
- get-daily-respiration -> should return respiration data