Skip to content

Tools Reference

import { Aside } from ‘@astrojs/starlight/components’;

All tools authenticate via your personal API key (set in FITREPO_API_KEY). Date strings use ISO 8601 format (YYYY-MM-DD or full RFC 3339).


Returns a paginated list of activities, newest first.

Parameters

NameTypeRequiredDescription
sportstringNoFilter by sport type (e.g. cycling, running, swimming)
fromstringNoStart date (inclusive), e.g. 2025-01-01
tostringNoEnd date (inclusive), e.g. 2025-03-31
limitintegerNoResults per page (default 50, max 200)
offsetintegerNoPagination offset (default 0)

Returns

{
"activities": [
{
"id": "uuid",
"sport": "cycling",
"started_at": "2025-03-15T07:30:00Z",
"duration_secs": 3720,
"distance_meters": 48200,
"elevation_gain": 420,
"tss": 82,
"normalized_power": 218,
"intensity_factor": 0.87,
"avg_hr": 148,
"max_hr": 172
}
],
"total": null,
"offset": 0,
"limit": 50
}

Example prompt

“List my cycling activities from January 2025.”


Returns full detail for a single activity, including all stored fields, best efforts, and a fitness snapshot at the time of the activity.

Parameters

NameTypeRequiredDescription
idstringYesActivity UUID

Returns — full activity object plus a fitness_at_activity field:

{
"fitness_at_activity": {
"date": "2026-05-30",
"ctl": 68.4,
"atl": 82.1,
"tsb": -13.7,
"note": "Computed from power-based TSS only..."
}
}

fitness_at_activity is null if the activity has no date or there is no TSS history to compute from. TSB is positive when fresh, negative when fatigued. See Fitness Model for definitions.

Example prompts

“Show me the details of my last race.” “How fatigued was I during yesterday’s ride?” “Was my power output good given my fitness at the time?”


Returns daily CTL, ATL and TSB (training stress balance) for a date range.

Parameters

NameTypeRequiredDescription
fromstringNoStart date, e.g. 2025-01-01
tostringNoEnd date, e.g. 2025-03-31

Returns

{
"timeline": [
{
"date": "2025-01-01",
"ctl": 68.4,
"atl": 72.1,
"tsb": -3.7
}
],
"meta": {
"ctl_time_constant_days": 42,
"atl_time_constant_days": 7,
"note": "TSB = yesterday CTL − ATL. Positive = fresh, negative = fatigued."
}
}

See Fitness Model for how CTL/ATL/TSB are calculated.

Example prompts

“What was my CTL at the start of my build block in February?” “Plot my TSB over the last 3 months.”


Returns mean-maximal power (MMP) records — your best average power for standard durations — plus a per-activity breakdown.

Parameters

NameTypeRequiredDescription
sportstringNoSport to filter by (default: cycling)
fromstringNoOnly consider activities on or after this date
tostringNoOnly consider activities on or before this date

Returns

{
"sport": "cycling",
"from": null,
"to": null,
"all_time_best": {
"p5s": 920,
"p10s": 840,
"p30s": 620,
"p1m": 520,
"p2m": 460,
"p5m": 380,
"p10m": 340,
"p20m": 312,
"p60m": 268
},
"per_activity": [
{
"id": "uuid",
"started_at": "2025-03-15T07:30:00Z",
"best_efforts": { "p5s": 820, "p20m": 305 }
}
]
}

Duration keys: p5s (5 s), p10s, p30s, p1m, p2m, p5m, p10m, p20m, p60m — values are watts. A key is omitted from all_time_best if no activity has data for that duration.

See Best Efforts (MMP) for methodology.

Example prompts

“What’s my best 20-minute power in the last 6 months?” “How does my 5-second sprint compare to 12 months ago?”


Returns wellness log entries (HRV, resting HR, sleep, readiness).

Parameters

NameTypeRequiredDescription
fromstringNoStart date
tostringNoEnd date
sourcestringNoFilter by data source (e.g. oura, garmin, manual)

Returns

{
"wellness": [
{
"date": "2025-03-15",
"source": "oura",
"weight_kg": 72.1,
"rhr_bpm": 42,
"hrv_rmssd": 68.2,
"sleep_hours": 7.8,
"sleep_score": 82,
"readiness": 84
}
]
}

See Wellness for field definitions.

Example prompts

“How does my HRV trend around hard training weeks?” “Show me my sleep hours and readiness scores for March.”


Returns your FTP and lactate threshold heart rate (LTHR) history.

Parameters

NameTypeRequiredDescription
metricstringNoFilter by metric: ftp or lthr — omit for all

Returns

{
"thresholds": [
{
"metric": "ftp",
"value": 265,
"effective_from": "2025-01-15",
"source": "auto",
"notes": null
}
],
"note": "Use effective_from to find the threshold active on any given date."
}

source is auto (detected from activity data) or manual (entered in Settings).

See Thresholds for full documentation.

Example prompts

“How has my FTP changed over the last year?” “When did I last update my LTHR?”


Returns your athlete profile.

Parameters — none.

Returns

{
"date_of_birth": "1988-04-12",
"sex": "male",
"height_cm": 178,
"created_at": "2025-01-01T00:00:00Z",
"updated_at": "2025-03-15T09:00:00Z"
}

Returns {} if no profile has been set up yet.

Example prompt

“What’s my weight-to-power ratio based on my current FTP?”