Skip to main content
Glama

get_player_rankings

Retrieve a Dota 2 player's hero performance rankings by providing their Steam32 account ID to analyze competitive statistics.

Instructions

Get player hero rankings.

Args:
    account_id: Steam32 account ID of the player

Returns:
    Player's hero rankings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_player_rankings' MCP tool. Decorated with @mcp.tool(), it fetches player hero rankings from the OpenDota API endpoint `/players/{account_id}/rankings`, retrieves hero names, computes percentiles, and returns a formatted string summary of the top hero rankings for the player.
    @mcp.tool()
    async def get_player_rankings(account_id: int) -> str:
        """Get player hero rankings.
    
        Args:
            account_id: Steam32 account ID of the player
    
        Returns:
            Player's hero rankings
        """
        rankings_data = await make_opendota_request(f"players/{account_id}/rankings")
    
        if "error" in rankings_data:
            return f"Error retrieving rankings data: {rankings_data['error']}"
    
        if (
            not rankings_data
            or not isinstance(rankings_data, list)
            or len(rankings_data) == 0
        ):
            return "No ranking data found for this player."
    
        # Get hero names (just for context)
        heroes_data = await make_opendota_request("heroes")
        hero_id_to_name = {}
    
        if not isinstance(heroes_data, dict) and isinstance(heroes_data, list):
            for hero in heroes_data:
                if isinstance(hero, dict) and "id" in hero and "localized_name" in hero:
                    hero_id = hero.get("id")
                    hero_name = hero.get("localized_name")
                    if hero_id is not None and hero_name is not None:
                        hero_id_to_name[hero_id] = hero_name
    
        formatted_rankings = []
    
        for ranking in rankings_data:
            hero_id = ranking.get("hero_id", 0)
            hero_name = hero_id_to_name.get(hero_id, f"Hero {hero_id}")
            score = ranking.get("score", 0)
            percent_rank = ranking.get("percent_rank", 0) * 100  # Convert to percentage
    
            formatted_rankings.append(
                f"{hero_name} (ID: {hero_id})\n"
                f"Score: {score:.2f}\n"
                f"Percentile: {percent_rank:.2f}%"
            )
    
        return f"Hero Rankings for Player ID {account_id}:\n\n" + "\n\n".join(
            formatted_rankings
        )
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. It only states what the tool does without disclosing behavioral traits such as whether it's a read-only operation, potential rate limits, authentication needs, or error handling. This is inadequate for a tool with no annotation coverage.

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 appropriately sized and front-loaded with the main purpose, followed by brief sections for args and returns. It avoids unnecessary details, but the structure is basic and could be more polished (e.g., using bullet points or clearer formatting).

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

Completeness3/5

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

Given the tool has an output schema (which should cover return values), the description doesn't need to explain returns in detail. However, with no annotations and minimal parameter guidance, it's incomplete for effective use, as it lacks context on usage scenarios and behavioral aspects.

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

Parameters3/5

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

The description adds minimal semantics by specifying that 'account_id' is the 'Steam32 account ID of the player', which clarifies the parameter's purpose beyond the schema's title 'Account Id'. However, with 0% schema description coverage and only one parameter, this provides some value but doesn't fully compensate for the lack of schema details.

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 'Get player hero rankings' which specifies the verb 'Get' and resource 'player hero rankings', but it's somewhat vague about what 'hero rankings' entails (e.g., rankings based on performance, win rate, etc.). It doesn't clearly distinguish from siblings like 'get_player_heroes' or 'get_hero_stats', which might overlap in purpose.

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. For example, it doesn't specify if this is for a specific player's hero performance rankings compared to other tools that might list heroes or general stats, leaving the agent to guess based on sibling names alone.

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/asusevski/opendota-mcp-server'

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