Skip to main content
Glama
rakeshgangwar

Formula One MCP Server

get_event_schedule

Retrieve the Formula One race calendar for a specific season by entering the year. Access event schedules, including race dates and locations, for accurate planning and updates.

Instructions

Get Formula One race calendar for a specific season

Input Schema

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

Implementation Reference

  • The core handler function that executes the tool logic: fetches the F1 event schedule for the given year using fastf1.get_event_schedule(year), processes the pandas DataFrame into a JSON-serializable list of event dictionaries using json_serial helper, and returns success/error response.
    def get_event_schedule(year):
        """Get the event schedule for a specified season"""
        try:
            year = int(year)
            schedule = fastf1.get_event_schedule(year)
            
            # Convert DataFrame to JSON serializable format
            result = []
            for _, row in schedule.iterrows():
                event_dict = row.to_dict()
                # Clean and convert non-serializable values
                clean_dict = {k: json_serial(v) for k, v in event_dict.items()}
                result.append(clean_dict)
            
            return {"status": "success", "data": result}
        except Exception as e:
            return {"status": "error", "message": str(e), "traceback": traceback.format_exc()}
  • Defines the tool schema including name, description, and input schema requiring a 'year' number parameter for input validation.
    {
      name: 'get_event_schedule',
      description: 'Get Formula One race calendar for a specific season',
      inputSchema: {
        type: 'object',
        properties: {
          year: {
            type: 'number',
            description: 'Season year (e.g., 2023)',
          },
        },
        required: ['year'],
      },
    },
  • Registers the get_event_schedule function (along with others) in a dictionary used by main() to dynamically invoke the correct handler based on sys.argv[1].
    functions = {
        "get_event_schedule": get_event_schedule,
        "get_event_info": get_event_info,
        "get_session_results": get_session_results,
        "get_driver_info": get_driver_info,
        "analyze_driver_performance": analyze_driver_performance,
        "compare_drivers": compare_drivers,
        "get_telemetry": get_telemetry,
        "get_championship_standings": get_championship_standings
    }
  • MCP tool call handler case that proxies the request to the Python implementation by calling executePythonFunction with the tool name and year argument.
    case 'get_event_schedule': {
      const typedArgs = args as EventScheduleArgs;
      result = await executePythonFunction('get_event_schedule', [typedArgs.year.toString()]);
      break;
  • Helper utility function used in get_event_schedule to serialize pandas/numpy/datetime objects into JSON-compatible formats.
    def json_serial(obj):
        """Helper function to convert non-JSON serializable objects to strings"""
        if isinstance(obj, (datetime, pd.Timestamp)):
            return obj.isoformat()
        if isinstance(obj, (np.integer, np.floating)):
            return float(obj) if isinstance(obj, np.floating) else int(obj)
        if pd.isna(obj):
            return None
        return str(obj)
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 retrieves a calendar but does not describe any behavioral traits, such as whether it's a read-only operation, potential rate limits, authentication needs, error handling, or the format of the returned data. This is a significant gap for a tool with no annotation 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 a single, clear sentence that efficiently conveys the tool's purpose without any unnecessary words. It is front-loaded with the core functionality, making it easy for an agent to quickly understand what the tool does. Every part of the sentence earns its place by specifying the resource and scope.

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 retrieving a race calendar, the lack of annotations, and no output schema, the description is incomplete. It does not explain what the return value includes (e.g., list of events, dates, locations) or any behavioral aspects like data freshness or limitations. For a tool with no structured output information, more context is needed to be fully helpful.

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, with the 'year' parameter clearly documented as 'Season year (e.g., 2023).' The description adds no additional parameter semantics beyond what the schema provides, such as valid year ranges or examples. Given the 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: 'Get Formula One race calendar for a specific season.' It specifies the verb ('Get') and resource ('Formula One race calendar'), and mentions the scope ('for a specific season'). However, it does not explicitly differentiate this tool from its sibling tools like 'get_event_info' or 'get_session_results,' which might also relate to events or sessions.

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 does not mention any prerequisites, exclusions, or suggest other tools for related tasks, such as using 'get_event_info' for details on a single event or 'get_session_results' for race results. This lack of context leaves the agent without clear usage instructions.

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

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

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