Skip to main content
Glama

get_public_matches

Retrieve recent Dota 2 public match data to analyze gameplay patterns, track player performance, and monitor competitive trends.

Instructions

Get recent public matches.

Args:
    limit: Number of matches to retrieve (default: 5)

Returns:
    List of recent public matches

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function that implements the get_public_matches tool. It fetches recent public matches from the OpenDota API using make_opendota_request("publicMatches"), processes and formats the match data including duration, timestamps, ranks, winners, and team heroes, then returns a formatted string summary.
    async def get_public_matches(limit: int = 5) -> str:
        """Get recent public matches.
    
        Args:
            limit: Number of matches to retrieve (default: 5)
    
        Returns:
            List of recent public matches
        """
        if limit > 20:
            limit = 20  # Cap for reasonable response size
    
        matches_data = await make_opendota_request("publicMatches")
    
        if "error" in matches_data:
            return f"Error retrieving public matches: {matches_data['error']}"
    
        if not matches_data or not isinstance(matches_data, list) or len(matches_data) == 0:
            return "No public matches found."
    
        formatted_matches = []
    
        # Limit the matches to display
        matches_to_show = []
        if isinstance(matches_data, list):
            matches_to_show = matches_data[:limit]
        for i, match in enumerate(matches_to_show):
            match_id = match.get("match_id", "Unknown")
            duration = format_duration(match.get("duration", 0))
            start_time = format_timestamp(match.get("start_time", 0))
            avg_rank = match.get("avg_rank_tier", 0)
            rank_name = format_rank_tier(avg_rank)
            radiant_win = match.get("radiant_win", False)
            winner = "Radiant" if radiant_win else "Dire"
    
            radiant_heroes = match.get("radiant_team", [])
            dire_heroes = match.get("dire_team", [])
    
            formatted_matches.append(
                f"{i+1}. Match ID: {match_id}\n"
                f"   Date: {start_time}\n"
                f"   Duration: {duration}\n"
                f"   Avg. Rank: {rank_name}\n"
                f"   Winner: {winner}\n"
                f"   Radiant Heroes: {', '.join(str(h) for h in radiant_heroes)}\n"
                f"   Dire Heroes: {', '.join(str(h) for h in dire_heroes)}"
            )
    
        return "Recent Public Matches:\n\n" + "\n\n".join(formatted_matches)
  • Registers the get_public_matches function as an MCP tool using the FastMCP @mcp.tool() decorator.
    @mcp.tool()
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions retrieving 'recent public matches' but doesn't specify what 'recent' means (e.g., time range), whether there are rate limits, authentication requirements, or pagination behavior. For a tool with no annotations, this leaves significant gaps in understanding its operation.

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 and concise, using clear sections for 'Args' and 'Returns' without unnecessary details. Each sentence serves a purpose, making it easy to parse. A minor deduction for not front-loading all critical information (e.g., the default value is in the Args section rather than the main description).

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 low complexity (one parameter, no nested objects) and the presence of an output schema (which handles return values), the description is somewhat complete. However, it lacks behavioral details (e.g., what defines 'recent,' rate limits) and usage guidelines, making it adequate but with clear gaps for effective agent use.

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

Parameters4/5

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

The description adds meaningful context for the single parameter 'limit' by explaining it as 'Number of matches to retrieve (default: 5),' which clarifies its purpose beyond the schema's basic type and default. With 0% schema description coverage and only one parameter, this compensation is effective, though not exhaustive (e.g., no range constraints).

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 recent public matches.' It specifies the verb ('Get') and resource ('recent public matches'), making it easy to understand what the tool does. However, it doesn't differentiate from sibling tools like 'get_pro_matches' or 'get_player_recent_matches,' which prevents a score of 5.

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 sibling tools like 'get_pro_matches' (for professional matches) or 'get_player_recent_matches' (for player-specific matches), leaving the agent without context for selection. This lack of comparative usage information results in a low score.

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