Skip to main content
Glama

Pitstop

get_laps

Retrieve Formula 1 lap data from race sessions with flexible filtering options for specific drivers, fastest laps, or comprehensive session analysis.

Instructions

Get lap data from an F1 session with flexible filtering.

A composable function to retrieve lap data - all laps, specific driver's laps, or fastest laps. Use this single tool for all lap-related queries instead of multiple separate tools.

Use this tool to:

  • Get all laps from a session (default behavior)

  • Get a specific driver's laps (provide driver parameter)

  • Get the fastest lap overall or for a driver (set lap_type='fastest')

  • Analyze lap times, sectors, tire compounds, and lap progression

Args: year: The season year (2018 onwards for detailed data) gp: The Grand Prix name (e.g., 'Monza', 'Monaco') or round number session: Session type - 'FP1' (Free Practice 1), 'FP2', 'FP3', 'Q' (Qualifying), 'S' (Sprint), 'R' (Race) driver: Optional - Driver identifier as 3-letter code (e.g., 'VER', 'HAM') or number (e.g., 1, 44). If None, returns data for all drivers. lap_type: Optional - 'all' returns all laps (default), 'fastest' returns only the fastest lap(s)

Returns: Union[LapsResponse, FastestLapResponse]: Lap data in JSON-serializable format. Returns LapsResponse for multiple laps, FastestLapResponse for single fastest lap.

Examples: >>> # Get all laps from 2024 Monza race (all drivers) >>> all_laps = get_laps(2024, "Monza", "R")

>>> # Get all laps for Verstappen in 2024 Monza race >>> ver_laps = get_laps(2024, "Monza", "R", driver="VER") >>> # Get fastest lap overall from 2024 Monaco qualifying >>> fastest = get_laps(2024, "Monaco", "Q", lap_type="fastest") >>> # Get Verstappen's fastest lap from the race >>> ver_fastest = get_laps(2024, "Monza", "R", driver="VER", lap_type="fastest")

Input Schema

NameRequiredDescriptionDefault
driverNo
gpYes
lap_typeNoall
sessionYes
yearYes

Input Schema (JSON Schema)

{ "properties": { "driver": { "anyOf": [ { "type": "integer" }, { "type": "string" }, { "type": "null" } ], "default": null, "title": "Driver" }, "gp": { "anyOf": [ { "type": "string" }, { "type": "integer" } ], "title": "Gp" }, "lap_type": { "anyOf": [ { "enum": [ "all", "fastest" ], "type": "string" }, { "type": "null" } ], "default": "all", "title": "Lap Type" }, "session": { "title": "Session", "type": "string" }, "year": { "title": "Year", "type": "integer" } }, "required": [ "year", "gp", "session" ], "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/praneethravuri/pitstop'

If you have feedback or need assistance with the MCP directory API, please join our Discord server