Skip to main content
Glama
fastf1-mcp-server

fastf1-mcp-server

by Surya96t

plot_lap_times

Plot lap times against lap number for up to three drivers, with tyre-compound markers, to compare race pace and spot degradation or safety-car phases. Returns a PNG chart.

Instructions

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.

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": "plot_lap_times"
  }
}

Input Schema

NameRequiredDescriptionDefault
yearYes
eventYes
driversNo
sessionNoR
save_pathNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.6/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does well: it discloses the PNG output, the filtering rule (lap 1, in/out laps, laps over 107% of median dropped), and that the caption and line breaks report omissions — non-obvious behavior an agent could otherwise misreport. It does not cover whether the image renders inline versus only being written to disk, or any caching/performance traits.

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

Conciseness5/5

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

Front-loads the one-line purpose, then organizes supporting detail into explicit Args and Note blocks. Every line carries information — usage triggers, parameter meanings, and omission behavior — with no filler or repetition.

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 a five-parameter tool with no output schema and no annotations, everything an agent needs is present: all parameters are documented, the return artifact is named, and the data-suppression behavior is spelled out. Nothing material is left to guess.

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 does: year is bounded to 2018+, event accepts a race name or round number (clarifying the string/integer anyOf), drivers are up to 3 codes with a documented default of the top three finishers, session defaults to R, and save_path is explained for both the boolean and directory/full-.png-path forms.

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 ('Plot lap time against lap number for up to three drivers'), adds the visual encoding (marker shape = tyre compound), and names the return type (PNG image). This clearly separates it from data-returning siblings like get_lap_times and other plot_* tools.

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?

Provides concrete trigger phrasings ('show me the race pace of X vs Y', 'plot their lap times') and named use cases (degradation, safety-car phases), which tells the agent when this tool is the right choice. It stops short of explicitly naming when NOT to use it or which sibling to pick for raw lap data instead.

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