plot_speed_trace
Plot a driver’s speed-versus-distance lap trace or overlay two drivers with a cumulative time-gap panel, returning a PNG for telemetry comparison.
Instructions
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.
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>",
"driver": "<driver>"
},
"name": "plot_speed_trace"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lap | No | fastest | |
| year | Yes | ||
| event | Yes | ||
| driver | Yes | ||
| driver2 | No | ||
| session | Yes | ||
| show_drs | No | ||
| save_path | No | ||
| show_corners | No |