get_all_game_data
Retrieve comprehensive in-game data from the League of Legends client for testing and analysis purposes. This tool accesses all available game information through 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-74 (handler)The handler function implementing 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 LoL live client API endpoint.@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:62-62 (registration)Decorator registering the get_all_game_data function as an MCP tool.@mcp.tool()
- main.py:18-47 (helper)Helper decorator applied to the handler for timeout and error handling.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-58 (helper)Helper function used by the handler to create the HTTP client for the LoL API.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 )