Skip to main content
Glama

get_player_summary

Retrieve a full player profile summary including level, solo rank, top champion masteries, and recent matches.

Instructions

๐Ÿงพ Get a complete summary of a player's profile.

Includes level, solo rank, top champion masteries, and recent matches in a single output.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
game_nameYes
tag_lineYes
languageNoen_US

Implementation Reference

  • The handler function for the get_player_summary MCP tool. Fetches player profile, rank, top champion masteries, and recent matches, combining them into a single formatted summary string.
    @mcp.tool()
    async def get_player_summary(game_name: str, tag_line: str, language: str = "en_US") -> str:
        """
        ๐Ÿงพ Get a complete summary of a player's profile.
    
        Includes level, solo rank, top champion masteries, and recent matches in a single output.
        """
        puuid = await get_puuid(game_name, tag_line)
        if not puuid:
            return "Failed to find player."
    
        champ_map = await get_champion_map(language)
        summoner = await get_summoner_by_puuid(puuid)
        if not summoner:
            return "Failed to get summoner profile."
    
        level = summoner["summonerLevel"]
        rank = await get_rank_by_summoner_id(summoner["id"])
        top_champs = await get_top_champions(puuid, champ_map, count=3)
        matches = await get_recent_matches(puuid)
    
        return f"""
    ๐Ÿ‘ค {game_name} (Level {level})
    
    ๐Ÿ… Rank: {rank}
    
    ๐Ÿ”ฅ Top Champions:
    {top_champs}
    
    ๐Ÿ•น๏ธ Recent Matches:
    {matches}
    """
  • src/server.py:178-178 (registration)
    Registration of get_player_summary as an MCP tool via the @mcp.tool() decorator.
    @mcp.tool()
  • Base helper function used by get_player_summary for making Riot API requests.
    async def riot_request(
        url: str, region: str = "kr", params: dict[str, Any] | None = None
    ) -> dict[str, Any] | None:
        headers = {
            "X-Riot-Token": RIOT_API_KEY,
            "Content-Type": "application/json",
        }
        async with httpx.AsyncClient() as client:
            try:
                full_url = f"https://{region}.api.riotgames.com{url}"
                res = await client.get(full_url, headers=headers, params=params, timeout=30.0)
                res.raise_for_status()
                return res.json()
            except Exception as e:
                print(f"Riot API Error: {e}")
                return None
  • Helper function called by get_player_summary to resolve a Riot ID to a PUUID.
    async def get_puuid(game_name: str, tag_line: str) -> str | None:
        url = f"https://asia.api.riotgames.com/riot/account/v1/accounts/by-riot-id/{game_name}/{tag_line}"
        headers = {
            "X-Riot-Token": RIOT_API_KEY,
            "Content-Type": "application/json",
        }
        try:
            async with httpx.AsyncClient() as client:
                res = await client.get(url, headers=headers)
                res.raise_for_status()
                return res.json()["puuid"]
        except Exception:
            return None
  • Helper function called by get_player_summary to fetch and format recent matches.
    async def get_recent_matches(puuid: str, count: int = 3) -> str:
        match_ids = await riot_request(
            f"/lol/match/v5/matches/by-puuid/{puuid}/ids", region="asia", params={"count": count}
        )
        if not match_ids:
            return "No recent matches found."
    
        matches = []
        for match_id in match_ids:
            match = await riot_request(f"/lol/match/v5/matches/{match_id}", region="asia")
            if match:
                participant = next((p for p in match["info"]["participants"] if p["puuid"] == puuid), None)
                if participant:
                    champ = participant["championName"]
                    k, d, a = participant["kills"], participant["deaths"], participant["assists"]
                    result = "Win" if participant["win"] else "Loss"
                    matches.append(f"{match_id} {champ}: {k}/{d}/{a} - {result}")
        return "\n".join(matches)
Behavior2/5

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

No annotations are provided, and the description does not disclose behavioral traits such as idempotency, side effects, or rate limits. For a read-only operation, this is a significant gap.

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 brief with two sentences, using an emoji for visual cue. It is front-loaded with purpose and lists included data. No redundant information.

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 output schema and annotations, the description should cover behavioral aspects and output details. It omits limitations like match count, language impact, and data freshness.

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

Parameters2/5

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

Schema coverage is 0%, and the description does not clarify the parameters beyond implying player identity. For example, the 'language' parameter defaults to en_US but is not explained.

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

Purpose5/5

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

The description clearly states it provides a complete summary including level, solo rank, top champion masteries, and recent matches. This differentiates it from sibling tools like get_champion_mastery_tool and get_recent_matches_tool which focus on sub-aspects.

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

Usage Guidelines3/5

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

The description implies usage when a quick overview is needed but lacks explicit when-to-use or when-not-to-use guidance. No alternatives are mentioned despite clear sibling tools.

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/jifrozen0110/mcp-riot'

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