Skip to main content
Glama
Josh-Mantel

F1 MCP Server

by Josh-Mantel

get_race_schedule

Retrieve the Formula 1 race schedule for a specific season by providing the year, enabling users to access event dates and locations.

Instructions

Get the race schedule for a specific F1 season

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yearYesSeason year (e.g., 2024)

Implementation Reference

  • The handler function `get_race_schedule` that processes the tool request, fetches the schedule using fastf1, and formats the output.
    async def get_race_schedule(arguments: Dict[str, Any]) -> List[TextContent]:
        """Get race schedule for a season."""
        year = arguments["year"]
    
        try:
            schedule = fastf1.get_event_schedule(year)
    
            # Convert to a more readable format
            schedule_data = []
            for _, event in schedule.iterrows():
                schedule_data.append(
                    {
                        "round": (
                            int(event["RoundNumber"])
                            if pd.notna(event["RoundNumber"])
                            else None
                        ),
                        "event_name": event["EventName"],
                        "location": event["Location"],
                        "country": event["Country"],
                        "event_date": (
                            event["EventDate"].strftime("%Y-%m-%d")
                            if pd.notna(event["EventDate"])
                            else None
                        ),
                        "event_format": (
                            event["EventFormat"]
                            if "EventFormat" in event
                            else "Conventional"
                        ),
                    }
                )
    
            result = {
                "season": year,
                "total_rounds": len(schedule_data),
                "events": schedule_data,
            }
    
            return [
                TextContent(
                    type="text",
                    text=f"F1 {year} Race Schedule:\n\n" + json.dumps(result, indent=2),
                )
            ]
    
        except Exception as e:
            return [
                TextContent(
                    type="text", text=f"Error getting schedule for {year}: {str(e)}"
                )
            ]
  • Tool registration in the list_tools() function.
    Tool(
        name="get_race_schedule",
        description="Get the race schedule for a specific F1 season",
        inputSchema={
            "type": "object",
            "properties": {
                "year": {
                    "type": "integer",
                    "description": "Season year (e.g., 2024)",
                    "minimum": 1950,
                    "maximum": 2030,
                }
            },
            "required": ["year"],
        },
    ),
  • Routing logic in call_tool() to dispatch the tool call to the handler.
    if name == "get_race_schedule":
        return await get_race_schedule(arguments)
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. It states the action ('Get') but doesn't describe traits like response format (e.g., list of races with dates/locations), pagination, rate limits, or authentication needs. For a read operation with zero annotation coverage, this leaves significant gaps.

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 with zero wasted words. It's front-loaded with the core purpose and appropriately sized for a simple tool with one parameter.

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

Completeness3/5

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

Given the tool's low complexity (one parameter, no output schema, no annotations), the description is minimally adequate but incomplete. It covers the basic purpose but lacks behavioral details (e.g., output structure) that would help an agent use it correctly, especially with no annotations to compensate.

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?

Schema description coverage is 100%, with the parameter 'year' fully documented in the schema (type, description, min/max). The description adds no additional parameter semantics beyond implying the year selects a season, which is already clear from the schema. Baseline 3 is appropriate when 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') and resource ('race schedule'), and specifies the scope ('for a specific F1 season'). It doesn't explicitly differentiate from sibling tools like 'get_session_results', but the resource focus is distinct enough for clarity.

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_session_results' (which might overlap for race events) or clarify if this is for upcoming vs. historical schedules. Usage context is implied but not explicit.

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