Skip to main content
Glama
rakeshgangwar

Formula One MCP Server

get_telemetry

Access Formula One telemetry data for a specific lap by providing season year, event identifier, session name, and driver identifier through the MCP server interface.

Instructions

Get telemetry data for a specific Formula One lap

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
driver_identifierYesDriver identifier (number, code, or name; e.g., "44", "HAM", "Hamilton")
event_identifierYesEvent name or round number (e.g., "Monaco" or "7")
lap_numberNoLap number (optional, gets fastest lap if not provided)
session_nameYesSession name (e.g., "Race", "Qualifying", "Sprint", "FP1", "FP2", "FP3")
yearYesSeason year (e.g., 2023)

Implementation Reference

  • Core handler function implementing get_telemetry logic: loads F1 session, retrieves driver lap (specific or fastest), fetches telemetry data via fastf1 library, serializes to JSON-compatible format with lap info.
    def get_telemetry(year, event_identifier, session_name, driver_identifier, lap_number=None):
        """Get telemetry data for a specific lap or fastest lap"""
        try:
            year = int(year)
            session = fastf1.get_session(year, event_identifier, session_name)
            session.load()
            
            # Get laps for the specified driver
            driver_laps = session.laps.pick_driver(driver_identifier)
            
            # Get the specific lap or fastest lap
            if lap_number:
                lap = driver_laps[driver_laps['LapNumber'] == int(lap_number)].iloc[0]
            else:
                lap = driver_laps.pick_fastest()
            
            # Get telemetry data
            telemetry = lap.get_telemetry()
            
            # Convert to JSON serializable format
            telemetry_dict = telemetry.to_dict(orient='records')
            clean_data = []
            
            for item in telemetry_dict:
                clean_item = {k: json_serial(v) for k, v in item.items()}
                clean_data.append(clean_item)
            
            # Add lap information
            lap_info = {
                "LapNumber": int(lap['LapNumber']) if not pd.isna(lap['LapNumber']) else None,
                "LapTime": str(lap['LapTime']) if not pd.isna(lap['LapTime']) else None,
                "Compound": lap['Compound'] if not pd.isna(lap['Compound']) else None,
                "TyreLife": int(lap['TyreLife']) if not pd.isna(lap['TyreLife']) else None
            }
            
            result = {
                "lapInfo": lap_info,
                "telemetry": clean_data
            }
            
            return {"status": "success", "data": result}
        except Exception as e:
            return {"status": "error", "message": str(e), "traceback": traceback.format_exc()}
  • MCP tool schema definition for get_telemetry, including input parameters and descriptions for validation.
    {
      name: 'get_telemetry',
      description: 'Get telemetry data for a specific Formula One lap',
      inputSchema: {
        type: 'object',
        properties: {
          year: {
            type: 'number',
            description: 'Season year (e.g., 2023)',
          },
          event_identifier: {
            type: 'string',
            description: 'Event name or round number (e.g., "Monaco" or "7")',
          },
          session_name: {
            type: 'string',
            description: 'Session name (e.g., "Race", "Qualifying", "Sprint", "FP1", "FP2", "FP3")',
          },
          driver_identifier: {
            type: 'string',
            description: 'Driver identifier (number, code, or name; e.g., "44", "HAM", "Hamilton")',
          },
          lap_number: {
            type: 'number',
            description: 'Lap number (optional, gets fastest lap if not provided)',
          },
        },
        required: ['year', 'event_identifier', 'session_name', 'driver_identifier'],
      },
    },
  • MCP TypeScript handler for get_telemetry tool: parses arguments, constructs parameter list, calls Python backend via executePythonFunction.
    case 'get_telemetry': {
      const typedArgs = args as TelemetryArgs;
      const telemetryArgs = [
        typedArgs.year.toString(),
        typedArgs.event_identifier.toString(),
        typedArgs.session_name.toString(),
        typedArgs.driver_identifier.toString(),
      ];
      
      if (typedArgs.lap_number !== undefined) {
        telemetryArgs.push(typedArgs.lap_number.toString());
      }
      
      result = await executePythonFunction('get_telemetry', telemetryArgs);
      break;
    }
  • Python dispatch dictionary registering get_telemetry function for invocation from command-line arguments in main().
    functions = {
        "get_event_schedule": get_event_schedule,
        "get_event_info": get_event_info,
        "get_session_results": get_session_results,
        "get_driver_info": get_driver_info,
        "analyze_driver_performance": analyze_driver_performance,
        "compare_drivers": compare_drivers,
        "get_telemetry": get_telemetry,
        "get_championship_standings": get_championship_standings
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what the tool does but lacks details on behavioral traits such as rate limits, authentication needs, data format of the telemetry, or whether it's a read-only operation. For a tool with no annotation coverage, this is a significant gap in transparency.

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?

The description is a single, clear sentence that is front-loaded and wastes no words. It efficiently conveys the core purpose without unnecessary elaboration, making it easy to parse and understand quickly.

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

Completeness2/5

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

Given the complexity of telemetry data and the lack of annotations and output schema, the description is incomplete. It doesn't explain what telemetry data includes, the return format, or any behavioral aspects like error handling. For a tool with 5 parameters and no structured output information, more context is needed to be fully helpful.

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 description coverage is 100%, so the schema already documents all parameters thoroughly. The description adds no additional meaning beyond what's in the schema, such as explaining relationships between parameters or providing examples. Baseline 3 is appropriate as the schema does the heavy lifting, but the description doesn't compensate or enhance understanding.

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?

The description clearly states the action ('Get telemetry data') and resource ('for a specific Formula One lap'), making the purpose immediately understandable. It distinguishes from siblings like 'get_driver_info' or 'get_session_results' by focusing on telemetry data rather than general information or results. However, it doesn't explicitly differentiate from potential telemetry-related siblings that might not exist.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'analyze_driver_performance' or 'compare_drivers' that might overlap in use cases, nor does it specify prerequisites or scenarios where this tool is preferred. Usage is implied through the description but not explicitly stated.

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

Install Server

Other Tools

Related Tools

Latest Blog Posts

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/rakeshgangwar/f1-mcp-server'

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