Skip to main content
Glama
fastf1-mcp-server

fastf1-mcp-server

by Surya96t

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
FASTF1_MCP_LOG_LEVELNoPython logging levelINFO
FASTF1_MCP_FASTF1_CACHE_PATHNoDisk cache for FastF1 session files~/.fastf1_cache
FASTF1_MCP_MAX_CACHED_SESSIONSNoMax sessions held in memory (LRU)10
FASTF1_MCP_MAX_TELEMETRY_SAMPLESNoHard cap on telemetry sample points500
FASTF1_MCP_DEFAULT_TELEMETRY_SAMPLESNoDefault telemetry sample points200

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Formula 1 data via FastF1 - telemetry, timing, standings, and more

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}
logging
{}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
extensions
{
  "io.modelcontextprotocol/ui": {}
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_scheduleA

Get the F1 race calendar for a season.

Data source: Ergast API (via FastF1) Coverage: 1950-present

Args: year: Season year (1950-present)

Returns: List of events with: round, raceName, circuitName, country, date, time (if available)

Example: get_schedule(2024) → [ {"round": 1, "raceName": "Bahrain Grand Prix", ...}, ... ]

get_driver_standingsA

Get driver championship standings.

Data source: Ergast API (via FastF1) Coverage: 1950-present

Args: year: Season year after_round: Standings after specific round (default: latest)

Returns: Ordered list of drivers with: position, driver code, full name, team, points, wins

Example: get_driver_standings(2024) → [ {"position": 1, "code": "VER", "name": "Max Verstappen", "team": "Red Bull", "points": 575, "wins": 19}, ... ]

get_constructor_standingsA

Get constructor championship standings.

Data source: Ergast API (via FastF1) Coverage: 1958-present (constructor championship started 1958)

Args: year: Season year after_round: Standings after specific round (default: latest)

Returns: Ordered list of constructors with: position, name, nationality, points, wins

get_driver_infoA

Get driver information.

Data source: Ergast API (via FastF1) Coverage: 1950-present

Args: driver_id: Ergast driver ID (e.g., "max_verstappen", "hamilton") If None, returns all drivers year: Filter to drivers who raced in this season

Returns: Driver info: driverId, code, givenName, familyName, dateOfBirth, nationality, permanentNumber

Note: Use get_session_results to find driver codes, then use this for biographical details.

get_race_results_historicalA

Get historical race results (pre-2018 or when session data unavailable).

Data source: Ergast API (via FastF1) Coverage: 1950-present

Args: year: Season year round_num: Round number

Returns: Results with: position, driver, constructor, grid, laps, status, time (if finished), fastestLapTime, fastestLapRank

Note: For 2018+ races, prefer get_session_results which has more detail.

get_circuit_infoB

Get circuit information.

Data source: Ergast API (via FastF1)

Args: circuit_id: Ergast circuit ID (e.g., "monaco", "silverstone") If None, returns all circuits year: Filter to circuits used in this season

Returns: Circuit info: circuitId, circuitName, locality, country, lat, long

get_session_resultsA

Get session classification/results.

Data source: FastF1 Live Timing Coverage: 2018-present

Args: year: Season year (2018+) event: Race name (e.g., "Monaco") or round number session: Session type — R, Q, S, SQ, FP1, FP2, FP3

Returns: Ordered classification with: position, driverCode, fullName, teamName, gridPosition, time/status, points

Example: get_session_results(2024, "Monaco", "R") → [ {"position": 1, "driverCode": "LEC", "fullName": "Charles Leclerc", "teamName": "Ferrari", "time": "1:45:12.345", ...}, ... ]

Note: Requires year >= 2018. For historical results use get_race_results_historical.

get_lap_timesA

Get all lap times for a driver in a session.

Data source: FastF1 Live Timing Coverage: 2018-present

Set export_path=True when the user mentions data analysis, notebooks, pandas, ML, "save as CSV", "export the data", or any downstream processing — the full per-lap array is then written to a CSV file the user can open directly. Large responses (>50 laps) also auto-export so the user always gets a real file path in the project rather than the MCP client silently spilling the response to a temp file.

Args: year: Season year (2018+) event: Race name or round number session: Session type (R, Q, S, FP1, FP2, FP3) driver: Driver code (e.g., "VER") or number (e.g., "1") include_deleted: Include deleted lap times (default False) export_path: If True, write the full per-lap array to a CSV in the configured export directory (default ./fastf1-exports/, override via FASTF1_MCP_EXPORT_DIR) and omit laps from the response. Pass a string for a custom directory or .csv file path. The server also auto-exports when the lap count exceeds FASTF1_MCP_AUTO_EXPORT_ROWS (default 50).

Returns: Default (no export): { "driver": "VER", "fullName": "Max Verstappen", "teamName": "Red Bull Racing", "summary": {...}, "laps": [{"lapNumber": 1, "lapTime": "0:01:30.456", ...}, ...] }

With export_path:
{
    "driver": "VER", "fullName": ..., "teamName": ...,
    "summary": {...},
    "exportPath": "/abs/path/to/get_lap_times_2024_monaco_r_ver_<ts>.csv",
    "rowCount": 52
}

Note: Deleted laps (e.g., track limits violations) are excluded by default. Set include_deleted=True to include them. summary lets a caller answer fastest/avg/compound questions without re-parsing the full per-lap array. Use export_path=True to grab the full dataset as CSV for downstream analysis / ML work.

get_fastest_lapsA

Get fastest laps in a session, one per driver.

Data source: FastF1 Live Timing Coverage: 2018-present

Args: year: Season year (2018+) event: Race name or round number session: Session type (default "R") top_n: Number of fastest laps to return (default 10)

Returns: Fastest laps sorted by time: lapNumber, lapTime, sector1, sector2, sector3, compound

Example: get_fastest_laps(2024, "Monaco", "R", 5) → [ {"lapNumber": 67, "lapTime": "0:01:15.456", "compound": "SOFT", ...}, ... ]

Note: Returns one fastest lap per driver. Only accurate laps are included.

get_race_paceA

Calculate average race pace for all drivers.

Data source: FastF1 Live Timing Coverage: 2018-present

Args: year: Season year (2018+) event: Race name or round number exclude_first_laps: Number of opening laps to exclude (default 2) exclude_sc_laps: Exclude laps behind safety car or VSC (default True) exclude_pit_laps: Exclude in-laps and out-laps (default True) min_laps: Minimum valid laps required to include a driver (default 10)

Returns: { "filters": { "excludeFirstLaps": 2, "excludeSafetyCarLaps": true, "excludePitLaps": true, "minLaps": 10 }, "drivers": [ {"driver": "LEC", "fullName": "Charles Leclerc", "teamName": "Ferrari", "avgLapTime": "0:01:15.678", "lapCount": 52, "deltaToFastestSec": 0.0, ...}, ... ] }

Note: SC/VSC filter uses track status "1" (green flag only). Drivers with fewer than min_laps valid laps are excluded. The filters block echoes the applied filters so the caller can clearly state which conditions the pace was computed under.

get_stint_analysisA

Analyze tire stints for a race.

Data source: FastF1 Live Timing Coverage: 2018-present

Set export_path=True when the user mentions data analysis, notebooks, pandas, ML, "save as CSV", "export the strategy data", or any downstream processing — the full per-stint array is written to CSV. Large responses (>50 stints, typical for full-grid races) also auto-export.

Args: year: Season year (2018+) event: Race name or round number driver: Optional driver code to filter (default: all drivers) export_path: If True, write the full per-stint array to a CSV in the configured export directory (default ./fastf1-exports/, override via FASTF1_MCP_EXPORT_DIR) and omit stints from the response. Pass a string for a custom directory or .csv file path. The server also auto-exports when the stint count exceeds FASTF1_MCP_AUTO_EXPORT_ROWS (default 50).

Returns: Default (no export): { "summary": {...}, "stints": [{"driver": "LEC", "stintNumber": 1, ...}, ...] }

With export_path:
{
    "summary": {...},
    "exportPath": "/abs/path/to/get_stint_analysis_<...>.csv",
    "rowCount": 45
}

Note: Only accurate laps are included in pace calculations. Stint numbers match FastF1's internal stint counter. Phantom lap-1 stints (single-lap entries with no recorded lap time, paired with the lap-1 pit-stop artifact) are filtered out. The summary.strategies array gives the 1-stop / 2-stop / compound sequence per driver in a compact form.

get_pit_stopsA

Get all pit stops from a race.

Data source: FastF1 Live Timing Coverage: 2018-present

Args: year: Season year (2018+) event: Race name or round number

Returns: Pit stops sorted by lap: driver (code), fullName, teamName, lap, stopNumber, duration, tyreFrom, tyreTo

Example: get_pit_stops(2024, "Monaco") → [ {"driver": "LEC", "fullName": "Charles Leclerc", "teamName": "Ferrari", "lap": 28, "stopNumber": 1, "duration": 23.4, "tyreFrom": "MEDIUM", "tyreTo": "HARD"}, ... ]

Note: Duration is calculated from PitInTime (end of in-lap) to PitOutTime (start of out-lap), in seconds. Stops with implausibly long durations (>120s) are filtered as FastF1 data artifacts — commonly a phantom lap-1 entry tied to session start, not a real pit stop.

get_qualifying_breakdownA

Get qualifying results split by Q1/Q2/Q3.

Data source: FastF1 Live Timing Coverage: 2018-present

Args: year: Season year (2018+) event: Race name or round number

Returns: { "Q1": [{"driver": "VER", "bestTime": "1:10.123", "lapNumber": 3}, ...], "Q2": [...], "Q3": [...], "eliminated_Q1": ["driver1", "driver2", ...], "eliminated_Q2": ["driver3", "driver4", ...] }

Example: get_qualifying_breakdown(2024, "Monaco") → { "Q1": [...20 drivers sorted by best time...], "Q2": [...15 drivers...], "Q3": [...10 drivers...], "eliminated_Q1": ["5 driver codes"], "eliminated_Q2": ["5 driver codes"] }

Note: Uses laps.split_qualifying_sessions() to split by session time. Drivers with no recorded lap time in a segment are omitted from that segment's list.

list_eventsA

List all events in a season.

Data source: Ergast API (via FastF1) Coverage: 1950-present

Args: year: Season year (1950-present)

Returns: Events with: round, eventName, country, circuitName, date

Example: list_events(2024) → [ {"round": 1, "eventName": "Bahrain Grand Prix", "country": "Bahrain", "circuitName": "Bahrain International Circuit", "date": "2024-03-02"}, ... ]

Note: Minimal version of get_schedule — useful for discovering valid event names to pass to other tools.

list_driversA

List all drivers in a season, optionally filtered to a specific event.

Data source: Ergast API (season list) or FastF1 session (event filter) Coverage: 1950-present (season); 2018-present (event filter)

Args: year: Season year event: Optional race name or round number to filter by event (returns only drivers who participated in that session)

Returns: Drivers with: code, fullName, nationality, team, number

Example: list_drivers(2024) → [ {"code": "VER", "fullName": "Max Verstappen", "nationality": "Dutch", "team": "Red Bull Racing", "number": "1"}, ... ]

Note: When event is provided, data comes from FastF1 session results (requires year >= 2018). Without event, uses Ergast season data.

get_cache_statusA

Check server in-memory session cache status.

Returns: { "sessions_cached": 3, "max_sessions": 10, "cached_sessions": [ {"year": 2024, "event": "Monaco", "session": "R", "loaded_at": "2024-05-26T14:00:00"}, ... ], "fastf1_cache_path": "~/.fastf1_cache", "fastf1_cache_size_mb": 1234.5 }

Example: get_cache_status() → {"sessions_cached": 2, "max_sessions": 10, ...}

Note: Reports in-memory LRU cache only. The FastF1 disk cache (used for raw timing data) is reported separately as size_mb.

clear_cacheA

Clear cached sessions from in-memory storage.

Args: year: Optional year filter — only clear sessions for this year event: Optional event filter — requires year to be set

Returns: {"cleared": 3, "remaining": 2}

Example: clear_cache() → {"cleared": 5, "remaining": 0} clear_cache(2024, "Monaco") → {"cleared": 1, "remaining": 4}

Note: Clears the in-memory LRU cache only. The FastF1 disk cache (raw timing files) is preserved and unaffected.

get_lap_telemetryA

Get telemetry data for a specific lap.

Data source: FastF1 Live Timing Coverage: 2018-present

Set export_path=True when the user mentions data analysis, notebooks, pandas, ML, "plot the telemetry", "save the trace", or downstream processing — the sampled per-distance trace is written to CSV. Telemetry responses with the default 200 sample points also auto-export so the user always gets a real file path in the project.

Args: year: Season year (2018+) event: Race name or round number session: Session type (R, Q, S, FP1, FP2, FP3) driver: Driver code (e.g., "VER") lap: Lap number or "fastest" (default) sample_size: Number of telemetry points to return (default 200, max 500) export_path: If True, write the sampled data array to a CSV in the configured export directory (default ./fastf1-exports/, override via FASTF1_MCP_EXPORT_DIR) and omit data from the response. Pass a string for a custom directory or .csv file path. The server also auto-exports when data would exceed FASTF1_MCP_AUTO_EXPORT_ROWS rows (default 50). Use a larger sample_size if you want more detail in the exported file.

Returns: { "driver": "VER", "lapNumber": 42, "lapTime": "0:01:23.456", "summary": { "samplePoints": 200, "maxSpeedKph": 327.5, "minSpeedKph": 80.2, "avgSpeedKph": 218.1, "maxGear": 8, "brakingZones": 7, "fullThrottlePct": 64.5 }, "data": [ {"distance": 0.0, "speed": 280.0, "throttle": 95.0, "brake": false, "gear": 7, "drs": 0}, ... ] }

Example: get_lap_telemetry(2024, "Monaco", "Q", "VER") → fastest Q lap telemetry get_lap_telemetry(2024, "Monaco", "R", "VER", lap=45) → lap 45 telemetry

Note: Raw telemetry has 5000+ points per lap. Response is sampled to sample_size evenly-spaced distance points (capped at 500). summary lets a caller answer top-speed / braking-zone questions without parsing the full per-distance array.

compare_telemetryA

Compare telemetry between two drivers on the same session.

Data source: FastF1 Live Timing Coverage: 2018-present

Set export_path=True when the user wants the comparison data for analysis (notebook, pandas, ML, "plot where one driver gains time", "save the comparison"). Comparisons at the default 200 sample size also auto-export.

Args: year: Season year (2018+) event: Race name or round number session: Session type (R, Q, S, FP1, FP2, FP3) driver1: First driver code (e.g., "VER") driver2: Second driver code (e.g., "LEC") lap: Lap number or "fastest" — applied independently to each driver sample_size: Telemetry points per driver (default 200, max 500) export_path: If True, write the per-distance comparison array to a CSV in the configured export directory (default ./fastf1-exports/, override via FASTF1_MCP_EXPORT_DIR) and omit comparison from the response. Pass a string for a custom directory or .csv file path.

Returns: { "driver1": {"code": "VER", "lapNumber": 18, "lapTime": "1:10.123"}, "driver2": {"code": "LEC", "lapNumber": 20, "lapTime": "1:10.456"}, "comparison": [ {"distance": 0.0, "speed1": 280.0, "speed2": 275.0, "speedDelta": 5.0, "timeDelta": 0.0}, ... ], "summary": { "lapTimeDeltaSec": 0.333, "maxSpeedDelta": 8.2, "sectors": { "S1": {"driver1": "0:00:28.123", "driver2": "0:00:28.456", "deltaSec": -0.333}, "S2": {...}, "S3": {...} }, "driver1Telemetry": {"maxSpeedKph": 325.0, "brakingZones": 7, ...}, "driver2Telemetry": {"maxSpeedKph": 320.5, "brakingZones": 8, ...} } }

Example: compare_telemetry(2024, "Monaco", "Q", "VER", "LEC")

Note: timeDelta is the cumulative time gap (seconds) at each distance point: driver1's elapsed time minus driver2's. Negative = driver1 is ahead (reached that point sooner); positive = driver1 is behind. This matches the sign of lapTimeDeltaSec and the sector deltaSec values. Uses the recorded Time channel when present, otherwise integrates speed. Comparison is aligned to driver1's distance axis.

get_speed_trap_dataA

Get speed trap and top-speed data for all drivers in a session.

Data source: FastF1 Live Timing (session results) Coverage: 2018-present

Args: year: Season year (2018+) event: Race name or round number session: Session type (R, Q, S, FP1, FP2, FP3)

Returns: { "source": "results" | "laps", "drivers": [ {"driver": "VER", "fullName": "Max Verstappen", "teamName": "Red Bull Racing", "speedTrap": 298.5, "speedFL": 187.2, "speedI1": 245.0, "speedI2": 268.5}, ... ] }

Example: get_speed_trap_data(2024, "Monza", "Q") → {"source": "results", ...}

Note: SpeedST = official speed trap measurement. SpeedFL = speed at the finish line. SpeedI1/I2 = sector intermediate speed measurements. Values are in km/h.

FastF1 publishes per-driver speed columns on `session.results`, but
for many sessions those columns are entirely empty. When the
results-level data is missing, we fall back to the per-lap max
across `session.laps` for the same columns. `source` indicates
which path produced the response.
get_sector_timesA

Get best sector times and theoretical best lap for each driver.

Data source: FastF1 Live Timing Coverage: 2018-present

Set include_laps=True when the user wants per-lap sector breakdowns (e.g. "show me Antonelli's sector times each lap") rather than just the per-driver best/theoretical-best summary.

Args: year: Season year (2018+) event: Race name or round number session: Session type (R, Q, S, FP1, FP2, FP3) driver: Optional driver code to filter (default: all drivers) include_laps: If True, include a laps array per driver with each accurate lap's S1/S2/S3 and total lap time. Default False keeps responses compact for the typical "fastest sectors / theoretical best" question.

Returns: For each driver: driver (code), fullName, teamName, bestS1, bestS2, bestS3, theoreticalBest, actualBest, gapSec. With include_laps, each entry also has laps: [{lapNumber, s1, s2, s3, lapTime}, ...].

Example: get_sector_times(2024, "Monaco", "Q") → [ {"driver": "VER", "fullName": "Max Verstappen", "teamName": "Red Bull Racing", "bestS1": "0:00:22.123", "bestS2": "0:00:24.456", "bestS3": "0:00:21.789", "theoreticalBest": "0:01:08.368", "actualBest": "0:01:08.570", "gapSec": -0.202}, ... ]

Note: A negative gapSec means the theoretical best (sum of individual sector bests) is faster than the actual best lap — typical, since sector bests usually come from different laps.

get_corner_analysisA

Corner-by-corner breakdown of a lap: apex (minimum) speed, gear, approach speed, exit speed and brake point for every numbered corner — and, with a second driver, where each one gains or loses time.

Data source: FastF1 Live Timing telemetry + MultiViewer circuit markers Coverage: 2018-present

Use for "where is Leclerc faster than Verstappen", "what's the slowest corner at Monaco", "who brakes later into turn 1", or "how much time does Norris lose in the final sector corners".

Args: year: Season year (2018+) event: Race name or round number session: Session type (R, Q, S, SQ, FP1, FP2, FP3) driver: Driver code (e.g. "LEC") driver2: Optional second driver code to compare against lap: Lap number or "fastest" (default) — applied to each driver

Returns: { "driver": {"code": "LEC", "lapNumber": 18, "lapTime": "..."}, "driver2": {"code": "VER", ...} | null, "corners": [ {"corner": "T1", "distanceM": 210.0, "driver": {"minSpeedKph": 98.5, "gear": 3, "entrySpeedKph": 290.1, "exitSpeedKph": 165.0, "brakeStartM": 92.0, "apexDistanceM": 215.0}, "driver2": {...}, "minSpeedDeltaKph": 2.1, "timeDeltaSec": -0.034}, ... ], "summary": { "slowestCorner": {"corner": "T6", "minSpeedKph": 48.2}, "fastestCorner": {...}, "driverGainsMost": [{"corner": "T10", "timeDeltaSec": -0.081}, ...], "driverLosesMost": [...], "totalCornerDeltaSec": -0.112 } }

Note: Deltas are driver − driver2: negative timeDeltaSec = driver was quicker through that corner; positive minSpeedDeltaKph = driver carried more apex speed. Each corner's window runs halfway to its neighbours (max ±150 m), so the corner deltas don't sum exactly to the lap-time delta (straights are excluded). Corner positions are approximate (hand-annotated circuit data).

get_drs_zonesA

Detect the DRS zones of a circuit: where each zone opens and closes, its length, and the corners around it.

Data source: FastF1 Live Timing telemetry (DRS flap channel) Coverage: 2018-2025 (DRS was replaced by active aero from 2026)

Zones are inferred from where the DRS flap was actually open on up to 8 reference laps: the fastest laps of the top drivers, or in a race the laps with the most DRS use (DRS only opens within one second of the car ahead, so fastest race laps are often set without it). Qualifying (default) is the best source: drivers may use DRS in every zone on every flying lap.

Args: year: Season year (2018+) event: Race name or round number session: Session type (default "Q"; R, S, SQ, FP1-FP3 also work)

Returns: { "lapLengthM": 5412, "referenceLaps": 8, "zones": [ {"zone": 1, "startM": 4870, "endM": 5390, "lengthM": 520, "afterCorner": "T14", "beforeCorner": "T1", "seenOnLaps": 8}, ... ] }

Note: Distances are metres from the start/finish line along the reference laps. startM is where drivers opened the flap, which is at or just after the official activation point. afterCorner / beforeCorner need circuit corner data and are null when it is unavailable.

get_race_control_messagesA

Get race control messages, penalties, investigations and SC/VSC/red flag periods.

Data source: FastF1 Live Timing Coverage: 2018-present

Use this to answer "why was there a safety car", "who got a penalty", "what happened on lap 34", "how many laps were deleted for track limits", or to explain strategy calls that were triggered by a neutralisation.

Args: year: Season year (2018+) event: Race name or round number session: Session type — R, Q, S, SQ, FP1, FP2, FP3 (default "R") category: Optional filter on the FastF1 category — "Flag", "SafetyCar", "Drs", "CarEvent", "Other" (case-insensitive) driver: Optional driver code or number — only messages about that car lap_start: Optional first lap to include (inclusive) lap_end: Optional last lap to include (inclusive) export_path: If True (or a directory / .csv path), write the full message list to CSV and omit messages from the response. Large lists (> FASTF1_MCP_AUTO_EXPORT_ROWS, default 50) auto-export; narrow with the filters above to keep them inline.

Returns: { "summary": { "totalMessages": 142, "byCategory": {"Flag": 80, "Other": 40, ...}, "neutralisations": [ {"type": "SC", "startLap": 34, "endLap": 37, "durationSec": 294.9, ...} ], "redFlags": 0, "penalties": [ {"lap": 12, "driver": "SAR", "penalty": "5 SECOND TIME PENALTY", "message": "FIA STEWARDS: 5 SECOND TIME PENALTY FOR CAR 2 ..."} ], "investigations": [...], "trackLimitsDeletions": {"HAM": 3, "VER": 1} }, "messages": [ {"time": "2024-07-07T14:35:12", "lap": 12, "category": "Flag", "flag": "YELLOW", "scope": "Sector", "sector": 7, "driver": null, "tag": null, "message": "YELLOW IN TRACK SECTOR 7"}, ... ] }

Note: summary is computed over the whole session, before the category/driver/lap filters are applied, so the neutralisation and penalty overview is always complete. neutralisations comes from the track-status feed (more reliable than parsing message text).

get_weatherA

Get weather conditions over a session: air/track temperature, rain, wind.

Data source: FastF1 Live Timing (sampled once per minute) Coverage: 2018-present

Use for "was it raining", "how hot was the track", "did conditions change during qualifying", or to explain tyre behaviour and strategy.

Args: year: Season year (2018+) event: Race name or round number session: Session type — R, Q, S, SQ, FP1, FP2, FP3 (default "R") interval_minutes: Spacing of the returned samples (default 5, min 1). Summary stats always use every sample. export_path: If True (or a directory / .csv path), write the sampled series to CSV and omit samples.

Returns: { "summary": { "airTempC": {"min": 21.3, "max": 24.0, "avg": 22.6, "start": 21.3, "end": 23.9}, "trackTempC": {...}, "humidityPct": {...}, "windSpeedMs": {...}, "rainfall": true, "rainPeriods": [{"startMinute": 31.0, "endMinute": 48.0, "startLap": 18, "endLap": 27}], "durationMinutes": 96.0 }, "samples": [ {"sessionMinute": 0.0, "lap": null, "airTempC": 21.3, "trackTempC": 35.1, "rainfall": false, ...}, ... ] }

Note: sessionMinute is minutes since the session clock started (the timing feed starts before lights out, so lap 1 begins a few minutes in). lap is the lap the leader was on — races only.

get_position_changesA

Get how a race unfolded: lap-by-lap positions, gaps to the leader, positions gained from the grid, laps led and lead changes.

Data source: FastF1 Live Timing Coverage: 2018-present

Use for "how did the race unfold", "who gained the most places", "when did X take the lead", "how far behind was Y at half distance", or "how many places did Z make up on lap 1".

Args: year: Season year (2018+) event: Race name or round number session: "R" (race, default) or "S" (sprint) drivers: Optional driver codes to include (e.g. ["VER", "NOR"]). The session-wide summary always covers the full field. include_laps: Include the per-lap positions and gapsToLeaderSec arrays for each driver (default True). Set False for a compact grid→finish movement table. export_path: If True (or a directory / .csv path), write a long format CSV (one row per driver per lap: lap, driver, position, gapToLeaderSec) and omit the per-lap arrays.

Returns: { "totalLaps": 57, "summary": { "winner": "VER", "lapLeaders": {"VER": 50, "LEC": 7}, "leadChanges": [{"lap": 21, "from": "VER", "to": "LEC"}, ...], "biggestGainers": [{"driver": "HAM", "grid": 18, "finish": 6, "positionsGained": 12}, ...], "biggestLosers": [...] }, "drivers": [ {"driver": "VER", "fullName": "Max Verstappen", "teamName": "Red Bull Racing", "grid": 1, "finish": 1, "status": "Finished", "positionsGained": 0, "lap1Gain": 0, "lapsLed": 50, "bestPosition": 1, "worstPosition": 2, "positions": [1, 1, 1, ...], "gapsToLeaderSec": [0.0, 0.0, ...]}, ... ] }

Note: positions[i] / gapsToLeaderSec[i] are for lap i+1. The gap is the time between the leader completing that lap and this driver completing the same lap (the classic "race history" gap, so lapped cars show their full deficit). Pit-lane starters have grid 0 in the source data; their gain is computed from the back of the grid.

get_tyre_degradationA

Estimate tyre degradation (seconds lost per lap of tyre age) per stint and per compound, with fuel-effect correction.

Data source: FastF1 Live Timing Coverage: 2018-present

Use for "how fast did the softs degrade", "which compound was best", "why did X pit so early", "when does the medium overtake the soft", or long-run analysis in practice (session="FP2").

Method: for each stint, keep accurate green-flag laps (no in/out laps, no lap 1), drop outliers slower than 107% of the stint median, add fuel_correction_sec_per_lap × (lap − 1) to remove the fuel-burn effect, then fit lap time against tyre age. The slope is the degradation rate.

Args: year: Season year (2018+) event: Race name or round number session: "R" (default), "S", or a practice session ("FP1"-"FP3") driver: Optional driver code to restrict to one driver min_stint_laps: Minimum clean laps a stint needs to be fitted (default 6) fuel_correction_sec_per_lap: Lap-time gain per lap from fuel burn (default 0.06 s/lap; 0 disables) export_path: If True (or a directory / .csv path), write the per-stint table to CSV and omit stints.

Returns: { "method": {"fuelCorrectionSecPerLap": 0.06, "minStintLaps": 6}, "summary": { "compounds": { "MEDIUM": {"stints": 14, "medianDegSecPerLap": 0.051, "medianFreshTyrePaceSec": 93.42, "avgStintLaps": 21.3}, "HARD": {...} }, "compoundCrossovers": [ {"faster": "MEDIUM", "slower": "HARD", "freshPaceGapSec": 0.42, "crossoverTyreAge": 18} ], "lowestDeg": [{"driver": "HAM", "compound": "HARD", "degSecPerLap": 0.012}, ...] }, "stints": [ {"driver": "VER", "stintNumber": 2, "compound": "HARD", "startLap": 18, "endLap": 57, "lapsUsed": 33, "tyreAgeStart": 1, "tyreAgeEnd": 40, "degSecPerLap": 0.031, "rawSlopeSecPerLap": -0.029, "r2": 0.62, "freshTyrePaceSec": 93.1, "avgLapTimeSec": 94.2}, ... ] }

Note: Degradation is an estimate — traffic, dirty air and push/lift phases add noise; check r2 (closer to 1 = cleaner trend) and lapsUsed. freshTyrePaceSec is the fitted, fuel-corrected lap time at tyre age 1, comparable across stints and drivers. crossoverTyreAge is the tyre age at which the faster-when-fresh compound's higher degradation makes it slower than the other; it is null (with a note) when that age is beyond the oldest tyre run on the faster compound.

get_championship_projectionA

Project the drivers' and constructors' championships as if the race finished in the running order at a given lap ("live" standings).

Data source: FastF1 Live Timing (running order) + Ergast (standings) Coverage: 2018-present

Use for "who was leading the championship on the road at lap 40", "how many points did Norris gain on Verstappen in Brazil", "did the championship lead change during the race", or the final standings after a race.

Args: year: Season year (2018+) event: Race name or round number session: "R" (Grand Prix, default) or "S" (sprint) after_lap: Running order to use (default: the final lap). On the final lap the official classification and points are used, so penalties and the fastest-lap point are exact. include_history: Also return the projected championship leader and margin after every lap (leadByLap).

Returns: { "round": 21, "session": "R", "lap": 71, "totalLaps": 71, "source": "official" | "projected", "baseline": {"afterRound": 20, "includesSprint": true}, "drivers": [ {"driver": "VER", "fullName": "Max Verstappen", "team": "Red Bull", "pointsBefore": 362.0, "racePosition": 1, "racePoints": 25.0, "projected": 387.0, "positionBefore": 1, "projectedPosition": 1, "change": 0}, ... ], "constructors": [ {"team": "McLaren", "pointsBefore": 566.0, "racePoints": 33.0, "projected": 599.0, "positionBefore": 1, "projectedPosition": 1, "change": 0}, ... ], "summary": {"leader": "VER", "leaderBefore": "VER", "marginToSecond": 62.0, "leadChanged": false, "constructorsLeader": "McLaren"}, "leadByLap": [{"lap": 1, "leader": "VER", "margin": 63.0}, ...] }

Note: Baseline standings are the official ones after the previous round; for a Grand Prix on a sprint weekend the sprint points of the same round are added. Mid-race projections use the race points table (25-18-15-12-10-8-6-4-2-1, sprint 8…1 or 3-2-1 in 2021) and, for 2019-2024 Grands Prix, +1 for the fastest lap so far if that driver is in the top 10. Half-points races (e.g. Spa 2021) are not modelled mid-race; the final-lap figures use the official points.

plot_speed_traceA

Plot a speed-vs-distance trace for one driver's lap, or overlay two drivers with a cumulative time-gap panel underneath. Returns a PNG image.

Use when the user asks to "show", "plot", "chart" or "visualise" telemetry, or to see where one driver is faster than another.

Args: year: Season year (2018+) event: Race name or round number session: Session type (R, Q, S, SQ, FP1, FP2, FP3) driver: Driver code (e.g. "VER") driver2: Optional second driver to overlay lap: Lap number or "fastest" (default) — applied to each driver show_corners: Mark numbered corners (default True; skipped silently if circuit data is unavailable) show_drs: Shade where driver's DRS flap was open on this lap (default True) save_path: If True, also write the PNG to the export directory (default ./fastf1-exports/); a string is a directory or a full .png path.

Returns: An image plus a one-line caption. Structured content carries the lap numbers/times and savedTo when saved.

plot_position_chartA

Plot the lap-by-lap race position of every driver (a "race history" chart). Returns a PNG image.

Use when the user wants to see how the race unfolded, overtakes, pit-cycle shuffles or a driver's recovery drive.

Args: year: Season year (2018+) event: Race name or round number session: "R" (default) or "S" (sprint) highlight: Up to 8 driver codes drawn in colour (others are grey, all are labelled). Default: the podium finishers. save_path: If True, also write the PNG to the export directory (default ./fastf1-exports/); a string is a directory or a full .png path.

plot_tyre_strategyA

Plot every driver's tyre strategy as horizontal stint bars coloured by compound, in finishing order. Returns a PNG image.

Use when the user asks to "show the strategies", "visualise the stints" or compare 1-stop vs 2-stop plans at a glance.

Args: year: Season year (2018+) event: Race name or round number session: "R" (default) or "S" (sprint) save_path: If True, also write the PNG to the export directory (default ./fastf1-exports/); a string is a directory or a full .png path.

plot_lap_timesA

Plot lap time against lap number for up to three drivers, with marker shape showing the tyre compound. Returns a PNG image.

Use for "show me the race pace of X vs Y", "plot their lap times", or to visualise degradation and safety-car phases.

Args: year: Season year (2018+) event: Race name or round number session: Session type (default "R") drivers: Up to 3 driver codes. Default: the top three finishers. save_path: If True, also write the PNG to the export directory (default ./fastf1-exports/); a string is a directory or a full .png path.

Note: Lap 1, in/out laps and laps slower than 107% of the driver's median (safety car, incidents) are omitted so the y-axis stays readable; the caption reports how many slow laps were dropped and the line breaks across every omitted lap.

plot_track_mapA

Draw the circuit map. Two modes:

  1. Lap trace (default): the racing line of one lap coloured by speed or gear, with numbered corners, DRS zones and the direction of travel.

  2. Car positions (at_lap=N): where every car was on track at the moment the leader started lap N, with the running order listed.

Returns a PNG image.

Data source: FastF1 Live Timing position data + MultiViewer corners Coverage: 2018-present

Use for "show me the track", "where is the car fastest", "which gear through each corner", or "where was everyone when the safety car came out on lap 34".

Args: year: Season year (2018+) event: Race name or round number session: Session type (default "Q"; use "R"/"S" for at_lap) driver: Driver whose lap is traced (default: the session's fastest lap) lap: Lap number or "fastest" (default) color_by: "speed" (default), "gear" or "none" at_lap: Draw car positions at the start of this lap instead of a trace highlight: Up to 8 driver codes coloured in positions mode (default: the top three at that moment) show_corners: Number the corners (default True) show_drs: Highlight DRS zones on the trace (default True) save_path: If True, also write the PNG to the export directory (default ./fastf1-exports/); a string is a directory or a full .png path.

Returns: An image plus a caption. Structured content has the lap used, DRS zones and, in positions mode, the running order.

plot_circuitA

Draw a real F1 circuit from stored outline data — works offline, no session download needed. With only year, draws every circuit on that season's calendar as a sheet of small maps.

Data source: bundled circuit outlines (bacinger/f1-circuits, MIT), covering every F1 circuit used since 2018 plus classic venues.

Use for "show me the Monaco track", "what does Suzuka look like", "draw the 2026 calendar circuits", or when FastF1 telemetry is not available. For speed/gear-coloured maps, corners and DRS zones from a real lap, use plot_track_map.

Args: circuit: Grand Prix name, circuit name, location or nickname ("Monaco", "British", "COTA", "Spa", "Yas Marina"), or a round number together with year. year: Season. Disambiguates names whose venue changed (the Spanish GP moves to Madrid in 2026) and is needed for round numbers. On its own (no circuit), draws that season's calendar (2020-2026 stored). save_path: If True, also write the PNG to the export directory (default ./fastf1-exports/); a string is a directory or a full .png path.

Returns: An image plus a caption. Structured content has the circuit name, location, official length, direction of racing, first Grand Prix and altitude (or the season's circuit list).

Note: Maps are drawn north-up from geographic coordinates (official F1 maps are often rotated). The outline starts on the start/finish line and the arrow shows the direction of racing.

get_replay_stateA

Snapshot of a race currently playing in f1-race-replay: replay time, lap, leader, track status, safety car, weather, the live leaderboard (position, tyre, tyre age, speed, gear, DRS, pit, last lap, gaps) and the latest race-control messages.

Data source: f1-race-replay telemetry stream (localhost:9999)

Use when the user is watching a replay and asks "who's leading now", "what tyres are they on", "is there a safety car", or wants live commentary. The replay must be running and un-paused.

Args: top_n: Number of leaderboard rows to return (default 20)

Returns: { "replayTime": "00:41:12", "lap": 23, "totalLaps": 57, "leader": "VER", "trackStatus": "SC", "safetyCar": "on_track", "playbackSpeed": 4.0, "paused": false, "progressPct": 40.2, "weather": {"airTempC": 24.1, "trackTempC": 38.0, "rain": "DRY"}, "leaderboard": [ {"position": 1, "driver": "VER", "lap": 23, "tyre": "HARD", "tyreLife": 9, "speedKph": 182.0, "gear": 5, "drsOpen": false, "inPit": false, "lastLapSec": 95.12, "gapToLeaderSec": 0.0, "intervalSec": null}, ... ], "recentRaceControl": [{"replayTimeSec": 2401.2, "category": "SafetyCar", "message": "SAFETY CAR DEPLOYED"}, ...] }

Note: Positions come from the replay's own running order, which can be briefly wrong near the start/finish line or during pit stops (a known limitation of f1-race-replay). Gaps are from the last completed lap.

watch_replayA

Watch a running f1-race-replay for a few seconds and report what happened: position changes, pit entries/exits, track-status changes (SC/VSC/red flag), new race-control messages and laps completed.

Data source: f1-race-replay telemetry stream (localhost:9999)

Use for live commentary ("tell me what's happening"), or call it repeatedly to follow a replay like a race engineer. Combine with a faster playback speed to cover more of the race per call.

Args: duration_sec: How long to watch, in real seconds (1-60, default 10)

Returns: { "from": {"replayTime": "00:41:12", "lap": 23}, "to": {"replayTime": "00:42:52", "lap": 24}, "replaySecondsCovered": 100.0, "positionChanges": [{"driver": "NOR", "from": 4, "to": 3, "replayTimeSec": 2388.4}, ...], "netPositionChanges": [{"driver": "NOR", "from": 4, "to": 3}], "pitEntries": ["HAM"], "pitExits": [], "trackStatusChanges": [{"from": "GREEN", "to": "SC", "replayTimeSec": 2401.2}], "newRaceControl": [{"category": "SafetyCar", "message": "SAFETY CAR DEPLOYED", ...}], "leaderNow": "VER", "state": { ...same shape as get_replay_state (top 10)... } }

Note: Messages are sampled four times a second, so a position swap that reverts within ~0.25 s of real time can be missed. positionChanges lists every change seen, in order (an overtake that is later reversed appears twice); netPositionChanges compares the start and end of the window. rewound is true if the user scrubbed backwards; stalled is true if the stream went quiet (replay paused or closed) before the window ended.

Prompts

Interactive templates invoked by user choice

NameDescription
race_recapGenerate a comprehensive race summary.
qualifying_analysisAnalyze qualifying session performance.
driver_comparisonCompare two drivers across a season.
strategy_analysisDeep dive into race strategy.
weekend_previewGenerate a race weekend preview.
replay_commentaryLive race-engineer commentary on a replay running in f1-race-replay.

Resources

Contextual data attached and managed by the client

NameDescription
circuits_resourceAll circuits that have hosted F1 races. Returns JSON array of circuits with id, name, locality, country, latitude, and longitude.

TDQS

A3.9/5.0

Scored across 36 tools

Disambiguation4/5

Most tools target clearly distinct resources or analysis angles, and descriptions explicitly separate overlapping areas like historical vs modern results and schedule vs event listing. However, with 36 tools there are several closely related telemetry, pace, strategy, and plotting tools that require careful description reading to avoid misselection.

Naming Consistency5/5

Names consistently use snake_case with a verb_noun pattern (get_*, list_*, plot_*, compare_*, clear_*, watch_*). The few deviations like compare_telemetry and watch_replay still follow the same readable verb-first convention.

Tool Count2/5

36 tools is a large surface for one server, well above the typical 3–15 range. Although the F1 domain is broad, several analytics and plotting tools could likely be consolidated or parameterized to reduce cognitive load.

Completeness4/5

The server covers schedule, events, drivers, circuits, standings, results, telemetry, lap times, pit stops, weather, race control, strategy, plotting, and replay. Minor gaps exist, such as no dedicated team radio or constructor profile tool, but most agent workflows are well supported.

Maintenance

ActivitySlowing
ResponsivenessNo recent community issues