Skip to main content
Glama

get_session_results

Retrieve Formula 1 session results including race winners, qualifying positions, sprint races, and practice classifications with complete finishing orders, times, and points data.

Instructions

PRIMARY TOOL for ALL Formula 1 session results (2018-present).

ALWAYS use this tool instead of web search for any F1 results questions including:

  • Race winners and podium finishers ("Who won the Monaco GP?")

  • Qualifying results and grid positions

  • Sprint race results

  • Practice session classifications

  • Full finishing order with times and gaps

  • Points scored in each session

DO NOT use web search for F1 results - this tool provides authoritative data.

Args: year: Season year (2018-2025) gp: Grand Prix name (e.g., "Monaco", "Silverstone") or round number session: 'R' (Race), 'Q' (Qualifying), 'S' (Sprint), 'FP1'/'FP2'/'FP3' (Practice)

Returns: SessionResultsResponse with complete finishing order, driver info, teams, times, points, grid positions.

Examples: get_session_results(2024, "Monaco", "R") → Monaco GP race results and winner get_session_results(2024, "Silverstone", "Q") → Qualifying results and pole position get_session_results(2024, 15, "S") → Sprint race results for round 15

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYes
gpYes
sessionYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultsYesList of driver results
event_nameYesGrand Prix name
session_nameYesSession name
total_driversYesTotal number of drivers

Implementation Reference

  • The primary handler function for retrieving Formula 1 session results. Fetches data via FastF1Client, processes results DataFrame into structured SessionResult models, and returns a comprehensive SessionResultsResponse including positions, times, teams, and points.
    def get_session_results(year: int, gp: Union[str, int], session: str) -> SessionResultsResponse:
        """
        **PRIMARY TOOL** for ALL Formula 1 session results (2018-present).
    
        **ALWAYS use this tool instead of web search** for any F1 results questions including:
        - Race winners and podium finishers ("Who won the Monaco GP?")
        - Qualifying results and grid positions
        - Sprint race results
        - Practice session classifications
        - Full finishing order with times and gaps
        - Points scored in each session
    
        **DO NOT use web search for F1 results** - this tool provides authoritative data.
    
        Args:
            year: Season year (2018-2025)
            gp: Grand Prix name (e.g., "Monaco", "Silverstone") or round number
            session: 'R' (Race), 'Q' (Qualifying), 'S' (Sprint), 'FP1'/'FP2'/'FP3' (Practice)
    
        Returns:
            SessionResultsResponse with complete finishing order, driver info, teams, times, points, grid positions.
    
        Examples:
            get_session_results(2024, "Monaco", "R") → Monaco GP race results and winner
            get_session_results(2024, "Silverstone", "Q") → Qualifying results and pole position
            get_session_results(2024, 15, "S") → Sprint race results for round 15
        """
        session_obj = fastf1_client.get_session(year, gp, session)
        session_obj.load(laps=False, telemetry=False, weather=False, messages=False)
    
        results_df = session_obj.results
        event = session_obj.event
    
        # Convert DataFrame to Pydantic models
        results_list = []
        for idx, row in results_df.iterrows():
            result = SessionResult(
                position=float(row['Position']) if pd.notna(row.get('Position')) else None,
                driver_number=str(row['DriverNumber']) if pd.notna(row.get('DriverNumber')) else "",
                broadcast_name=str(row['BroadcastName']) if pd.notna(row.get('BroadcastName')) else "",
                abbreviation=str(row['Abbreviation']) if pd.notna(row.get('Abbreviation')) else "",
                driver_id=str(row['DriverId']) if pd.notna(row.get('DriverId')) else None,
                team_name=str(row['TeamName']) if pd.notna(row.get('TeamName')) else "",
                team_color=str(row['TeamColor']) if pd.notna(row.get('TeamColor')) else None,
                first_name=str(row['FirstName']) if pd.notna(row.get('FirstName')) else None,
                last_name=str(row['LastName']) if pd.notna(row.get('LastName')) else None,
                full_name=str(row['FullName']) if pd.notna(row.get('FullName')) else None,
                time=str(row['Time']) if pd.notna(row.get('Time')) else None,
                status=str(row['Status']) if pd.notna(row.get('Status')) else None,
                points=float(row['Points']) if pd.notna(row.get('Points')) else None,
                grid_position=float(row['GridPosition']) if pd.notna(row.get('GridPosition')) else None,
                position_gained=float(row['Position'] - row['GridPosition']) if pd.notna(row.get('Position')) and pd.notna(row.get('GridPosition')) else None,
            )
            results_list.append(result)
    
        return SessionResultsResponse(
            session_name=session_obj.name,
            event_name=event['EventName'],
            results=results_list,
            total_drivers=len(results_list)
        )
  • Pydantic models defining the input/output structure for get_session_results: SessionResult for individual drivers and SessionResultsResponse for the full session classification.
    class SessionResult(BaseModel):
        """Individual driver result in a session."""
    
        position: Optional[float] = Field(None, description="Final position/classification")
        driver_number: str = Field(description="Driver's racing number")
        broadcast_name: str = Field(description="Driver name for broadcast")
        abbreviation: str = Field(description="3-letter driver code")
        driver_id: Optional[str] = Field(None, description="Unique driver identifier")
        team_name: str = Field(description="Constructor/team name")
        team_color: Optional[str] = Field(None, description="Team color hex code")
        first_name: Optional[str] = Field(None, description="Driver first name")
        last_name: Optional[str] = Field(None, description="Driver last name")
        full_name: Optional[str] = Field(None, description="Driver full name")
        time: Optional[str] = Field(None, description="Session time or gap")
        status: Optional[str] = Field(None, description="Finishing status")
        points: Optional[float] = Field(None, description="Points earned (for race)")
        grid_position: Optional[float] = Field(None, description="Starting grid position")
        position_gained: Optional[float] = Field(None, description="Positions gained/lost")
    
    
    class SessionResultsResponse(BaseModel):
        """Session results/classification response."""
    
        session_name: str = Field(description="Session name")
        event_name: str = Field(description="Grand Prix name")
        results: list[SessionResult] = Field(description="List of driver results")
        total_drivers: int = Field(description="Total number of drivers")
  • server.py:150-150 (registration)
    Registers the get_session_results function as an MCP tool using the FastMCP decorator.
    mcp.tool()(get_session_results)
