get_activity_detail
Retrieve comprehensive activity data including laps and intervals from intervals.icu training logs for detailed performance analysis and workout planning.
Instructions
Get full detail for a single activity including laps and intervals.
Args: activity_id: The activity ID (visible in the intervals.icu URL).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| activity_id | Yes |
Implementation Reference
- main.py:55-62 (handler)The main handler function for the 'get_activity_detail' tool. It takes an activity_id parameter and returns full activity details by making a GET request to the Intervals.icu API endpoint /activity/{activity_id}.
@mcp.tool() def get_activity_detail(activity_id: str) -> dict: """Get full detail for a single activity including laps and intervals. Args: activity_id: The activity ID (visible in the intervals.icu URL). """ return _get(f"/activity/{activity_id}") - main.py:18-22 (helper)Helper function _get() that performs authenticated HTTP GET requests to the Intervals.icu API and returns JSON responses.
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 authenticated httpx Client with API credentials and base URL configured.
def _client() -> httpx.Client: return httpx.Client(auth=("API_KEY", API_KEY), base_url=BASE_URL) - main.py:11-11 (registration)FastMCP server instance creation which serves as the registration point for all tools including get_activity_detail.
mcp = FastMCP("intervals")