Skip to main content
Glama
fastf1-mcp-server

fastf1-mcp-server

by Surya96t

get_pit_stops

Retrieve all pit stops from a Formula 1 race by year and event, returning driver, team, lap, stop number, duration, and tyre changes sorted by lap.

Instructions

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.

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>"
    },
    "name": "get_pit_stops"
  }
}

Input Schema

NameRequiredDescriptionDefault
yearYes
eventYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.3.0
    • addedOutput schema / properties / result / anyOf
      Added value: +[
      +  {
      +    "items": {
      +      "additionalProperties": true,
      +      "type": "object"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "additionalProperties": true,
      +    "type": "object"
      +  }
      +]
    • removedOutput schema / properties / result / items
      Removed value: -{
      -  "additionalProperties": true,
      -  "type": "object"
      -}
    • removedOutput schema / properties / result / type
      Removed value: -"array"
  2. Addedv0.2.0
  3. Removed
  4. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose a lot: FastF1 Live Timing as the source, a 2018-present coverage window, lap-sorted output, a precise duration definition (PitInTime to PitOutTime) and an explicit filtering rule for >120s artifacts. It still omits what happens for out-of-range seasons or unknown races (error vs empty result), which for an unannotated tool is a notable gap.

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 followed by clearly labeled Data source, Coverage, Args, Returns, Example and Note sections, so an agent can stop reading early. The multi-line example and Returns block are somewhat long given that an output schema already exists, but each still carries useful signal.

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

Completeness4/5

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

For a two-parameter read tool, the definition covers both arguments, the data window, the sort order, field semantics for duration and the artifact-filtering quirk. An output schema exists so return values needn't be spelled out, and the remaining gap (behavior for pre-2018 or unrecognized events) is minor rather than blocking.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must do the work, and it does: 'year: Season year (2018+)' adds a validity constraint the bare integer lacks, and 'event: Race name or round number' explains the anyOf[string|integer] union that is otherwise opaque. The worked example further pins down accepted argument form; only explicit failure behavior for invalid values is missing.

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

Purpose4/5

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

States a specific verb and resource ('Get all pit stops from a race') and adds scope via data source and coverage years, which is far beyond a restated title. It does not, however, explicitly distinguish itself from adjacent siblings such as get_stint_analysis or get_lap_times, so it falls short of a 5.

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

Usage Guidelines3/5

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

The 'Coverage: 2018-present' line implies a usable range and the Args section implies one race per call, giving implicit guidance on applicability. There is no explicit when-to-use/when-not-to-use statement or named alternative tool for related queries like stint or lap analysis.

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