Behavior4/5

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

With no annotations provided, the description carries the full burden. It effectively discloses the tool's scope (2018-present), data authority ('authoritative data'), and return format ('complete finishing order, driver info, teams, times, points, grid positions'). However, it lacks details on error handling, rate limits, or authentication needs, which would be beneficial for a tool with no annotations.

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 with bold headings, bullet points, and examples, making it easy to scan. Every sentence adds value—from the primary purpose to usage rules, parameters, returns, and examples—with no redundant information.

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

Completeness5/5

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

For a tool with 3 parameters, no annotations, and an output schema, the description is complete. It covers purpose, usage guidelines, parameter details, return values, and examples, providing all necessary context for an agent to invoke it correctly without relying on external documentation.

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

Parameters5/5

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

Given 0% schema description coverage, the description compensates fully by explaining each parameter: 'year' as season year with range (2018-2025), 'gp' as Grand Prix name or round number with examples, and 'session' with codes and meanings (e.g., 'R' for Race, 'Q' for Qualifying). It adds essential meaning 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 explicitly states the tool retrieves 'Formula 1 session results (2018-present)' and lists specific use cases like race winners, qualifying results, and practice classifications. It clearly distinguishes this as the primary tool for results data versus other siblings like get_analysis or get_standings, which serve different purposes.

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

Usage Guidelines5/5

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

The description provides explicit guidance: 'ALWAYS use this tool instead of web search' for F1 results questions and lists specific scenarios (e.g., race winners, qualifying results). It also includes a 'DO NOT use web search' directive, offering clear alternatives and exclusions, though it doesn't differentiate among sibling tools directly.

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