get_event_data
Retrieve real-time game event data from the League of Legends client to monitor in-game occurrences and track match progress.
Instructions
Get a list of events that have occurred in the game.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:178-184 (handler)The main handler function for the 'get_event_data' tool. It fetches event data from the League of Legends live client API endpoint '/liveclientdata/eventdata' using an HTTP client with timeout handling.async def get_event_data() -> dict: """ Get a list of events that have occurred in the game. """ async with get_lol_client() as client: response = await client.get("/liveclientdata/eventdata") return response.json()
- main.py:176-176 (registration)The @mcp.tool() decorator registers the get_event_data function as an MCP tool in the FastMCP server.@mcp.tool()
- main.py:177-177 (helper)Applies the with_timeout decorator to handle various HTTP errors and timeouts for the tool.@with_timeout
- main.py:50-58 (helper)Helper function to create the HTTP client configured for the LoL client API, used by get_event_data.def get_lol_client(): """ Create an HTTP client for the League of Legends client. """ return httpx.AsyncClient( base_url=LOL_CLIENT_HOST, verify="./certs/riotgames.pem", timeout=DEFAULT_TIMEOUT )