Skip to main content
Glama

get_pro_players

Retrieve professional Dota 2 player data to analyze competitive scene trends and identify top performers.

Instructions

Get list of professional players.

Args:
    limit: Number of players to retrieve (default: 10)

Returns:
    List of professional players

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Implementation Reference

  • The @mcp.tool() decorated handler function that implements the get_pro_players tool. It fetches professional players from the OpenDota API endpoint 'proPlayers', sorts them by team/name/account_id, limits the output, and formats a readable list of pro players with their team, country, and account ID.
    @mcp.tool()
    async def get_pro_players(limit: int = 10) -> str:
        """Get list of professional players.
    
        Args:
            limit: Number of players to retrieve (default: 10)
    
        Returns:
            List of professional players
        """
        if limit > 30:
            limit = 30  # Cap for reasonable response size
    
        pro_players = await make_opendota_request("proPlayers")
    
        if "error" in pro_players:
            return f"Error retrieving pro players: {pro_players['error']}"
    
        if not pro_players or not isinstance(pro_players, list) or len(pro_players) == 0:
            return "No professional players found."
    
        # Sort by name for consistency
        sorted_players = sorted(
            pro_players,
            key=lambda x: (
                x.get("team_name", ""),
                x.get("name", ""),
                x.get("account_id", 0),
            ),
        )
    
        formatted_players = []
    
        for i, player in enumerate(sorted_players[:limit]):
            account_id = player.get("account_id", "Unknown")
            name = player.get("name", "Anonymous")
            team_name = player.get("team_name", "No Team")
            country_code = player.get("country_code", "Unknown")
    
            formatted_players.append(
                f"{i+1}. {name}\n"
                f"   Team: {team_name}\n"
                f"   Country: {country_code}\n"
                f"   Account ID: {account_id}"
            )
    
        return "Professional Players:\n\n" + "\n\n".join(formatted_players)

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