Skip to main content
Glama

search_player

Find Dota 2 players by name to retrieve their statistics, match history, and game metrics through the OpenDota MCP Server.

Instructions

Search for players by name.

Args:
    query: Name to search for

Returns:
    List of matching players

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function implementing the 'search_player' MCP tool. It queries the OpenDota API's search endpoint with the provided name, handles errors and empty results, limits to top 10 matches, and formats a list of players with their persona names, account IDs, and similarity scores. The @mcp.tool() decorator also serves as the registration.
    @mcp.tool()
    async def search_player(query: str) -> str:
        """Search for players by name.
    
        Args:
            query: Name to search for
    
        Returns:
            List of matching players
        """
        search_results = await make_opendota_request("search", {"q": query})
    
        if "error" in search_results:
            return f"Error searching for players: {search_results['error']}"
    
        if not search_results or len(search_results) == 0:
            return f"No players found matching '{query}'."
    
        formatted_results = []
    
        # Limit to 10 players
        players_to_show = []
        if isinstance(search_results, list):
            players_to_show = search_results[:10]
        for i, player in enumerate(players_to_show):
            account_id = player.get("account_id", "Unknown")
            name = player.get("personaname", "Anonymous")
            similarity = player.get("similarity", 0)
    
            formatted_results.append(
                f"{i+1}. {name}\n"
                f"   Account ID: {account_id}\n"
                f"   Similarity: {similarity:.2f}"
            )
    
        return f"Players matching '{query}':\n\n" + "\n\n".join(formatted_results)
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the basic action ('Search for players by name') and return type ('List of matching players'), but lacks critical details like search algorithm (exact match, partial, fuzzy), result limits, pagination, error handling, or performance characteristics. This is inadequate for a search tool with zero annotation coverage.

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

Conciseness5/5

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

The description is extremely concise and well-structured: a clear purpose statement followed by separate Args and Returns sections. Every sentence earns its place with no redundant information. The formatting with headings enhances readability without unnecessary verbosity.

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

Completeness3/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 (search functionality with 1 parameter), no annotations, but with an output schema (which handles return values), the description is minimally complete. It covers the basic purpose and parameter but lacks behavioral context and usage guidelines. The output schema relieves the description from explaining return structure, but more operational details would be helpful.

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

Parameters3/5

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

The schema description coverage is 0%, so the description must compensate. It documents the single parameter 'query' as 'Name to search for', which adds basic meaning beyond the schema's generic 'Query' title. However, it doesn't provide format details (e.g., case sensitivity, special characters) or examples, leaving significant gaps in parameter understanding.

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 as 'Search for players by name', which is a specific verb+resource combination. It distinguishes itself from siblings like get_player_by_id (which retrieves by ID) and get_player_rankings (which provides rankings). However, it doesn't explicitly differentiate from get_pro_players, which might also search for players but with a professional filter.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose search_player over get_player_by_id for known IDs, or how it differs from get_pro_players for professional players. There's no context about search scope, limitations, or prerequisites.

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/asusevski/opendota-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server