Skip to main content
Glama

get_player_totals

Retrieve comprehensive Dota 2 player statistics including total matches, wins, kills, deaths, assists, and other performance metrics using Steam32 account ID.

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

Implementation Reference

  • The primary handler function for the 'get_player_totals' MCP tool. It is registered via the @mcp.tool() decorator. The function fetches the player's totals 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 fields.
    @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)

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