Skip to main content
Glama
pab1it0

Chess.com MCP Server

get_club_members

Retrieve and list all members of a Chess.com club by providing its unique URL identifier. Access club membership data directly.

Instructions

Get members of a club on Chess.com

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
url_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler for the 'get_club_members' tool. It is decorated with @mcp.tool and calls make_api_request to fetch club members from the Chess.com API endpoint 'club/{url_id}/members'.
    @mcp.tool(description="Get members of a club on Chess.com")
    async def get_club_members(url_id: str) -> Dict[str, Any]:
        """
        Get members of a club on Chess.com.
    
        Args:
            url_id: The URL identifier of the club
    
        Returns:
            Club members data
        """
        logger.info("Fetching club members", url_id=url_id)
        return await make_api_request(f"club/{url_id}/members")
  • The tool is registered via the @mcp.tool decorator on line 224, which registers 'get_club_members' as an MCP tool with the description 'Get members of a club on Chess.com'.
    @mcp.tool(description="Get members of a club on Chess.com")
  • The make_api_request helper function that handles the actual HTTP request to the Chess.com API. It is used by get_club_members with endpoint 'club/{url_id}/members'.
    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
  • The function signature defines the input schema: a single 'url_id' string parameter. The return type is Dict[str, Any] (JSON data from the API).
    async def get_club_members(url_id: str) -> Dict[str, Any]:
        """
        Get members of a club on Chess.com.
    
        Args:
            url_id: The URL identifier of the club
    
        Returns:
            Club members data
        """
        logger.info("Fetching club members", url_id=url_id)
        return await make_api_request(f"club/{url_id}/members")
  • Test for get_club_members that patches make_api_request to return mock data and verifies the function returns the expected result.
    async def test_get_club_members():
        mock_members = {"members": ["member1", "member2"]}
    
        with patch("chess_mcp.server.make_api_request", new=AsyncMock(return_value=mock_members)):
            result = await get_club_members("test-club")
    
        assert result == mock_members
Behavior2/5

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

With no annotations, the description carries full burden but only states 'Get members of a club', omitting key behavioral details like pagination, rate limits, or whether it returns all members.

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 a single concise sentence, but it sacrifices informativeness for brevity, providing insufficient detail.

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?

Despite low complexity (1 parameter) and existence of an output schema, the description fails to mention return value or usage context, leaving significant gaps.

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 sole parameter 'url_id' is not explained in the description; schema coverage is 0%, so the description adds no meaning beyond the raw schema.

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 'Get members of a club on Chess.com' clearly identifies the verb (Get) and resource (members of a club), and distinguishes it from sibling tools like get_club_profile.

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 given on when to use this tool versus alternatives such as get_club_profile, or any context for when it is appropriate.

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