get_wca_events
Retrieve official World Cube Association events with IDs, names, and formats for speedcubing data access and analysis.
Instructions
Get all official WCA events.
Returns a list of all official World Cube Association events including event IDs, names, and formats.
Returns: List of WCA events with their details
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/wca_mcp_server/main.py:28-46 (handler)The main MCP tool handler function decorated with @mcp.tool() that implements get_wca_events by calling WCAAPIClient.get_events() and handling API errors.@mcp.tool() async def get_wca_events() -> List[Dict[str, Any]]: """Get all official WCA events. Returns a list of all official World Cube Association events including event IDs, names, and formats. Returns: List of WCA events with their details """ try: async with WCAAPIClient() as client: events = await client.get_events() return events except APIError as e: raise Exception(f"Failed to fetch WCA events: {e}") except Exception as e: raise Exception(f"Unexpected error fetching WCA events: {e}")
- src/wca_mcp_server/client.py:300-314 (helper)The supporting WCAAPIClient.get_events() method that fetches the events data from the WCA API endpoint 'events.json', handles response formats, and returns the list of events.async def get_events(self) -> List[Dict[str, Any]]: """Get all WCA events. Returns: List of event data """ data = await self._make_request("events.json") # The API returns paginated data with items array if isinstance(data, dict) and "items" in data: return data["items"] # Fallback for other formats if isinstance(data, list): return data return data.get("events", [])
- src/wca_mcp_server/main.py:28-28 (registration)The @mcp.tool() decorator that registers the get_wca_events function with the FastMCP server instance.@mcp.tool()