get_athlete_stats
Retrieve lifetime and recent fitness statistics for authenticated athletes, including total runs, rides, swims, and distances to analyze training progress.
Instructions
Get lifetime and recent statistics for the authenticated athlete (total runs, rides, swims, distances, etc.)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:80-90 (handler)The `get_athlete_stats` tool handler implementation. It first fetches the athlete ID using `/athlete` and then fetches the stats using `/athletes/${athlete.id}/stats`.
server.tool( "get_athlete_stats", "Get lifetime and recent statistics for the authenticated athlete (total runs, rides, swims, distances, etc.)", {}, async () => { const athlete = (await stravaFetch("/athlete")) as { id: number }; const stats = await stravaFetch(`/athletes/${athlete.id}/stats`); return { content: [{ type: "text", text: JSON.stringify(stats, null, 2) }], }; }