get_lactate_threshold
Retrieve your lactate threshold heart rate and pace. Get the latest value by omitting dates, or view historical trends with daily, weekly, or monthly aggregation.
Instructions
Get lactate threshold data: HR and pace. Omit dates for latest. Provide dates for historical trend with aggregation (daily/weekly/monthly)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| startDate | No | Start date in YYYY-MM-DD format. Omit for latest value only | |
| endDate | No | End date in YYYY-MM-DD format. Required if startDate is provided | |
| aggregation | No | Aggregation type: daily, weekly, or monthly. Defaults to daily | daily |
Implementation Reference
- src/tools/performance.tools.ts:143-156 (registration)Tool 'get_lactate_threshold' is registered via server.registerTool with input schema from getLactateThresholdSchema. The handler calls client.getLactateThreshold() and returns JSON-formatted results.
server.registerTool( 'get_lactate_threshold', { description: 'Get lactate threshold data: HR and pace. Omit dates for latest. Provide dates for historical trend with aggregation (daily/weekly/monthly)', inputSchema: getLactateThresholdSchema.shape, }, async ({ startDate, endDate, aggregation }) => { const data = await client.getLactateThreshold(startDate, endDate, aggregation ?? 'daily'); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/tools/performance.tools.ts:150-155 (handler)Handler function for get_lactate_threshold: calls client.getLactateThreshold(startDate, endDate, aggregation ?? 'daily') and returns content as JSON string.
async ({ startDate, endDate, aggregation }) => { const data = await client.getLactateThreshold(startDate, endDate, aggregation ?? 'daily'); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, - src/dtos/performance.dto.ts:24-42 (schema)Type definition (GetLactateThresholdDto) and Zod schema (getLactateThresholdSchema) defining optional startDate, endDate, and aggregation (daily/weekly/monthly, default daily) inputs.
export type GetLactateThresholdDto = { startDate?: string; endDate?: string; aggregation?: string; }; export const getLactateThresholdSchema = z.object({ startDate: dateString .optional() .describe('Start date in YYYY-MM-DD format. Omit for latest value only'), endDate: dateString .optional() .describe('End date in YYYY-MM-DD format. Required if startDate is provided'), aggregation: z .enum(['daily', 'weekly', 'monthly']) .default('daily') .optional() .describe('Aggregation type: daily, weekly, or monthly. Defaults to daily'), }); - src/client/garmin.client.ts:439-446 (helper)Client-side method getLactateThreshold: if no dates provided, fetches from LACTATE_THRESHOLD_ENDPOINT (latest); otherwise fetches from BIOMETRIC_STATS_ENDPOINT with startDate, endDate, and aggregation params.
async getLactateThreshold(startDate?: string, endDate?: string, aggregation = 'daily'): Promise<unknown> { if (!startDate || !endDate) { return this.request(LACTATE_THRESHOLD_ENDPOINT); } return this.request( `${BIOMETRIC_STATS_ENDPOINT}?startDate=${startDate}&endDate=${endDate}&aggregation=${aggregation}`, ); } - Endpoint constant LACTATE_THRESHOLD_ENDPOINT = '/biometric-service/biometric/latestLactateThreshold' and BIOMETRIC_STATS_ENDPOINT = '/biometric-service/stats' (line 108) used by the client method.
export const LACTATE_THRESHOLD_ENDPOINT = '/biometric-service/biometric/latestLactateThreshold';