Skip to main content
Glama

get_session_drivers

Retrieve driver identifiers for a specific Formula 1 session by providing year, Grand Prix, and session type to get participant lists.

Instructions

Get list of drivers who participated in a session.

Retrieves all driver identifiers who took part in the specified session.

Args: year: The season year (2018 onwards) gp: The Grand Prix name (e.g., 'Monza', 'Monaco') or round number session: Session type - 'FP1', 'FP2', 'FP3', 'Q', 'S', 'R'

Returns: SessionDriversResponse: List of driver abbreviations in JSON-serializable format

Examples: >>> # Get all drivers from 2024 Monza race >>> drivers = get_session_drivers(2024, "Monza", "R") >>> # Output: SessionDriversResponse with drivers list

>>> # Get drivers from Free Practice 1
>>> fp1_drivers = get_session_drivers(2024, "Monaco", "FP1")

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYes
gpYes
sessionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesSeason year
driversYesList of driver abbreviations
event_nameYesGrand Prix name
session_nameYesSession name
total_driversYesTotal number of drivers

Implementation Reference

  • The main handler function that implements the get_session_drivers tool. It fetches the session using FastF1Client, loads minimal data, extracts drivers list, and returns a structured SessionDriversResponse.
    def get_session_drivers(year: int, gp: Union[str, int], session: str) -> SessionDriversResponse:
        """
        Get list of drivers who participated in a session.
    
        Retrieves all driver identifiers who took part in the specified session.
    
        Args:
            year: The season year (2018 onwards)
            gp: The Grand Prix name (e.g., 'Monza', 'Monaco') or round number
            session: Session type - 'FP1', 'FP2', 'FP3', 'Q', 'S', 'R'
    
        Returns:
            SessionDriversResponse: List of driver abbreviations in JSON-serializable format
    
        Examples:
            >>> # Get all drivers from 2024 Monza race
            >>> drivers = get_session_drivers(2024, "Monza", "R")
            >>> # Output: SessionDriversResponse with drivers list
    
            >>> # Get drivers from Free Practice 1
            >>> fp1_drivers = get_session_drivers(2024, "Monaco", "FP1")
        """
        session_obj = fastf1_client.get_session(year, gp, session)
        session_obj.load(laps=False, telemetry=False, weather=False, messages=False)
    
        drivers_list = session_obj.drivers.tolist() if hasattr(session_obj.drivers, 'tolist') else list(session_obj.drivers)
        event = session_obj.event
    
        return SessionDriversResponse(
            session_name=session_obj.name,
            event_name=event['EventName'],
            year=year,
            drivers=drivers_list,
            total_drivers=len(drivers_list)
        )
  • Pydantic model defining the output schema for the get_session_drivers tool response, including session details and list of drivers.
    class SessionDriversResponse(BaseModel):
        """Session drivers response."""
    
        session_name: str = Field(description="Session name")
        event_name: str = Field(description="Grand Prix name")
        year: int = Field(description="Season year")
        drivers: list[str] = Field(description="List of driver abbreviations")
        total_drivers: int = Field(description="Total number of drivers")
  • server.py:152-152 (registration)
    MCP tool registration decorator applied to the get_session_drivers function.
    mcp.tool()(get_session_drivers)
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses the tool retrieves data (implied read-only) and specifies the return format (JSON-serializable list of driver abbreviations), but lacks details on error handling, rate limits, authentication needs, or data freshness. It adds some behavioral context but not comprehensive coverage.

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 well-structured and appropriately sized. It begins with a clear purpose statement, provides parameter details in a labeled Args section, specifies the return format, and includes practical examples. Every sentence adds value without redundancy.

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?

Given the tool's moderate complexity (3 required parameters, no annotations, but has output schema), the description is fairly complete. It covers purpose, parameters, return format, and usage examples. The output schema existence means return values don't need detailed explanation. Minor gaps remain in behavioral aspects like error cases.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It provides clear semantics for all three parameters: year (season year from 2018 onwards), gp (Grand Prix name or round number), and session (specific session types with examples). The examples further illustrate parameter usage, adding significant value beyond the bare schema.

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?

The description clearly states the tool's purpose with a specific verb ('Get list of drivers') and resource ('who participated in a session'), distinguishing it from siblings like get_session_results or get_session_details. The first sentence directly answers what the tool does.

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 usage context through the examples (e.g., retrieving drivers for specific sessions), but doesn't explicitly state when to use this tool versus alternatives like get_session_results or get_driver_radio. No explicit when-not-to-use guidance or comparison with sibling tools is provided.

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/praneethravuri/pitstop'

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