Skip to main content
Glama
pab1it0

Chess.com MCP Server

download_player_games_pgn

Retrieve PGN files of a player's chess games for a specific month from Chess.com, enabling analysis and review of game history.

Instructions

Download PGN files for all games in a specific month from Chess.com

Input Schema

NameRequiredDescriptionDefault
monthYes
usernameYes
yearYes

Input Schema (JSON Schema)

{ "properties": { "month": { "title": "Month", "type": "integer" }, "username": { "title": "Username", "type": "string" }, "year": { "title": "Year", "type": "integer" } }, "required": [ "username", "year", "month" ], "title": "download_player_games_pgnArguments", "type": "object" }

Implementation Reference

  • The main handler function for the 'download_player_games_pgn' tool, decorated with @mcp.tool for registration. It formats the month, logs the request, calls make_api_request to fetch PGN data from Chess.com API, and returns the PGN string.
    @mcp.tool(description="Download PGN files for all games in a specific month from Chess.com") async def download_player_games_pgn( username: str, year: int, month: int ) -> str: """ Download PGN files for all games in a specific month from Chess.com. Args: username: The Chess.com username year: Year (YYYY format) month: Month (MM format, 01-12) Returns: Multi-game PGN format text containing all games for the month """ month_str = str(month).zfill(2) logger.info( "Downloading player games PGN", username=username, year=year, month=month_str ) result = await make_api_request( f"player/{username}/games/{year}/{month_str}/pgn", accept_json=False ) return result

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