Skip to main content
Glama

get_match_summary

Retrieve a detailed summary of a specific match for a player, including KDA, damage, vision, and win/loss stats.

Instructions

📊 Get a detailed summary of a specific match for a given player.

Extracts and returns only the relevant stats (KDA, damage, vision, win/loss, etc.) from the match.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
match_idYes
puuidYes

Implementation Reference

  • The handler function for the 'get_match_summary' tool. Decorated with @mcp.tool() to register it as an MCP tool. Fetches match data via Riot API, finds the participant by puuid, and returns detailed match statistics (KDA, damage, vision, game info).
    @mcp.tool()
    async def get_match_summary(match_id: str, puuid: str) -> dict[str, Any] | str:
        """
        📊 Get a detailed summary of a specific match for a given player.
    
        Extracts and returns only the relevant stats (KDA, damage, vision, win/loss, etc.) from the match.
        """
        match = await riot_request(f"/lol/match/v5/matches/{match_id}", region="asia")
        if not match:
            return "Failed to load match data."
    
        participant = next((p for p in match["info"]["participants"] if p["puuid"] == puuid), None)
        if not participant:
            return f"No participant found with puuid: {puuid}"
    
        return {
            "championName": participant["championName"],
            "lane": participant["lane"],
            "role": participant["role"],
            "kills": participant["kills"],
            "deaths": participant["deaths"],
            "assists": participant["assists"],
            "kda": participant["challenges"].get("kda"),
            "killParticipation": participant["challenges"].get("killParticipation"),
            "totalDamageDealtToChampions": participant["totalDamageDealtToChampions"],
            "visionScore": participant["visionScore"],
            "wardsPlaced": participant["wardsPlaced"],
            "wardsKilled": participant["wardsKilled"],
            "win": participant["win"],
            "teamPosition": participant.get("teamPosition"),
            "timePlayed": participant["timePlayed"],
            "gameDuration": match["info"]["gameDuration"],
            "queueId": match["info"]["queueId"],
        }
  • src/server.py:211-211 (registration)
    Registration via the @mcp.tool() decorator on the get_match_summary function, using FastMCP.
    @mcp.tool()
  • Helper function used by get_match_summary to make authenticated requests to the Riot Games API.
    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
  • Implicit schema defined by the returned dictionary in the handler. The input schema is defined via function parameters (match_id: str, puuid: str).
    return {
        "championName": participant["championName"],
        "lane": participant["lane"],
        "role": participant["role"],
        "kills": participant["kills"],
        "deaths": participant["deaths"],
        "assists": participant["assists"],
        "kda": participant["challenges"].get("kda"),
        "killParticipation": participant["challenges"].get("killParticipation"),
        "totalDamageDealtToChampions": participant["totalDamageDealtToChampions"],
        "visionScore": participant["visionScore"],
        "wardsPlaced": participant["wardsPlaced"],
        "wardsKilled": participant["wardsKilled"],
        "win": participant["win"],
        "teamPosition": participant.get("teamPosition"),
        "timePlayed": participant["timePlayed"],
        "gameDuration": match["info"]["gameDuration"],
        "queueId": match["info"]["queueId"],
    }
Behavior3/5

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

With no annotations, the description carries full burden. It states the tool extracts and returns only relevant stats, implying a read-only operation. However, it does not disclose any behavioral traits like authorization needs, rate limits, or potential errors. The description adds some context but is incomplete.

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

Conciseness5/5

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

The description is two sentences, front-loaded with the purpose, and includes an emoji for visual cue. No unnecessary words or repetition.

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

Completeness4/5

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

For a simple data retrieval tool with two common parameters and no output schema, the description is fairly complete. It explains what the tool does and what type of data it returns. However, it lacks guidance on parameter derivation or edge cases, which would improve completeness.

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%, so the description must compensate. However, it does not describe the parameters (match_id and puuid) beyond what is obvious from the tool name and purpose. No format, source, or constraints are mentioned, leaving the agent to infer meaning.

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 the tool fetches a detailed summary of a specific match for a given player, listing included stats (KDA, damage, vision, win/loss). This distinguishes it from siblings like get_recent_matches_tool (list of matches) and get_champion_mastery_tool (champion mastery).

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 detailed match stats are needed, but it does not explicitly tell when to use this tool vs alternatives (e.g., when to use get_recent_matches_tool instead). No usage context or exclusions are provided.

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