get_all_game_data
Retrieve comprehensive in-game data for League of Legends using the /allgamedata endpoint, ideal for testing or accessing full client details from the Live Client Data API.
Instructions
The Live League of Legends Client Data API has a number of endpoints that return a subset of the data returned by the /allgamedata endpoint. This endpoint is great for testing the Live Client Data API, but unless you actually need all the data from this endpoint, use one of the endpoints listed below that return a subset of the response.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:62-75 (handler)The main handler function for the 'get_all_game_data' tool. It is decorated with @mcp.tool() for registration and @with_timeout for error handling. Fetches all game data from the League of Legends live client API endpoint '/liveclientdata/allgamedata'.@mcp.tool() @with_timeout async def get_all_game_data() -> dict: """ The Live League of Legends Client Data API has a number of endpoints that return a subset of the data returned by the /allgamedata endpoint. This endpoint is great for testing the Live Client Data API, but unless you actually need all the data from this endpoint, use one of the endpoints listed below that return a subset of the response. """ async with get_lol_client() as client: response = await client.get("/liveclientdata/allgamedata") return response.json()
- main.py:18-47 (helper)Helper decorator 'with_timeout' used on the tool handler to manage HTTP timeouts and errors when connecting to the LoL client.def with_timeout(func: Callable[..., Awaitable[T]]) -> Callable[..., Awaitable[T]]: """ Decorator to handle timeout exceptions for async functions. """ @functools.wraps(func) async def wrapper(*args: Any, **kwargs: Any) -> T: try: return await func(*args, **kwargs) except httpx.TimeoutException: return { "error": "Game has not started or connection failed.", "code": "TIMEOUT" } except httpx.ConnectError: return { "error": "Cannot connect to the game client. Please check if the game is running.", "code": "CONNECTION_ERROR" } except httpx.HTTPStatusError as e: return { "error": f"Server error: HTTP {e.response.status_code}", "code": "HTTP_ERROR", "status": e.response.status_code } except Exception as e: return { "error": f"An error occurred: {str(e)}", "code": "UNKNOWN_ERROR" } return wrapper
- main.py:50-59 (helper)Helper function 'get_lol_client' that creates and configures the httpx.AsyncClient for connecting to the local LoL client.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 )