Skip to main content
Glama
tomekkorbak

Strava MCP Server

by tomekkorbak

get_activities

Retrieve recent Strava activities for the authenticated athlete, with configurable limits for data analysis and tracking.

Instructions

Get the authenticated athlete's recent activities.

Args:
    limit: Maximum number of activities to return (default: 10)

Returns:
    Dictionary containing activities data

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • MCP tool handler for 'get_activities': fetches recent Strava activities using the StravaClient, handles errors and client initialization.
    @mcp.tool()
    def get_activities(limit: int = 10) -> dict[str, Any]:
        """
        Get the authenticated athlete's recent activities.
    
        Args:
            limit: Maximum number of activities to return (default: 10)
    
        Returns:
            Dictionary containing activities data
        """
        if strava_client is None:
            return {
                "error": "Strava client not initialized. Please provide refresh token, client ID, and client secret."  # noqa: E501
            }
    
        try:
            activities = strava_client.get_activities(limit=limit)
            return {"data": activities}
        except Exception as e:
            return {"error": str(e)}
  • StravaClient helper method that performs the actual API call to retrieve activities, filters results, and is called by the tool handler.
    def get_activities(
        self, limit: int = 10, before: Optional[int] = None, after: Optional[int] = None
    ) -> list:
        """
        Get the authenticated athlete's activities.
    
        Args:
            limit: Maximum number of activities to return
            before: Unix timestamp to filter activities before this time
            after: Unix timestamp to filter activities after this time
    
        Returns:
            List of activities
        """
        params = {"per_page": limit}
    
        if before:
            params["before"] = before
    
        if after:
            params["after"] = after
    
        activities = self._make_request("athlete/activities", params)
        return self._filter_activities(activities)
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions authentication ('authenticated athlete') but doesn't specify required permissions, rate limits, pagination behavior, or what happens if no activities exist. For a read operation with zero annotation coverage, this is insufficient.

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

Conciseness5/5

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

The description is well-structured and concise, using three clear sections: a purpose statement, parameter explanation, and return value note. Every sentence adds value without redundancy, and it's appropriately front-loaded with the core functionality.

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?

Given the tool's moderate complexity (read operation with one parameter) and lack of annotations/output schema, the description is minimally adequate. It covers the basic purpose and parameter but misses behavioral details like error handling or response format. The return statement is vague ('Dictionary containing activities data'), leaving gaps for the agent.

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?

The description adds meaningful context for the single parameter 'limit' by explaining it's the 'Maximum number of activities to return (default: 10)'. Since schema description coverage is 0% and there's only one parameter, this adequately compensates. However, it doesn't detail constraints like minimum/maximum values or how ordering works.

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's purpose: 'Get the authenticated athlete's recent activities.' It specifies the verb ('Get'), resource ('activities'), and scope ('authenticated athlete's recent'). However, it doesn't explicitly distinguish this tool from its siblings like 'get_recent_activities' or 'get_activities_by_date_range', which appear to serve similar functions.

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. With sibling tools like 'get_recent_activities' and 'get_activities_by_date_range' available, there's no indication of differences in scope, filtering, or use cases. This leaves the agent to guess based on tool names alone.

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/tomekkorbak/strava-mcp-server'

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