Skip to main content
Glama

get_activities

Retrieve athletic activity data from intervals.icu with date range and sport type filters to analyze training performance and plan workouts.

Instructions

List activities with optional filters.

Args: oldest: Start date in YYYY-MM-DD format (inclusive). newest: End date in YYYY-MM-DD format (inclusive). sport_type: Filter by sport type (e.g. 'Ride', 'Run', 'Swim').

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
oldestNo
newestNo
sport_typeNo

Implementation Reference

  • main.py:31-52 (handler)
    The main implementation of the 'get_activities' tool. It lists activities with optional date range filters (oldest/newest) and sport type filtering. Uses the _get helper to make HTTP requests to the intervals.icu API and filters results by sport_type client-side if specified.
    @mcp.tool()
    def get_activities(
        oldest: str | None = None,
        newest: str | None = None,
        sport_type: str | None = None,
    ) -> list:
        """List activities with optional filters.
    
        Args:
            oldest: Start date in YYYY-MM-DD format (inclusive).
            newest: End date in YYYY-MM-DD format (inclusive).
            sport_type: Filter by sport type (e.g. 'Ride', 'Run', 'Swim').
        """
        params: dict[str, Any] = {}
        if oldest:
            params["oldest"] = oldest
        if newest:
            params["newest"] = newest
        activities = _get(f"/athlete/{ATHLETE_ID}/activities", params)
        if sport_type:
            activities = [a for a in activities if a.get("type") == sport_type]
        return activities
  • main.py:25-31 (registration)
    The @mcp.tool() decorator that registers 'get_activities' as an MCP tool. FastMCP uses Python type hints for input validation and the docstring for parameter descriptions.
    @mcp.tool()
    def get_athlete() -> dict:
        """Get athlete profile including sport zones and thresholds."""
        return _get(f"/athlete/{ATHLETE_ID}")
    
    
    @mcp.tool()
  • main.py:18-22 (helper)
    Helper function '_get' used by get_activities to make authenticated HTTP GET requests to the intervals.icu API. Returns JSON response.
    def _get(path: str, params: dict[str, Any] | None = None) -> Any:
        with _client() as client:
            r = client.get(path, params=params)
            r.raise_for_status()
            return r.json()
  • main.py:14-15 (helper)
    Helper function '_client' that creates an httpx Client with API authentication and base URL configured for intervals.icu API calls.
    def _client() -> httpx.Client:
        return httpx.Client(auth=("API_KEY", API_KEY), base_url=BASE_URL)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal operational context. While it notes filters are 'optional,' it fails to mention critical list-operation behaviors such as pagination, result limits, rate limiting, or the structure/format of returned activities.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately concise and front-loaded, presenting the core purpose in the first sentence followed by an Args section detailing parameters. The structure is efficient with minimal redundancy, though the docstring-style Args format is slightly more verbose than inline prose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is minimally viable for a listing tool with three optional parameters and no output schema. It adequately covers parameter semantics but lacks essential completeness given the absence of an output schema—it should describe the return value structure (e.g., 'returns a list of activity objects') and pagination behavior expected for list endpoints.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Given 0% schema description coverage, the description effectively compensates by documenting all three parameters with useful semantics: it specifies date formats (YYYY-MM-DD) and inclusivity for date ranges, and provides concrete examples ('Ride', 'Run', 'Swim') for the sport_type filter, adding significant value beyond the raw schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool 'List activities' with optional filters, providing a specific verb and resource. However, it does not explicitly differentiate from sibling tool 'get_activity_detail' (which likely retrieves a single activity versus listing multiple), leaving the distinction to be inferred from the tool names alone.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'get_activity_detail' or other sibling tools. There are no stated prerequisites, exclusion criteria, or scenarios recommending this tool over others for specific use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/ryansheppard/intervals.mcp'

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