Skip to main content
Glama
KerkhofMe
by KerkhofMe

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
NameRequiredDescriptionDefault
limitNoNumber of activities to return (1-100)
pageNoPage number for pagination

Implementation Reference

  • 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) }],
        };
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/KerkhofMe/StravaMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server