get_fitness
Retrieve CTL, ATL, and TSB fitness time series data from intervals.icu to analyze athletic performance trends and monitor training load over specified date ranges.
Instructions
Get CTL/ATL/TSB fitness time series.
Args: oldest: Start date in YYYY-MM-DD format (inclusive). newest: End date in YYYY-MM-DD format (inclusive).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| oldest | No | ||
| newest | No |
Implementation Reference
- main.py:66-81 (handler)The get_fitness tool handler function. Takes optional oldest/newest date parameters and returns CTL/ATL/TSB fitness time series data by calling the wellness endpoint.
def get_fitness( oldest: str | None = None, newest: str | None = None, ) -> list: """Get CTL/ATL/TSB fitness time series. Args: oldest: Start date in YYYY-MM-DD format (inclusive). newest: End date in YYYY-MM-DD format (inclusive). """ params: dict[str, Any] = {} if oldest: params["oldest"] = oldest if newest: params["newest"] = newest return _get(f"/athlete/{ATHLETE_ID}/wellness", params) - main.py:65-65 (registration)The @mcp.tool() decorator that registers get_fitness as an MCP tool.
@mcp.tool() - main.py:18-22 (helper)Helper function _get used by get_fitness to make authenticated HTTP GET requests to the Intervals.icu API.
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()