get_activities
Retrieve recent Strava activities to analyze training progress, compare workouts, and access detailed activity logs for performance tracking.
Instructions
Get a list of recent Strava activities
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of activities to return (1-100) | |
| page | No | Page number for pagination |
Implementation Reference
- src/index.ts:110-118 (handler)The handler function that executes the `get_activities` tool logic by fetching athlete activities from the Strava API.
async ({ limit, page }) => { const activities = await stravaFetch( `/athlete/activities?per_page=${limit}&page=${page}` ); return { content: [{ type: "text", text: JSON.stringify(activities, null, 2) }], }; } ); - src/index.ts:94-118 (registration)The registration of the `get_activities` tool with its schema definition and handler.
server.tool( "get_activities", "Get a list of recent Strava activities", { limit: z .number() .min(1) .max(100) .default(10) .describe("Number of activities to return (1-100)"), page: z .number() .min(1) .default(1) .describe("Page number for pagination"), }, async ({ limit, page }) => { const activities = await stravaFetch( `/athlete/activities?per_page=${limit}&page=${page}` ); return { content: [{ type: "text", text: JSON.stringify(activities, null, 2) }], }; } );