get_driver_info
Retrieve detailed information about a specific Formula One driver, including their performance statistics for a given year, event, and session, using the Formula One MCP Server.
Instructions
Get information about a specific Formula One driver
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| driver_identifier | Yes | Driver identifier (number, code, or name; e.g., "44", "HAM", "Hamilton") | |
| event_identifier | Yes | Event name or round number (e.g., "Monaco" or "7") | |
| session_name | Yes | Session name (e.g., "Race", "Qualifying", "Sprint", "FP1", "FP2", "FP3") | |
| year | Yes | Season year (e.g., 2023) |
Input Schema (JSON Schema)
{
"properties": {
"driver_identifier": {
"description": "Driver identifier (number, code, or name; e.g., \"44\", \"HAM\", \"Hamilton\")",
"type": "string"
},
"event_identifier": {
"description": "Event name or round number (e.g., \"Monaco\" or \"7\")",
"type": "string"
},
"session_name": {
"description": "Session name (e.g., \"Race\", \"Qualifying\", \"Sprint\", \"FP1\", \"FP2\", \"FP3\")",
"type": "string"
},
"year": {
"description": "Season year (e.g., 2023)",
"type": "number"
}
},
"required": [
"year",
"event_identifier",
"session_name",
"driver_identifier"
],
"type": "object"
}
Implementation Reference
- python/f1_data.py:87-102 (handler)Core handler function that executes the tool logic: loads F1 session data and retrieves specific driver information using the fastf1 library.def get_driver_info(year, event_identifier, session_name, driver_identifier): """Get information about a specific driver""" try: year = int(year) session = fastf1.get_session(year, event_identifier, session_name) session.load(telemetry=False) # Load session without telemetry for faster results driver_info = session.get_driver(driver_identifier) # Convert to JSON serializable format driver_dict = driver_info.to_dict() clean_dict = {k: json_serial(v) for k, v in driver_dict.items()} return {"status": "success", "data": clean_dict} except Exception as e: return {"status": "error", "message": str(e), "traceback": traceback.format_exc()}
- src/index.ts:145-170 (schema)Tool schema definition including name, description, and input validation schema for the get_driver_info tool.{ name: 'get_driver_info', description: 'Get information about a specific Formula One driver', inputSchema: { type: 'object', properties: { year: { type: 'number', description: 'Season year (e.g., 2023)', }, event_identifier: { type: 'string', description: 'Event name or round number (e.g., "Monaco" or "7")', }, session_name: { type: 'string', description: 'Session name (e.g., "Race", "Qualifying", "Sprint", "FP1", "FP2", "FP3")', }, driver_identifier: { type: 'string', description: 'Driver identifier (number, code, or name; e.g., "44", "HAM", "Hamilton")', }, }, required: ['year', 'event_identifier', 'session_name', 'driver_identifier'], }, },
- src/index.ts:317-326 (registration)MCP tool registration and dispatching logic in the CallToolRequest handler switch statement.case 'get_driver_info': { const typedArgs = args as DriverInfoArgs; result = await executePythonFunction('get_driver_info', [ typedArgs.year.toString(), typedArgs.event_identifier.toString(), typedArgs.session_name.toString(), typedArgs.driver_identifier.toString(), ]); break; }
- python/f1_data.py:294-294 (registration)Internal registration of the get_driver_info function in the Python dispatch dictionary."get_driver_info": get_driver_info,