Skip to main content
Glama
pab1it0

Chess.com MCP Server

get_player_game_archives

Retrieve all available monthly game archives for any Chess.com player by providing their username, enabling access to historical game records for analysis and review.

Instructions

Get a list of available monthly game archives for a player on Chess.com

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The tool handler function that makes an API request to Chess.com to get a list of available monthly game archives for a player.
    @mcp.tool(description="Get a list of available monthly game archives for a player on Chess.com")
    async def get_player_game_archives(username: str) -> Dict[str, Any]:
        """
        Get a list of available monthly game archives for a player on Chess.com.
    
        Args:
            username: The Chess.com username
    
        Returns:
            List of available game archives
        """
        logger.info("Fetching player game archives", username=username)
        return await make_api_request(f"player/{username}/games/archives")
  • The tool is registered as an MCP tool via the @mcp.tool decorator on the handler function.
    @mcp.tool(description="Get a list of available monthly game archives for a player on Chess.com")
    async def get_player_game_archives(username: str) -> Dict[str, Any]:
  • The function signature defines the input schema: username (str) is required. The return type is Dict[str, Any].
    @mcp.tool(description="Get a list of available monthly game archives for a player on Chess.com")
    async def get_player_game_archives(username: str) -> Dict[str, Any]:
        """
        Get a list of available monthly game archives for a player on Chess.com.
    
        Args:
            username: The Chess.com username
    
        Returns:
            List of available game archives
        """
        logger.info("Fetching player game archives", username=username)
        return await make_api_request(f"player/{username}/games/archives")
  • The make_api_request helper function is called by the handler to perform the actual HTTP request 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(
                    "API request failed",
                    endpoint=endpoint,
                    url=url,
                    error=str(e),
                    error_type=type(e).__name__
                )
                raise
  • Test for the get_player_game_archives handler, verifying it calls the correct API endpoint and returns the mock response.
    async def test_get_player_game_archives():
        mock_archives = {"archives": ["https://api.chess.com/pub/player/username/games/2022/01"]}
    
        with patch("chess_mcp.server.make_api_request", new=AsyncMock(return_value=mock_archives)):
            result = await get_player_game_archives("username")
    
        assert result == mock_archives
Behavior2/5

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

No annotations are provided, so the description must disclose all behavioral traits. It only states the action without mentioning authentication needs, rate limits, error handling, or any side effects, leaving significant gaps.

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 a single, clear sentence with no wasted words. However, it lacks structural elements like bullet points or sections for quick scanning.

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 that an output schema exists, the description could rely on it, but it still omits context like what the list contains (e.g., dates, URLs) and how to proceed after retrieval. The description is too minimal for comprehensive understanding.

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 schema has 0% description coverage for its single parameter 'username', and the tool description does not elaborate on its meaning or required format. The description adds no value beyond the schema itself for parameter understanding.

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 verb 'Get', the resource 'list of available monthly game archives', and the target 'a player on Chess.com'. It effectively differentiates from sibling tools like 'get_player_current_games' and 'get_player_games_by_month'.

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?

The description provides no guidance on when to use this tool versus alternatives, such as 'get_player_games_by_month' or 'download_player_games_pgn'. There is no mention of suggested workflows or prerequisites.

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