Skip to main content
Glama
YuchengMaUTK

Unofficial WCA MCP Server

by YuchengMaUTK

get_person_by_wca_id

Retrieve detailed speedcuber profiles from WCA data using their unique ID. Access competitor information, personal records, rankings, and medal counts with configurable detail levels.

Instructions

Get detailed information about a specific WCA competitor by their WCA ID.

Returns information about a speedcuber with configurable detail levels. By default, returns basic info, personal records, rankings, and medals without the verbose competition results that can make responses extremely long.

Args: wca_id: WCA ID of the person (e.g., "2003SEAR02") competition_id: Optional competition ID to get results from a specific competition (e.g., "WC2023") include_competition_results: Include detailed competition results (default: False) include_personal_records: Include personal best records (default: True) include_rankings: Include current world/continental/national rankings (default: True) include_medals: Include medal counts (default: True) max_recent_competitions: If including results, limit to N most recent competitions (default: 5)

Returns: Filtered person information based on the specified parameters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wca_idYes
competition_idNo
include_competition_resultsNo
include_personal_recordsNo
include_rankingsNo
include_medalsNo
max_recent_competitionsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The primary handler function for the 'get_person_by_wca_id' tool. Decorated with @mcp.tool() for automatic registration. Fetches person data from WCAAPIClient, applies configurable filtering for results, records, rankings, and medals, and returns a customized response.
    @mcp.tool()
    async def get_person_by_wca_id(
        wca_id: str,
        competition_id: str = None,
        include_competition_results: bool = False,
        include_personal_records: bool = True,
        include_rankings: bool = True,
        include_medals: bool = True,
        max_recent_competitions: int = 5
    ) -> Dict[str, Any]:
        """Get detailed information about a specific WCA competitor by their WCA ID.
        
        Returns information about a speedcuber with configurable detail levels.
        By default, returns basic info, personal records, rankings, and medals without
        the verbose competition results that can make responses extremely long.
        
        Args:
            wca_id: WCA ID of the person (e.g., "2003SEAR02")
            competition_id: Optional competition ID to get results from a specific competition (e.g., "WC2023")
            include_competition_results: Include detailed competition results (default: False)
            include_personal_records: Include personal best records (default: True)
            include_rankings: Include current world/continental/national rankings (default: True)
            include_medals: Include medal counts (default: True)
            max_recent_competitions: If including results, limit to N most recent competitions (default: 5)
            
        Returns:
            Filtered person information based on the specified parameters
        """
        try:
            async with WCAAPIClient() as client:
                person_data = await client.get_person(wca_id)
                
                # Create filtered response
                filtered_data = {
                    "id": person_data.get("id"),
                    "name": person_data.get("name"),
                    "slug": person_data.get("slug"),
                    "country": person_data.get("country"),
                    "numberOfCompetitions": person_data.get("numberOfCompetitions"),
                    "numberOfChampionships": person_data.get("numberOfChampionships"),
                }
                
                # Add competition IDs list (always include as it's lightweight)
                if "competitionIds" in person_data:
                    filtered_data["competitionIds"] = person_data["competitionIds"]
                if "championshipIds" in person_data:
                    filtered_data["championshipIds"] = person_data["championshipIds"]
                
                # Add personal records if requested
                if include_personal_records and "records" in person_data:
                    filtered_data["records"] = person_data["records"]
                
                # Add rankings if requested
                if include_rankings and "rank" in person_data:
                    filtered_data["rank"] = person_data["rank"]
                
                # Add medals if requested
                if include_medals and "medals" in person_data:
                    filtered_data["medals"] = person_data["medals"]
                
                # Handle specific competition results if competition_id is provided
                if competition_id:
                    competition_ids = person_data.get("competitionIds", [])
                    results = person_data.get("results", {})
                    
                    if competition_id in competition_ids:
                        # Person participated in this competition
                        if competition_id in results:
                            # Results data is available
                            filtered_data["results"] = {competition_id: results[competition_id]}
                            filtered_data["_results_note"] = f"Showing results from competition: {competition_id}"
                        else:
                            # Person participated but no results data available
                            filtered_data["results"] = {}
                            filtered_data["_results_note"] = f"Person participated in {competition_id} but no results data available"
                    else:
                        # Person did not participate in this competition
                        filtered_data["results"] = {}
                        filtered_data["_results_note"] = f"Person did not participate in competition: {competition_id}"
                
                # Add competition results if requested (with optional limiting)
                elif include_competition_results and "results" in person_data:
                    results = person_data["results"]
                    if max_recent_competitions and max_recent_competitions > 0:
                        # Get the most recent competitions (competition IDs are typically in chronological order)
                        competition_ids = person_data.get("competitionIds", [])
                        recent_competition_ids = competition_ids[-max_recent_competitions:] if competition_ids else []
                        
                        # Filter results to only include recent competitions
                        filtered_results = {
                            comp_id: results[comp_id] 
                            for comp_id in recent_competition_ids 
                            if comp_id in results
                        }
                        filtered_data["results"] = filtered_results
                        filtered_data["_results_note"] = f"Showing results from {len(filtered_results)} most recent competitions out of {len(results)} total"
                    else:
                        filtered_data["results"] = results
                elif not include_competition_results and not competition_id:
                    # Explicitly exclude results when not requested
                    filtered_data["_results_note"] = f"Competition results excluded (set include_competition_results=True to include). Total competitions: {person_data.get('numberOfCompetitions', 0)}"
                
                return filtered_data
                
        except APIError as e:
            raise Exception(f"Failed to get person {wca_id}: {e}")
        except Exception as e:
            raise Exception(f"Unexpected error getting person {wca_id}: {e}")
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 key behavioral traits: the tool returns filtered information based on parameters, warns about potentially 'extremely long' responses with competition results, and explains default behavior. However, it lacks details on error handling, rate limits, authentication needs, or data freshness.

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, usage context, parameter explanations, and return statement. It's appropriately sized for a 7-parameter tool. Minor improvement could be front-loading the parameter section more explicitly, but overall it's efficient with minimal waste.

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 moderate complexity (7 parameters, no annotations, but has output schema), the description is mostly complete. It explains parameters thoroughly and mentions return behavior. The output schema existence means it doesn't need to detail return values. However, it could better address sibling tool differentiation and error cases.

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 adds substantial meaning beyond the input schema, which has 0% description coverage. It explains all 7 parameters with clear semantics: what each controls (e.g., 'include detailed competition results'), provides examples (e.g., '2003SEAR02'), and clarifies defaults. This fully compensates for the schema's lack of descriptions.

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

Purpose5/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 detailed information about a specific WCA competitor by their WCA ID.' It specifies the verb ('Get'), resource ('WCA competitor'), and distinguishes from siblings by focusing on individual person data rather than competitions, rankings, or other entities listed in sibling tools.

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 parameter explanations (e.g., 'By default, returns basic info... without verbose competition results'), but does not explicitly state when to use this tool versus alternatives like 'get_competition_results' or 'get_rankings'. It provides some guidance on avoiding overly long responses but lacks direct sibling comparisons.

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