Skip to main content
Glama
YuchengMaUTK

Unofficial WCA MCP Server

by YuchengMaUTK

get_wca_countries

Retrieve a complete list of countries recognized by the World Cube Association, including names and ISO2 codes for regional filtering in speedcubing data queries.

Instructions

Get all WCA countries.

Returns a list of all countries recognized by the World Cube Association including country names and ISO2 codes used for regional filtering.

Returns: List of WCA countries with names and ISO2 codes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'get_wca_countries' tool. Decorated with @mcp.tool() for automatic registration in the FastMCP server. Implements the core logic by fetching countries from WCAAPIClient within an async context manager and propagating errors with descriptive messages.
    @mcp.tool() async def get_wca_countries() -> List[Dict[str, Any]]: """Get all WCA countries. Returns a list of all countries recognized by the World Cube Association including country names and ISO2 codes used for regional filtering. Returns: List of WCA countries with names and ISO2 codes """ try: async with WCAAPIClient() as client: countries = await client.get_countries() return countries except APIError as e: raise Exception(f"Failed to fetch WCA countries: {e}") except Exception as e: raise Exception(f"Unexpected error fetching WCA countries: {e}")
  • Helper method in WCAAPIClient class that makes the HTTP request to the WCA API endpoint 'countries.json', handles response parsing to extract the countries list (preferring 'items' key), and returns it for use by the tool handler.
    async def get_countries(self) -> List[Dict[str, Any]]: """Get all countries. Returns: List of country data """ data = await self._make_request("countries.json") # The API returns paginated data with items array if isinstance(data, dict) and "items" in data: return data["items"] return data.get("countries", [])

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/YuchengMaUTK/unofficial-wca-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server