Skip to main content
Glama
pab1it0

Chess.com MCP Server

get_player_current_games

Retrieve a chess player's current ongoing games on Chess.com by providing their username.

Instructions

Get a player's ongoing games on Chess.com

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usernameYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler/tool function for 'get_player_current_games'. It is decorated with @mcp.tool, takes a username parameter, logs the request, and calls make_api_request with the endpoint 'player/{username}/games' to fetch a player's current/ongoing games from Chess.com API.
    @mcp.tool(description="Get a player's ongoing games on Chess.com")
    async def get_player_current_games(username: str) -> Dict[str, Any]:
        """
        Get a list of a player's current games on Chess.com.
    
        Args:
            username: The Chess.com username
    
        Returns:
            Current games data
        """
        logger.info("Fetching player current games", username=username)
        return await make_api_request(f"player/{username}/games")
  • Registration of 'get_player_current_games' as an MCP tool via the @mcp.tool decorator with description 'Get a player's ongoing games on Chess.com'.
    @mcp.tool(description="Get a player's ongoing games on Chess.com")
  • Resource handler that wraps get_player_current_games as a resource at 'chess://player/{username}/games/current', formatting the result as JSON string.
    @mcp.resource("chess://player/{username}/games/current")
    async def player_current_games_resource(username: str) -> str:
        """
        Resource that returns a player's current games.
    
        Args:
            username: The Chess.com username
    
        Returns:
            JSON-formatted current games
        """
        try:
            import json
            logger.debug("Fetching player current games resource", username=username)
            games = await get_player_current_games(username=username)
            return json.dumps(games, indent=2)
        except Exception as e:
            logger.error("Error retrieving current games", username=username, error=str(e))
            return f"Error retrieving current games: {str(e)}"
  • Unit test for get_player_current_games, testing that the function correctly calls make_api_request and returns the expected game data.
    @pytest.mark.asyncio
    async def test_get_player_current_games():
        mock_data = {"games": [{"url": "game_url"}]}
        with patch("chess_mcp.server.make_api_request", new=AsyncMock(return_value=mock_data)):
            result = await get_player_current_games("testuser")
    
        assert result == mock_data
Behavior2/5

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

With no annotations, the description carries full burden. It does not explain what 'ongoing games' means (e.g., live vs daily), how long they persist, or what happens if the player has no ongoing games. The behavior is under-specified.

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

Conciseness3/5

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

The description is very concise at 11 words, but the brevity sacrifices necessary detail. It is appropriately front-loaded but lacks completeness.

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?

For a simple one-parameter tool with an output schema, the description does not mention the output or its structure. The agent must infer return format from the output schema alone. Missing context about when results are empty.

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

Parameters1/5

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

The only parameter 'username' has no description in schema (0% coverage) and the tool description adds no additional meaning, format, or constraints. The agent receives no value beyond the parameter name.

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 'a player's ongoing games', and the platform 'Chess.com'. It effectively distinguishes from sibling tools like 'get_player_games_by_month' which retrieve historical games.

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 like 'get_player_games_by_month' or 'download_player_games_pgn'. There are no prerequisites or context for usage.

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