get_progress_summary
Aggregate fitness progress by activity type for a date range: view total distance, duration, or calories. Track your training trends with stats from Garmin Connect.
Instructions
Get fitness progress stats over a date range: distance, duration, or calories grouped by activity type
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| startDate | Yes | Start date in YYYY-MM-DD format | |
| endDate | Yes | End date in YYYY-MM-DD format | |
| metric | No | Metric to aggregate: distance, duration, calories. Defaults to distance | distance |
Implementation Reference
- src/tools/activities.tools.ts:231-237 (handler)Handler function for get_progress_summary tool. Calls client.getProgressSummary with startDate, endDate, and metric params, then returns the result as JSON text.
async ({ startDate, endDate, metric }) => { const data = await client.getProgressSummary(startDate, endDate, metric ?? 'distance'); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/tools/activities.tools.ts:224-237 (registration)Registration of get_progress_summary tool via server.registerTool with description and input schema.
server.registerTool( 'get_progress_summary', { description: 'Get fitness progress stats over a date range: distance, duration, or calories grouped by activity type', inputSchema: getProgressSummarySchema.shape, }, async ({ startDate, endDate, metric }) => { const data = await client.getProgressSummary(startDate, endDate, metric ?? 'distance'); return { content: [{ type: 'text' as const, text: JSON.stringify(data, null, 2) }], }; }, ); - src/dtos/activities.dto.ts:59-67 (schema)Zod schema for get_progress_summary input validation: startDate (date string), endDate (date string), metric (optional, defaults to 'distance').
export const getProgressSummarySchema = z.object({ startDate: dateString.describe('Start date in YYYY-MM-DD format'), endDate: dateString.describe('End date in YYYY-MM-DD format'), metric: z .string() .default('distance') .optional() .describe('Metric to aggregate: distance, duration, calories. Defaults to distance'), }); - src/client/garmin.client.ts:251-255 (helper)Helper method in GarminClient that makes the HTTP request to the Garmin fitness stats API with startDate, endDate, aggregation, groupByParentActivityType, and metric query parameters.
async getProgressSummary(startDate: string, endDate: string, metric = 'distance'): Promise<unknown> { return this.request( `${FITNESS_STATS_ENDPOINT}?startDate=${startDate}&endDate=${endDate}&aggregation=${FITNESS_STATS_AGGREGATION}&groupByParentActivityType=true&metric=${metric}`, ); } - src/dtos/activities.dto.ts:53-57 (schema)TypeScript type definition for GetProgressSummaryDto.
export type GetProgressSummaryDto = { startDate: string; endDate: string; metric?: string; };