Skip to main content
Glama
rakeshgangwar

Formula One MCP Server

get_session_results

Retrieve Formula One session results by specifying the season year, event identifier, and session name. Access race, qualifying, or practice data for detailed analysis.

Instructions

Get results for a specific Formula One session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_identifierYesEvent name or round number (e.g., "Monaco" or "7")
session_nameYesSession name (e.g., "Race", "Qualifying", "Sprint", "FP1", "FP2", "FP3")
yearYesSeason year (e.g., 2023)

Implementation Reference

  • The core handler function that executes the get_session_results tool logic: loads the F1 session using fastf1, retrieves results, and serializes to JSON.
    def get_session_results(year, event_identifier, session_name):
        """Get results for a specific session"""
        try:
            year = int(year)
            session = fastf1.get_session(year, event_identifier, session_name)
            session.load(telemetry=False)  # Load session without telemetry for faster results
            
            # Get results as a DataFrame
            results = session.results
            
            # Convert results to JSON serializable format
            result_list = []
            for driver_num, result in results.items():
                driver_result = result.to_dict()
                # Clean and convert non-serializable values
                clean_dict = {k: json_serial(v) for k, v in driver_result.items()}
                result_list.append(clean_dict)
            
            return {"status": "success", "data": result_list}
        except Exception as e:
            return {"status": "error", "message": str(e), "traceback": traceback.format_exc()}
  • Input schema definition for the get_session_results tool, specifying parameters: year (number), event_identifier (string), session_name (string).
    {
      name: 'get_session_results',
      description: 'Get results for a specific Formula One session',
      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")',
          },
        },
        required: ['year', 'event_identifier', 'session_name'],
      },
  • Registration of the get_session_results function in the main functions dictionary used by the Python bridge to dispatch calls.
    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
    }
  • MCP tool call handler in TypeScript that dispatches to the Python implementation via executePythonFunction.
    case 'get_session_results': {
      const typedArgs = args as SessionResultsArgs;
      result = await executePythonFunction('get_session_results', [
        typedArgs.year.toString(),
        typedArgs.event_identifier.toString(),
        typedArgs.session_name.toString(),
      ]);
      break;
  • src/index.ts:89-272 (registration)
    MCP server registration of the tool in the listTools response, including name and schema.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => ({
      tools: [
        {
          name: 'get_event_schedule',
          description: 'Get Formula One race calendar for a specific season',
          inputSchema: {
            type: 'object',
            properties: {
              year: {
                type: 'number',
                description: 'Season year (e.g., 2023)',
              },
            },
            required: ['year'],
          },
        },
        {
          name: 'get_event_info',
          description: 'Get detailed information about a specific Formula One Grand Prix',
          inputSchema: {
            type: 'object',
            properties: {
              year: {
                type: 'number',
                description: 'Season year (e.g., 2023)',
              },
              identifier: {
                type: 'string',
                description: 'Event name or round number (e.g., "Monaco" or "7")',
              },
            },
            required: ['year', 'identifier'],
          },
        },
        {
          name: 'get_session_results',
          description: 'Get results for a specific Formula One session',
          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")',
              },
            },
            required: ['year', 'event_identifier', 'session_name'],
          },
        },
        {
          name: 'get_driver_info',
          description: 'Get information about a specific Formula One driver',
          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")',
              },
            },
            required: ['year', 'event_identifier', 'session_name', 'driver_identifier'],
          },
        },
        {
          name: 'analyze_driver_performance',
          description: 'Analyze a driver\'s performance in a Formula One session',
          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")',
              },
            },
            required: ['year', 'event_identifier', 'session_name', 'driver_identifier'],
          },
        },
        {
          name: 'compare_drivers',
          description: 'Compare performance between multiple Formula One drivers',
          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")',
              },
              drivers: {
                type: 'string',
                description: 'Comma-separated list of driver codes (e.g., "HAM,VER,LEC")',
              },
            },
            required: ['year', 'event_identifier', 'session_name', 'drivers'],
          },
        },
        {
          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'],
          },
        },
        {
          name: 'get_championship_standings',
          description: 'Get Formula One championship standings',
          inputSchema: {
            type: 'object',
            properties: {
              year: {
                type: 'number',
                description: 'Season year (e.g., 2023)',
              },
              round_num: {
                type: 'number',
                description: 'Round number (optional, gets latest standings if not provided)',
              },
            },
            required: ['year'],
          },
        },
      ],
    }));
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. It doesn't specify whether this is a read-only operation, what format results are returned in, whether authentication is required, or any rate limits. For a tool that presumably queries historical data, this leaves significant behavioral questions unanswered.

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 perfectly concise at a single sentence that directly states the tool's purpose with zero wasted words. It's front-loaded with the essential information and doesn't include any unnecessary elaboration or redundant phrasing.

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 lack of annotations and output schema, the description is insufficiently complete. For a tool that retrieves session results, users need to know what format results are returned in (e.g., structured data, raw text, specific metrics), whether it includes timing data, driver positions, or other details. The current description leaves too many contextual questions unanswered.

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?

The description adds no parameter semantics beyond what's already documented in the schema, which has 100% coverage with clear descriptions for all three parameters. The baseline score of 3 reflects adequate parameter documentation entirely through the schema, with the description providing no additional value in this dimension.

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 tool's purpose with a specific verb ('Get') and resource ('results for a specific Formula One session'), making it immediately understandable. However, it doesn't distinguish this tool from potential siblings like 'get_event_info' or 'get_telemetry' that might also provide session-related data, preventing a perfect score.

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. With siblings like 'get_event_info' (which might include session results) and 'get_telemetry' (which could provide detailed session data), there's no indication of what makes this tool distinct or when it should be preferred over other options.

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