Skip to main content
Glama
pab1it0

Chess.com MCP Server

get_player_stats

Retrieve a Chess.com player's statistics by username. Use this tool to access performance data including ratings, win/loss records, and game history for analysis.

Instructions

Get a player's stats from Chess.com

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The actual tool handler for 'get_player_stats'. Uses @mcp.tool decorator to register as an MCP tool, takes a username parameter, and calls the Chess.com API via make_api_request at endpoint 'player/{username}/stats'.
    @mcp.tool(description="Get a player's stats from Chess.com")
    async def get_player_stats(username: str) -> Dict[str, Any]:
        """
        Get a player's chess statistics from Chess.com.
    
        Args:
            username: The Chess.com username
    
        Returns:
            Player statistics data
        """
        logger.info("Fetching player stats", username=username)
        return await make_api_request(f"player/{username}/stats")
  • Registered via the @mcp.tool descriptor on line 98, which exposes it as a tool named 'get_player_stats' in the MCP server.
    @mcp.tool(description="Get a player's stats from Chess.com")
  • The make_api_request helper function that get_player_stats calls internally to make HTTP requests to the Chess.com API.
    async def make_api_request(
        endpoint: str,
        params: Optional[Dict[str, Any]] = None,
        accept_json: bool = True
    ) -> Union[Dict[str, Any], str]:
        """
        Make a request to the Chess.com API.
    
        Args:
            endpoint: The API endpoint to request
            params: Optional query parameters
            accept_json: Whether to accept JSON response (True) or PGN (False)
    
        Returns:
            JSON response as dict or text response as string
    
        Raises:
            httpx.HTTPError: If the request fails
        """
        url = f"{config.base_url}/{endpoint}"
        headers = {
            "accept": "application/json" if accept_json else "application/x-chess-pgn"
        }
    
        logger.debug(
            "Making API request",
            endpoint=endpoint,
            url=url,
            accept_json=accept_json,
            has_params=params is not None
        )
    
        async with httpx.AsyncClient() as client:
            try:
                response = await client.get(url, headers=headers, params=params or {})
                response.raise_for_status()
    
                if accept_json:
                    result = response.json()
                    logger.debug("API request successful", endpoint=endpoint, response_type="json")
                    return result
                else:
                    result = response.text
                    logger.debug("API request successful", endpoint=endpoint, response_type="text")
                    return result
    
            except httpx.HTTPError as e:
                logger.error(
  • Input schema: 'username' (str). The return type is Dict[str, Any]. This is implicitly defined by the function signature and the @mcp.tool decorator handles validation.
    @mcp.tool(description="Get a player's stats from Chess.com")
    async def get_player_stats(username: str) -> Dict[str, Any]:
        """
        Get a player's chess statistics from Chess.com.
    
        Args:
            username: The Chess.com username
    
        Returns:
            Player statistics data
        """
        logger.info("Fetching player stats", username=username)
        return await make_api_request(f"player/{username}/stats")
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 any behavioral traits such as read-only nature, rate limits, or authentication requirements. The description is very brief and lacks transparency.

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 very concise (one sentence) with no redundant words. However, its brevity sacrifices necessary details.

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 tool has a single parameter and an output schema (not described), the description is incomplete. It fails to explain what kind of stats are returned, any limitations, or how to interpret results.

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?

The input schema has 0% coverage for parameter descriptions. The description does not mention the username parameter or provide any context about its format or meaning, leaving the agent without guidance.

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

Purpose4/5

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

The description clearly states the action ('Get') and resource ('player's stats'), providing a clear purpose. However, it does not distinguish this tool from siblings like get_player_profile or get_player_current_games, which could be ambiguous.

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 on when to use this tool versus alternatives. There is no mention of common use cases, prerequisites, or disclaimers about alternatives.

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/pab1it0/chess-mcp'

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