Skip to main content
Glama
KerkhofMe
by KerkhofMe

get_activities_between

Retrieve Strava activities within a specified date range using ISO 8601 formatted start and end dates to analyze training data and track fitness progress.

Instructions

Get Strava activities within a specific date range

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
afterYesStart date (ISO 8601, e.g. 2025-01-01)
beforeYesEnd date (ISO 8601, e.g. 2025-12-31)

Implementation Reference

  • Registration and handler implementation for the "get_activities_between" tool in src/index.ts. It defines the parameters using Zod and performs the API call to fetch activities within the provided date range.
    server.tool(
      "get_activities_between",
      "Get Strava activities within a specific date range",
      {
        after: z
          .string()
          .describe("Start date (ISO 8601, e.g. 2025-01-01)"),
        before: z
          .string()
          .describe("End date (ISO 8601, e.g. 2025-12-31)"),
      },
      async ({ after, before }) => {
        const afterEpoch = Math.floor(new Date(after).getTime() / 1000);
        const beforeEpoch = Math.floor(new Date(before).getTime() / 1000);
        const activities = await stravaFetch(
          `/athlete/activities?after=${afterEpoch}&before=${beforeEpoch}&per_page=100`
        );
        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