Skip to main content
Glama
YuchengMaUTK

Unofficial WCA MCP Server

by YuchengMaUTK

get_competition_by_id

Retrieve detailed WCA competition information including venue details, events, results, and organizer data using a specific 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

NameRequiredDescriptionDefault
competition_idYes

Input Schema (JSON Schema)

{ "properties": { "competition_id": { "title": "Competition Id", "type": "string" } }, "required": [ "competition_id" ], "type": "object" }

Implementation Reference

  • The MCP tool handler for 'get_competition_by_id', including @mcp.tool() registration decorator. Fetches competition details via WCAAPIClient.get_competition.
    @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}")
  • WCAAPIClient helper method 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")
  • Pydantic model defining the structure and validation for competition data returned by the tool.
    class Competition(BaseModel): """WCA competition information.""" id: str = Field(..., description="Competition identifier") name: str = Field(..., description="Competition name") city: str = Field(..., description="Competition city") country: str = Field(..., description="Competition country code") date: CompetitionDate = Field(..., description="Competition date information") is_canceled: bool = Field(..., alias="isCanceled", description="Whether competition is canceled") events: List[str] = Field(..., description="List of event IDs in the competition") wca_delegates: List[ContactInfo] = Field(..., alias="wcaDelegates", description="WCA delegates") organisers: List[ContactInfo] = Field(..., description="Competition organizers") venue: Venue = Field(..., description="Venue information") information: Optional[str] = Field(None, description="Additional competition information") external_website: Optional[str] = Field(None, alias="externalWebsite", description="External website URL")

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