get_game_stats
Retrieve essential game data from the League of Legends client API using this MCP server tool. Access basic game statistics for real-time in-game insights and analysis.
Instructions
Basic data about the game.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:189-195 (handler)The main handler function for the 'get_game_stats' tool. It creates an HTTP client to the LoL client, fetches the gamestats endpoint, and returns the JSON response.async def get_game_stats() -> dict: """ Basic data about the game. """ async with get_lol_client() as client: response = await client.get("/liveclientdata/gamestats") return response.json()
- main.py:187-187 (registration)The @mcp.tool() decorator registers the get_game_stats function as an MCP tool.@mcp.tool()
- main.py:50-58 (helper)Helper utility function used by get_game_stats (and other tools) to create an authenticated HTTP client for the League of Legends live client 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 )
- main.py:188-188 (registration)The @with_timeout decorator applied to the tool handler, likely adding timeout functionality.@with_timeout