Skip to main content
Glama
fastf1-mcp-server

fastf1-mcp-server

by Surya96t

compare_telemetry

Compare two drivers’ telemetry on the same lap or fastest lap to show speed and time deltas by distance, with optional CSV export for further analysis.

Instructions

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.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "year": "<year>",
      "event": "<event>",
      "session": "<session>",
      "driver1": "<driver1>",
      "driver2": "<driver2>"
    },
    "name": "compare_telemetry"
  }
}

Input Schema

NameRequiredDescriptionDefault
lapNofastest
yearYes
eventYes
driver1Yes
driver2Yes
sessionYes
export_pathNo
sample_sizeNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0
  2. Removed
  3. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does it well: it discloses the data source and year coverage, that export writes a CSV to a configurable directory (env override) and omits `comparison` from the response, that default sample size auto-exports, and how timeDelta is computed and signed when the Time channel is absent.

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

Conciseness4/5

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

Front-loaded purpose, then labeled Args/Returns/Example/Note sections; every behavioral claim earns its place. The long Returns block restates what the output schema already provides, which is the only real waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter analytical tool with no annotations, the definition covers sourcing, parameter semantics, the surprising export side effect, and delta sign conventions. Nothing an agent needs in order to call this correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it documents all 8 parameters: lap accepts an integer or 'fastest' and applies independently to each driver, sample_size defaults to 200 with a 500 max, and export_path accepts a bool or a custom directory/.csv path.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource plus scope: 'Compare telemetry between two drivers on the same session.' The two-driver, same-session scope implicitly separates it from get_lap_telemetry, so an agent can pick it without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives concrete selection cues for export_path ('when the user wants the comparison data for analysis', with example phrasings) and notes the default-200 auto-export case. It lacks any explicit when-not-to-use or named alternative, so it stops short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.