Skip to main content
Glama
YuchengMaUTK

Unofficial WCA MCP Server

by YuchengMaUTK

get_rankings

Retrieve current world rankings and records for WCA speedcubing events. Filter results by region and ranking type to access top performers and official records.

Instructions

Get current world rankings and records for a specific event.

Returns the current rankings for any WCA event, which includes world records and top performers. Can filter by region (world, continent, or country).

Args: event_id: WCA event ID (e.g., "333" for 3x3x3 Cube, "222" for 2x2x2) region: Region code - "world" for world rankings, continent codes like "Europe", or country ISO2 codes like "US", "CN" (default: "world") ranking_type: Type of ranking - "single" for single solve records or "average" for average records (default: "single") page: Page number (1-based, default: 1) per_page: Items per page (max 100, default: 25)

Returns: Paginated ranking data with current records and top performers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
event_idYes
regionNoworld
ranking_typeNosingle
pageNo
per_pageNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main MCP tool handler for 'get_rankings' decorated with @mcp.tool(), which invokes the WCAAPIClient to fetch paginated rankings data from the WCA static API.
    @mcp.tool()
    async def get_rankings(
        event_id: str,
        region: str = "world",
        ranking_type: str = "single",
        page: int = 1,
        per_page: int = 25
    ) -> Dict[str, Any]:
        """Get current world rankings and records for a specific event.
        
        Returns the current rankings for any WCA event, which includes world records
        and top performers. Can filter by region (world, continent, or country).
        
        Args:
            event_id: WCA event ID (e.g., "333" for 3x3x3 Cube, "222" for 2x2x2)
            region: Region code - "world" for world rankings, continent codes like "Europe", 
                    or country ISO2 codes like "US", "CN" (default: "world")
            ranking_type: Type of ranking - "single" for single solve records or 
                         "average" for average records (default: "single")
            page: Page number (1-based, default: 1)
            per_page: Items per page (max 100, default: 25)
            
        Returns:
            Paginated ranking data with current records and top performers
        """
        try:
            async with WCAAPIClient() as client:
                rankings_data = await client.get_rankings(
                    event_id=event_id,
                    region=region,
                    type=ranking_type,
                    page=page,
                    per_page=per_page
                )
                return rankings_data
        except APIError as e:
            raise Exception(f"Failed to get rankings for {event_id}: {e}")
        except Exception as e:
            raise Exception(f"Unexpected error getting rankings for {event_id}: {e}")
  • Helper method in WCAAPIClient that performs the HTTP request to the WCA static API endpoint for rankings data.
    async def get_rankings(
        self,
        event_id: str,
        region: str = "world",
        type: str = "single",
        page: int = 1,
        per_page: int = 25
    ) -> Dict[str, Any]:
        """Get rankings for an event.
        
        Args:
            event_id: Event ID (e.g., "333")
            region: Region code ("world", continent code, or country ISO2)
            type: Ranking type ("single" or "average")
            page: Page number (1-based)
            per_page: Items per page (max 100)
            
        Returns:
            Paginated ranking data
        """
        # The static API uses a specific URL format: rank/{region}/{type}/{event}.json
        return await self._make_request(f"rank/{region}/{type}/{event_id}.json")
  • Pydantic models defining the structure of ranking data (Rank, Ranks) used for input/output validation of the get_rankings tool.
    """Ranking and record models."""
    
    from enum import Enum
    from typing import List
    from pydantic import BaseModel, Field
    
    from .base import PaginatedResponse, RankInfo
    
    
    class RankType(str, Enum):
        """Type of ranking (single or average)."""
        
        SINGLE = "single"
        AVERAGE = "average"
    
    
    class Rank(BaseModel):
        """Individual ranking entry."""
        
        rank_type: RankType = Field(..., alias="rankType", description="Type of ranking")
        person_id: str = Field(..., alias="personId", description="WCA ID of the person")
        event_id: str = Field(..., alias="eventId", description="Event identifier")
        best: int = Field(..., description="Best time/score in centiseconds or points")
        rank: RankInfo = Field(..., description="Ranking positions across regions")
    
    
    # Paginated response types
    class Ranks(PaginatedResponse[Rank]):
        """Paginated list of rankings."""
        pass
  • The @mcp.tool() decorator registers the get_rankings function as an MCP tool.
    @mcp.tool()
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses that the tool returns 'paginated ranking data' and mentions defaults for parameters, which adds some behavioral context. However, it doesn't cover important aspects like rate limits, authentication requirements, error conditions, or whether it's a read-only operation (though 'Get' implies reading).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear purpose statement followed by detailed parameter documentation and return information. It's appropriately sized for a tool with 5 parameters. The only minor inefficiency is that the first sentence could be more front-loaded with key details about filtering capabilities.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, no annotations, but has output schema), the description is mostly complete. It explains what the tool does, documents all parameters thoroughly, and mentions the return format. The presence of an output schema means it doesn't need to detail return values. It could improve by addressing behavioral aspects like rate limits or error handling.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides comprehensive parameter documentation in the 'Args' section, explaining each parameter's purpose, format, and defaults with examples. Given that schema description coverage is 0%, this description fully compensates by adding meaning beyond what the bare schema provides, making all 5 parameters well-understood.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get current world rankings and records for a specific event.' It specifies the verb ('Get'), resource ('world rankings and records'), and scope ('for a specific event'). However, it doesn't explicitly differentiate from sibling tools like 'get_competition_event_results' or 'search_competitions_by_event', which might also involve event-related data retrieval.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context through the mention of filtering by region and ranking type, but doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_competition_event_results' or 'search_competitions_by_event'. It lacks statements about when-not-to-use or direct comparisons with sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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