get_vo2max
Retrieve VO2 Max estimate for running and cycling on a specific date. For today's data, use yesterday as availability may be delayed.
Instructions
Get VO2 Max estimate for a date (running and cycling). Data may not be available for today, use yesterday. For ranges use get_vo2max_range
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:383-386 (handler)Handler that calls the Garmin API endpoint to fetch VO2 Max data for a given date. Uses the VO2_MAX_ENDPOINT constant.
async getVO2Max(date?: string): Promise<unknown> { const resolvedDate = date ?? todayString(); return this.request(`${VO2_MAX_ENDPOINT}/${resolvedDate}/${resolvedDate}`); } - src/dtos/date-params.dto.ts:8-12 (schema)Input schema for the get_vo2max tool. Requires 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/performance.tools.ts:10-24 (registration)Registration of the 'get_vo2max' tool on the MCP server with description and handler that delegates to client.getVO2Max(date).
export function registerPerformanceTools(server: McpServer, client: GarminClient): void { server.registerTool( 'get_vo2max', { description: 'Get VO2 Max estimate for a date (running and cycling). Data may not be available for today, use yesterday. For ranges use get_vo2max_range', inputSchema: dateParamSchema.shape, }, async ({ date }) => { const data = await client.getVO2Max(date); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - API endpoint constant for VO2 Max data: /metrics-service/metrics/maxmet/daily
export const VO2_MAX_ENDPOINT = '/metrics-service/metrics/maxmet/daily'; export const TRAINING_READINESS_ENDPOINT = '/metrics-service/metrics/trainingreadiness'; - src/tools/range.tools.ts:96-109 (registration)Registration of the related 'get_vo2max_range' tool that fetches VO2 Max over a date range.
server.registerTool( 'get_vo2max_range', { description: 'Get VO2 Max data over a date range (day-by-day). Returns array of {date, data} records', inputSchema: dateRangeParamSchema.shape, }, async ({ startDate, endDate }) => { const data = await client.getVO2MaxRange(startDate, endDate); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, );