Skip to main content
Glama
notsedano

Formula One MCP Server

get_driver_info

Retrieve Formula One driver details including performance data and statistics for specific seasons, events, and sessions.

Instructions

Get information about a specific Formula One driver

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesSeason year (e.g., 2023)
event_identifierYesEvent name or round number (e.g., 'Monaco' or '7')
session_nameYesSession name (e.g., 'Race', 'Qualifying', 'Sprint', 'FP1', 'FP2', 'FP3')
driver_identifierYesDriver identifier (number, code, or name; e.g., '44', 'HAM', 'Hamilton')

Implementation Reference

  • Core handler function that implements the get_driver_info tool logic. Loads F1 session data using fastf1 library and retrieves specific driver information.
    def get_driver_info(
        year: Any, event_identifier: str, session_name: str, driver_identifier: str
    ) -> dict[str, Any]:
        """
        Get information about a specific Formula One driver.
    
        Args:
            year (int or str): The year of the F1 season
            event_identifier (str): Event name or round number
            session_name (str): Session type (Race, Qualifying, Sprint, etc.)
            driver_identifier (str): Driver number, code, or name
    
        Returns:
            dict: Status and driver information or error information
        """
        try:
            # Validate year
            year_int = validate_year(year)
    
            logger.debug(
                f"Fetching driver info for {year_int}, "
                f"event: {event_identifier}, session: {session_name}, "
                f"driver: {driver_identifier}"
            )
            session = fastf1.get_session(year_int, event_identifier, session_name)
            # Load session without telemetry for faster results
            session.load(telemetry=False)
    
            driver_info = session.get_driver(driver_identifier)
    
            # Convert to JSON serializable format
            driver_dict = driver_info.to_dict()
            clean_dict = {k: json_serial(v) for k, v in driver_dict.items()}
    
            logger.info(f"Successfully retrieved driver info for {driver_identifier}")
            return {"status": "success", "data": clean_dict}
        except Exception as e:
            logger.error(f"Error retrieving driver info: {str(e)}", exc_info=True)
            return {
                "status": "error",
                "message": f"Failed to retrieve driver information: {str(e)}",
            }
  • MCP tool registration in list_tools() including name, description, and JSON schema for input validation.
    types.Tool(
        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",
            ],
        },
    ),
  • Dispatch logic in the MCP call_tool handler that invokes the get_driver_info function with validated arguments.
    result = get_driver_info(
        sanitized_args["year"],
        str(arguments["event_identifier"]),
        str(arguments["session_name"]),
        str(arguments["driver_identifier"]),
    )
  • Tool mapping/registration in the MCP bridge application for direct function calls.
    'get_driver_info': get_driver_info,
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 the tool 'gets information,' implying a read-only operation, but doesn't specify what kind of information is returned (e.g., biographical details, session stats, or telemetry), whether there are rate limits, authentication needs, or error conditions. This leaves significant gaps for a tool with four required parameters.

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, efficient sentence that directly states the tool's purpose without any fluff or redundancy. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly, earning a top score for conciseness.

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 four required parameters and no output schema, the description is incomplete. It doesn't explain what information is returned (e.g., driver stats, session performance, or personal details), leaving the agent uncertain about the tool's output. With no annotations and a read-like operation implied, more context on return values or behavioral traits is needed for adequate completeness.

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 input schema has 100% description coverage, providing clear details for all four parameters (year, event_identifier, session_name, driver_identifier). The description adds no additional parameter semantics beyond the schema, such as explaining how these parameters interact to fetch driver info. With high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

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 information') and resource ('about a specific Formula One driver'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'analyze_driver_performance' or 'get_session_results', which might also provide driver-related information, so it misses the highest score for sibling distinction.

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 sibling tools like 'analyze_driver_performance' and 'get_session_results' available, there's no indication of whether this tool is for basic driver details, performance metrics, or session-specific data, leaving the agent to guess based on context alone.

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

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

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