Skip to main content
Glama
Josh-Mantel

F1 MCP Server

by Josh-Mantel

get_driver_standings

Retrieve Formula 1 driver championship standings for any season, optionally filtered by specific race round to track championship progression.

Instructions

Get driver championship standings for a season

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesSeason year (e.g., 2024)
round_numberNoRound number (optional, gets standings after this round)

Implementation Reference

  • The implementation of the get_driver_standings function that processes input arguments, retrieves race data via FastF1, calculates standings, and returns the formatted response.
    async def get_driver_standings(arguments: Dict[str, Any]) -> List[TextContent]:
        """Get driver championship standings."""
        year = arguments["year"]
        round_number = arguments.get("round_number")
    
        try:
            # Get the schedule to determine which round to use
            schedule = fastf1.get_event_schedule(year)
    
            if round_number is None:
                # Get latest completed round
                current_date = datetime.now()
                completed_rounds = schedule[schedule["EventDate"] <= current_date]
                if completed_rounds.empty:
                    round_number = 1
                else:
                    round_number = int(completed_rounds["RoundNumber"].max())
    
            # Get race session for standings calculation
            session = fastf1.get_session(year, round_number, "R")
            session.load()
    
            # Calculate standings (simplified - in real implementation you'd sum points across all rounds)
            results = session.results
            standings_data = []
    
            for _, driver in results.iterrows():
                standings_data.append(
                    {
                        "position": (
                            int(driver["Position"])
                            if pd.notna(driver["Position"])
                            else None
                        ),
                        "driver": driver["Abbreviation"],
                        "full_name": driver["FullName"],
                        "team": driver["TeamName"],
                        "points": (
                            float(driver["Points"])
                            if pd.notna(driver.get("Points", 0))
                            else 0
                        ),
                    }
                )
    
            # Sort by points (descending)
            standings_data.sort(key=lambda x: x["points"] or 0, reverse=True)
    
            result = {
                "year": year,
                "after_round": round_number,
                "standings": standings_data,
            }
    
            return [
                TextContent(
                    type="text",
                    text=f"F1 {year} Driver Standings (after Round {round_number}):\n\n"
                    + json.dumps(result, indent=2),
                )
            ]
  • The registration of the get_driver_standings tool in the server configuration, including the inputSchema.
    Tool(
        name="get_driver_standings",
        description="Get driver championship standings for a season",
        inputSchema={
            "type": "object",
            "properties": {
                "year": {
                    "type": "integer",
                    "description": "Season year (e.g., 2024)",
                },
                "round_number": {
                    "type": "integer",
                    "description": "Round number (optional, gets standings after this round)",
                    "minimum": 1,
                    "maximum": 24,
                },
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but offers minimal information. It doesn't describe whether this is a read-only operation, what authentication might be required, rate limits, error conditions, or the format/structure of the returned standings data. The description only states what data is retrieved without behavioral context.

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 extremely concise at just one sentence with zero wasted words. It's front-loaded with the core purpose and efficiently communicates the essential function without unnecessary elaboration, making it easy to parse 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?

For a tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what the returned standings data looks like (e.g., list format, included fields), how results are ordered, or whether it includes historical or current data. The lack of behavioral and output information leaves significant gaps for an AI agent to use this tool effectively.

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 mentions 'for a season' which aligns with the 'year' parameter, but adds no additional semantic context beyond what the schema provides. With 100% schema description coverage, the baseline is 3, and the description doesn't compensate with extra details about parameter interactions or usage examples.

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 ('driver championship standings for a season'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_constructor_standings' which would provide similar standings data for constructors instead of drivers.

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 'get_constructor_standings' for constructor data or 'get_session_results' for race-specific results, nor does it specify prerequisites or appropriate contexts for retrieving driver standings versus other data types.

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/Josh-Mantel/MCP-F1'

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