Skip to main content
Glama
johnnyinlee

lol-client-mcp Public

get_active_player_name

Retrieve the current player's name from the League of Legends client using the Live Client Data API.

Instructions

Returns the player name.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • main.py:90-97 (handler)
    The main handler function for the 'get_active_player_name' tool. It asynchronously fetches the active player's name from the League of Legends client API endpoint '/liveclientdata/activeplayername' and returns it as a string.
    async def get_active_player_name() -> str:
        """
        Returns the player name.
        """
        async with get_lol_client() as client:
            response = await client.get("/liveclientdata/activeplayername")
            return response.text
  • main.py:88-89 (registration)
    The @mcp.tool() decorator registers the get_active_player_name function as an MCP tool. The @with_timeout decorator adds timeout and error handling.
    @mcp.tool()
    @with_timeout
  • main.py:18-47 (helper)
    The 'with_timeout' decorator used by the tool to handle various HTTP errors and timeouts when communicating with 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-58 (helper)
    Helper function to create an httpx.AsyncClient configured for the LoL client API, used inside the tool 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
        )
Behavior1/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Returns the player name' gives no information about permissions needed, rate limits, error conditions, whether this is a read-only operation, or what happens if no active player exists. The description provides minimal behavioral context beyond the basic operation.

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

Conciseness3/5

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

The description is extremely concise ('Returns the player name.') but this brevity comes at the cost of being under-specified rather than efficiently informative. While it's front-loaded with the core operation, it lacks the additional context needed for a tool in a complex gaming environment with many sibling alternatives.

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 complexity of the gaming context with 11 sibling tools and no annotations, the description is insufficiently complete. While an output schema exists (so return values don't need explanation), the description doesn't clarify what 'active player' means, how this differs from other player-related tools, or what behavioral constraints exist. For a tool in this rich ecosystem, more context is needed.

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 tool has 0 parameters with 100% schema description coverage, so the schema fully documents the parameter requirements. The description doesn't need to explain any parameters, and it correctly doesn't mention any. The baseline for 0 parameters with full schema coverage is 4, as there's no parameter information to add beyond what's already documented.

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

Purpose2/5

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

The description 'Returns the player name' is a tautology that essentially restates the tool name 'get_active_player_name'. It doesn't specify what 'active player' means in this gaming context or how this differs from similar tools like 'get_active_player' or 'get_player_list'. The purpose is stated but lacks meaningful differentiation from sibling tools.

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

Usage Guidelines1/5

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

The description provides no guidance on when to use this tool versus alternatives. With multiple player-related tools available (get_active_player, get_player_list, get_player_scores, etc.), there's no indication whether this tool retrieves just the name while others return more comprehensive data, or what specific scenario would call for using this particular tool.

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