Skip to main content
Glama

get_player_totals

Retrieve comprehensive Dota 2 player statistics using a Steam32 account ID to analyze performance metrics and gameplay patterns.

Instructions

Get player's overall stats totals.

Args:
    account_id: Steam32 account ID of the player

Returns:
    Summary of player's total stats

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The get_player_totals tool handler. Decorated with @mcp.tool() for registration. Fetches player total statistics from the OpenDota API endpoint `/players/{account_id}/totals`, processes the data, and returns a formatted string summary of total and average stats for various metrics.
    @mcp.tool()
    async def get_player_totals(account_id: int) -> str:
        """Get player's overall stats totals.
    
        Args:
            account_id: Steam32 account ID of the player
    
        Returns:
            Summary of player's total stats
        """
        totals_data = await make_opendota_request(f"players/{account_id}/totals")
    
        if "error" in totals_data:
            return f"Error retrieving totals data: {totals_data['error']}"
    
        if not totals_data or not isinstance(totals_data, list) or len(totals_data) == 0:
            return "No totals data found for this player."
    
        # Extract important fields
        formatted_stats = []
    
        for stat in totals_data:
            field = stat.get("field", "")
            count = stat.get("n", 0)
            sum_value = stat.get("sum", 0)
            avg_value = sum_value / count if count > 0 else 0
    
            # Convert field name to something more readable
            readable_field = field.replace("_", " ").title()
    
            formatted_stats.append(
                f"{readable_field}: {sum_value:,} total, {avg_value:.2f} avg"
            )
    
        return f"Stat Totals for Player ID {account_id}:\n\n" + "\n".join(formatted_stats)
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 states it 'Get's data, implying a read-only operation, but doesn't cover other aspects like rate limits, authentication needs, error handling, or data freshness. For a tool with no annotations, this is a significant gap in transparency.

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 appropriately sized and front-loaded. It starts with a clear purpose statement, followed by brief sections for 'Args' and 'Returns', with no wasted words. Every sentence adds value, making it efficient and easy to parse.

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 complexity (simple read operation with 1 parameter), the description is somewhat complete but has gaps. It explains the parameter and return value at a high level, and an output schema exists, so detailed return explanations aren't needed. However, with no annotations, it lacks behavioral context like error cases or performance hints, making it adequate but not fully comprehensive.

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 beyond the input schema. The schema has 0% description coverage, only specifying 'account_id' as an integer. The description explains that this is a 'Steam32 account ID of the player', clarifying the parameter's purpose and format, which compensates well for the low schema coverage.

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 player's overall stats totals.' It specifies the verb ('Get') and resource ('player's overall stats totals'), making it easy to understand what the tool does. However, it doesn't explicitly distinguish this from sibling tools like 'get_player_win_loss' or 'get_player_rankings', which might also provide player statistics, so it doesn't reach the highest score.

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 any context, prerequisites, or exclusions, such as how it differs from 'get_player_heroes' or 'get_player_recent_matches'. This lack of usage instructions leaves the agent to infer when this tool is appropriate.

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