Skip to main content
Glama

f1_predict_pit_strategy

Read-onlyIdempotent

Predict recommended F1 pit-stop laps and tyre compound sequences for a driver, projecting race strategy from the current lap.

Instructions

Predict the optimal pit-stop strategy for a driver in an F1 race session.

Args: session_key: OpenF1 session identifier for a recorded race. driver_number: Driver's race number (driver numbers change by season; use f1_get_drivers). current_lap: Current lap to project from (default 1 = full race ahead). total_laps: Total race laps. If omitted, estimated from the regulation minimum race distance (305 km; Monaco 260 km) over the circuit's lap length; INVALID_INPUT when the circuit is unknown. An explicit value always wins.

Returns: data.stop_laps: recommended pit laps. data.compound_sequence: tyre compounds for each stint. data.expected_finish_position: currently always None (not modelled). data.confidence: 0.0-1.0 model confidence. data.net_saving_s: stay-out time minus the best one-stop time (seconds). data.current_tyre_age: laps on the current tyre set at current_lap. meta.total_laps: race length used. meta.total_laps_source: "explicit" or "regulation_estimate". meta.estimated: true.

Example: f1_predict_pit_strategy(session_key=11353, driver_number=1, total_laps=72) f1_predict_pit_strategy(session_key=11353, driver_number=1, current_lap=20)

Input Schema

NameRequiredDescriptionDefault
total_lapsNoTotal race laps. If omitted, estimated from the regulation minimum race distance (305 km; Monaco 260 km) over the circuit's lap length; INVALID_INPUT when the circuit is unknown. An explicit value always wins.
current_lapNoCurrent lap to project from (default 1 = full race ahead).
session_keyYesOpenF1 session identifier for a recorded race.
driver_numberYesDriver's race number (driver numbers change by season; use f1_get_drivers).

Output Schema

NameRequiredDescriptionDefault
dataNo
metaNo
errorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.4.0
    • changedInput schema / properties / driver_number / description
      Previous value: -"Driver's race number (e.g. 1 for Verstappen)."New value: +"Driver's race number (driver numbers change by season; use f1_get_drivers)."
    • changedInput schema / properties / total_laps / description
      Previous value: -"Total race laps. If omitted, inferred from the highest observed lap_number in the fetched laps (correct for Monaco 78 / Spa 44), falling back to 57 when no laps are available. An explicit value always wins."New value: +"Total race laps. If omitted, estimated from the regulation minimum race distance (305 km; Monaco 260 km) over the circuit's lap length; INVALID_INPUT when the circuit is unknown. An explicit value always wins."
  2. First observedv0.3.1

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, open-world), so the bar is lower. The description still adds real value: it discloses the regulation-distance fallback for total_laps, the INVALID_INPUT failure mode on unknown circuits, explicit-wins precedence, and that expected_finish_position is always None — an honest limitation disclosure. It does not mention cost or latency, but nothing material is hidden.

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 with a one-sentence purpose, then Args/Returns/Example in a scannable structure. The Returns section is long but each field is load-bearing for interpreting results. Slight repetition between the Args text and the schema descriptions is the main inefficiency.

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 predictive tool with four parameters and an output schema, the description covers inputs, the fallback logic, key output fields, a caveat field, and two concrete call examples. An agent can call it correctly from this alone; the only gap is routing guidance against related strategy tools.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents all four parameters and the description's Args block is largely a restatement. The only marginal addition is the default-1 meaning 'full race ahead', which is close to what the schema says. Baseline 3 is appropriate.

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: predicting an optimal pit-stop strategy for a named driver in a recorded race session. The scope ('session + driver + current lap') is precise enough to distinguish it from data-retrieval siblings like f1_get_lap_times. However, it never names or contrasts itself with strategy-adjacent siblings such as f1_undercut_window, f1_tyre_degradation, or f1_weather_strategy_impact.

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 description implies the usage context ('recorded race', 'use f1_get_drivers' to obtain driver numbers), which gives the agent a prerequisite hint. But it offers no guidance on when to choose this tool versus f1_undercut_window, f1_tyre_degradation, or f1_weather_strategy_impact — the alternatives an agent would most plausibly confuse it with.

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