search_competitions_by_date
Find WCA speedcubing competitions that occurred on a specific date, returning a focused list ideal for AI processing.
Instructions
Search for WCA competitions on a specific date.
Returns a small, focused list of competitions that occurred on the exact date specified. This typically returns 1-5 competitions, making it perfect for LLM processing.
Args: year: Year (e.g., 2023, 2024) month: Month (1-12) day: Day (1-31)
Returns: Competition data for the specific date (typically 1-5 competitions)
Example: search_competitions_by_date(year=2024, month=3, day=15) - Competitions on March 15, 2024
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| day | Yes | ||
| month | Yes | ||
| year | Yes |
Input Schema (JSON Schema)
Implementation Reference
- src/wca_mcp_server/main.py:241-271 (handler)Primary MCP tool handler for search_competitions_by_date. The @mcp.tool() decorator handles registration and automatic schema generation from signature/docstring. Delegates to WCAAPIClient for API call.@mcp.tool() async def search_competitions_by_date( year: int, month: int, day: int ) -> Dict[str, Any]: """Search for WCA competitions on a specific date. Returns a small, focused list of competitions that occurred on the exact date specified. This typically returns 1-5 competitions, making it perfect for LLM processing. Args: year: Year (e.g., 2023, 2024) month: Month (1-12) day: Day (1-31) Returns: Competition data for the specific date (typically 1-5 competitions) Example: search_competitions_by_date(year=2024, month=3, day=15) - Competitions on March 15, 2024 """ try: async with WCAAPIClient() as client: competitions_data = await client.get_competitions_by_date(year, month, day) return competitions_data except APIError as e: raise Exception(f"Failed to search competitions by date: {e}") except Exception as e: raise Exception(f"Unexpected error searching competitions by date: {e}")
- src/wca_mcp_server/client.py:136-156 (helper)Core implementation logic in WCAAPIClient that constructs the WCA static API endpoint for competitions on a specific date and performs the HTTP request via _make_request.async def get_competitions_by_date( self, year: int, month: int, day: int ) -> Dict[str, Any]: """Get competitions on a specific date. Args: year: Year (e.g., 2023, 2024) month: Month (1-12) day: Day (1-31) Returns: Competition data for the specific date """ month_str = f"{month:02d}" # Ensure 2-digit format day_str = f"{day:02d}" # Ensure 2-digit format endpoint = f"competitions/{year}/{month_str}/{day_str}.json" return await self._make_request(endpoint)