Skip to main content
Glama
johnnyinlee

lol-client-mcp Public

get_active_player

Retrieve current player data from the League of Legends client, including stats and game information for real-time analysis.

Instructions

Get all data about the active player.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • main.py:77-85 (handler)
    The handler function for the 'get_active_player' tool. It is decorated with @mcp.tool() for registration and @with_timeout for error handling. Fetches active player data from the League of Legends live client API endpoint '/liveclientdata/activeplayer' and returns it as a dictionary.
    @mcp.tool()
    @with_timeout
    async def get_active_player() -> dict:
        """
        Get all data about the active player.
        """
        async with get_lol_client() as client:
            response = await client.get("/liveclientdata/activeplayer")
            return response.json()
  • main.py:50-59 (helper)
    Helper function to create an httpx AsyncClient configured for the LoL client API, used by the get_active_player handler.
    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:18-47 (helper)
    Decorator applied to the handler to manage various HTTP errors and timeouts, returning standardized error responses.
    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
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states what the tool does ('Get all data'), without mentioning permissions, rate limits, response format, or whether it's a read-only operation. For a tool with zero annotation coverage, this leaves critical behavioral traits unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It's front-loaded and appropriately sized for a simple tool, though it could be slightly more informative without losing conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'all data' includes, how it differs from sibling tools, or what the return values look like. For a tool in a context with many specific alternatives, this leaves significant gaps in understanding its role and output.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add parameter details, but that's appropriate here. Baseline is 4 for zero parameters, as the schema fully handles the lack of inputs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the tool's purpose ('Get all data about the active player'), which is clear but vague. It specifies the resource ('active player') and verb ('Get'), but doesn't distinguish it from siblings like 'get_player_list' or 'get_player_scores', leaving ambiguity about what 'all data' entails compared to more specific tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'get_player_items' and 'get_player_scores' that fetch specific data, the description doesn't clarify if this tool aggregates such details or serves a different purpose, offering no help in tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/johnnyinlee/lol-client-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server