get_player_games_by_month
Retrieve a chess player's game records for a specific month from Chess.com to analyze performance, track progress, or review matches.
Instructions
Get a player's games for a specific month from Chess.com
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| username | Yes | ||
| year | Yes | ||
| month | Yes |
Implementation Reference
- src/chess_mcp/server.py:143-168 (handler)The handler function decorated with @mcp.tool, which registers and implements the tool. It formats the month, logs the request, and calls make_api_request to fetch games from Chess.com API for the given player, year, and month.@mcp.tool(description="Get a player's games for a specific month from Chess.com") async def get_player_games_by_month( username: str, year: int, month: int ) -> Dict[str, Any]: """ Get a player's games for a specific month from Chess.com. Args: username: The Chess.com username year: Year (YYYY format) month: Month (MM format, 01-12) Returns: Games data for the specified month """ month_str = str(month).zfill(2) logger.info( "Fetching player games by month", username=username, year=year, month=month_str ) return await make_api_request(f"player/{username}/games/{year}/{month_str}")
- src/chess_mcp/server.py:143-143 (registration)The @mcp.tool decorator registers the get_player_games_by_month function as an MCP tool.@mcp.tool(description="Get a player's games for a specific month from Chess.com")