get_competition_by_id
Retrieve detailed WCA competition information including venue, events, results, and organizers by providing the competition ID.
Instructions
Get detailed information about a specific competition by its ID.
Returns comprehensive information about a WCA competition including venue details, events, results, and organizer information.
Args: competition_id: WCA competition ID (e.g., "WC2023")
Returns: Detailed competition information
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| competition_id | Yes |
Implementation Reference
- src/wca_mcp_server/main.py:303-323 (handler)The primary handler function for the 'get_competition_by_id' MCP tool. Decorated with @mcp.tool() which handles both implementation and FastMCP registration. Fetches competition details via WCAAPIClient.@mcp.tool() async def get_competition_by_id(competition_id: str) -> Dict[str, Any]: """Get detailed information about a specific competition by its ID. Returns comprehensive information about a WCA competition including venue details, events, results, and organizer information. Args: competition_id: WCA competition ID (e.g., "WC2023") Returns: Detailed competition information """ try: async with WCAAPIClient() as client: competition_data = await client.get_competition(competition_id) return competition_data except APIError as e: raise Exception(f"Failed to get competition {competition_id}: {e}") except Exception as e: raise Exception(f"Unexpected error getting competition {competition_id}: {e}")
- src/wca_mcp_server/client.py:125-135 (helper)Helper method in WCAAPIClient that performs the actual API request to retrieve competition data by ID from the WCA static API.async def get_competition(self, competition_id: str) -> Dict[str, Any]: """Get a specific competition by ID. Args: competition_id: Competition ID Returns: Competition data """ return await self._make_request(f"competitions/{competition_id}.json")