Skip to main content
Glama
notsedano

Formula One MCP Server

get_event_info

Retrieve detailed information about a specific Formula One Grand Prix event by providing the season year and event name or round number.

Instructions

Get detailed information about a specific Formula One Grand Prix

Input Schema

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

Implementation Reference

  • The core handler function implementing the get_event_info tool logic. It validates inputs, fetches event data using fastf1.get_event(), serializes to JSON-compatible format using json_serial helper, and returns structured success/error response.
    def get_event_info(year: Any, identifier: str) -> dict[str, Any]:
        """
        Get information about a specific Formula One event.
    
        Args:
            year (int or str): The year of the F1 season
            identifier (str): Event name or round number
    
        Returns:
            dict: Status and event data or error information
        """
        try:
            # Validate year
            year_int = validate_year(year)
    
            # Validate identifier
            if not identifier or not isinstance(identifier, str | int):
                raise ValueError("Invalid event identifier")
    
            logger.debug(f"Fetching event info for {year_int}, event: {identifier}")
    
            # Identifier can be event name or round number
            if str(identifier).isdigit():
                event = fastf1.get_event(year_int, int(identifier))
            else:
                event = fastf1.get_event(year_int, str(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()}
    
            logger.info(
                f"Successfully retrieved event info for {year_int}, event: {identifier}"
            )
            return {"status": "success", "data": clean_dict}
        except Exception as e:
            logger.error(f"Error retrieving event info: {str(e)}", exc_info=True)
            return {
                "status": "error",
                "message": f"Failed to retrieve event information: {str(e)}",
            }
  • MCP tool registration in list_tools(). Defines the tool name, description, and input schema for get_event_info.
    types.Tool(
        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"],
        },
    ),
  • Dispatch logic in the MCP call_tool handler that invokes the get_event_info function with sanitized arguments.
    elif name == "get_event_info":
        if "identifier" not in arguments:
            raise ValueError("Missing required argument: identifier")
        identifier = str(arguments["identifier"])
        result = get_event_info(sanitized_args["year"], identifier)
  • Client-side TypeScript schema definition for get_event_info tool used in Gemini function calling.
    name: 'get_event_info',
    description: 'Get detailed information about a specific Formula One Grand Prix including dates, location, and track details',
    parameters: {
      type: SchemaType.OBJECT,
      properties: {
        year: {
          type: SchemaType.NUMBER,
          description: 'Season year (e.g., 2024, 2023, 2022)',
        },
        identifier: {
          type: SchemaType.STRING,
          description: 'Event name or round number (e.g., "Monaco", "British", "7", "15")',
        }
      },
      required: ['year', 'identifier']
    }
  • Tool mapping registration in the HTTP bridge that directly imports and calls the get_event_info handler from f1_mcp_server.f1_data.
    'get_event_info': get_event_info,
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 'gets' information, implying a read-only operation, but does not specify whether it requires authentication, has rate limits, returns structured data, or handles errors. This leaves significant behavioral traits undocumented.

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 without unnecessary words. It is front-loaded with the core action and resource, making it easy to understand quickly, and every part of the sentence contributes meaning.

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 lack of annotations and output schema, the description is incomplete. It does not explain what 'detailed information' includes (e.g., event date, circuit, results), how results are structured, or potential error conditions. For a tool with no structured behavioral or output data, more context is needed to guide effective use.

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 clear documentation for 'year' and 'identifier'. The description adds no additional parameter semantics beyond what the schema provides, such as format examples or constraints. With high schema coverage, the baseline score of 3 is appropriate as the description does not compensate but also does not detract.

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 clearly states the action ('Get detailed information') and the resource ('specific Formula One Grand Prix'), making the purpose explicit. It distinguishes from siblings like 'get_event_schedule' (which lists events) and 'get_session_results' (which focuses on race sessions), as this tool retrieves detailed info about a single event.

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 when to choose it over siblings like 'get_event_schedule' (for schedules) or 'get_session_results' (for results), nor does it specify prerequisites or exclusions, leaving usage context unclear.

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

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