Skip to main content
Glama
rakeshgangwar

Formula One MCP Server

get_event_info

Retrieve detailed Formula One Grand Prix event data by specifying the year and event name or round number using the MCP server interface.

Instructions

Get detailed information about a specific Formula One Grand Prix

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
identifierYesEvent name or round number (e.g., "Monaco" or "7")
yearYesSeason year (e.g., 2023)

Implementation Reference

  • The core handler function that executes the tool logic: fetches F1 event data using fastf1.get_event based on year and identifier (name or round number), serializes it to JSON-compatible dict using json_serial helper.
    def get_event_info(year, identifier):
        """Get information about a specific event"""
        try:
            year = int(year)
            # Identifier can be event name or round number
            if identifier.isdigit():
                event = fastf1.get_event(year, int(identifier))
            else:
                event = fastf1.get_event(year, identifier)
            
            # Convert Series to dict and clean non-serializable values
            event_dict = event.to_dict()
            clean_dict = {k: json_serial(v) for k, v in event_dict.items()}
            
            return {"status": "success", "data": clean_dict}
        except Exception as e:
            return {"status": "error", "message": str(e), "traceback": traceback.format_exc()}
  • MCP tool schema definition: input validation schema specifying 'year' (number) and 'identifier' (string) parameters.
    {
      name: 'get_event_info',
      description: 'Get detailed information about a specific Formula One Grand Prix',
      inputSchema: {
        type: 'object',
        properties: {
          year: {
            type: 'number',
            description: 'Season year (e.g., 2023)',
          },
          identifier: {
            type: 'string',
            description: 'Event name or round number (e.g., "Monaco" or "7")',
          },
        },
        required: ['year', 'identifier'],
      },
    },
  • src/index.ts:298-304 (registration)
    Tool handler registration in the MCP CallToolRequestSchema switch: casts arguments and calls the Python bridge function executePythonFunction.
    case 'get_event_info': {
      const typedArgs = args as EventInfoArgs;
      result = await executePythonFunction('get_event_info', [
        typedArgs.year.toString(),
        typedArgs.identifier.toString(),
      ]);
      break;
  • Registers get_event_info in the Python script's function dispatcher dictionary for invocation via command-line arguments in main().
    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
    }
  • Supporting utility function used by get_event_info to serialize pandas/fastf1 objects to 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?

With no annotations provided, the description carries full burden for behavioral disclosure. It states it 'gets' information (implying a read operation) but doesn't cover aspects like authentication needs, rate limits, error conditions, or what 'detailed information' includes (e.g., circuit details, race results, weather). This leaves significant gaps 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, efficient sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized and front-loaded, making it easy for an agent to parse quickly.

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 moderate complexity (2 required parameters, no output schema, no annotations), the description is minimally adequate. It clarifies the resource (Formula One Grand Prix) but lacks context on return values, error handling, or differentiation from siblings. With no output schema, the agent must infer what 'detailed information' entails, which is a notable gap.

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%, so the schema already documents both parameters ('identifier' and 'year') with clear descriptions. The description adds no additional parameter semantics beyond what's in the schema, such as format examples or constraints, but this is acceptable given the high schema coverage baseline.

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 verb 'Get' and resource 'detailed information about a specific Formula One Grand Prix', making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get_event_schedule' or 'get_session_results', which might provide overlapping or related event information.

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 siblings like 'get_event_schedule' (which might list events) or 'get_session_results' (which might provide race outcomes), leaving the agent to infer usage context from tool names alone.

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