Skip to main content
Glama

get_player_win_loss

Retrieve win/loss statistics for Dota 2 players using their Steam32 account ID to analyze player performance and match history.

Instructions

Get win/loss statistics for a player.

Args: account_id: Steam32 account ID of the player Returns: Win/loss record

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
account_idYes

Implementation Reference

  • The handler function implementing the get_player_win_loss tool. It is decorated with @mcp.tool(), serving as both the implementation and registration. Fetches win/loss data from the OpenDota API endpoint `/players/{account_id}/wl`, handles errors, computes win rate, and returns a formatted string summary.
    @mcp.tool() async def get_player_win_loss(account_id: int) -> str: """Get win/loss statistics for a player. Args: account_id: Steam32 account ID of the player Returns: Win/loss record """ wl_data = await make_opendota_request(f"players/{account_id}/wl") if "error" in wl_data: return f"Error retrieving win/loss data: {wl_data['error']}" wins = wl_data.get("win", 0) losses = wl_data.get("lose", 0) total = wins + losses win_rate = (wins / total * 100) if total > 0 else 0 return ( f"Win/Loss Record for Player ID {account_id}:\n" f"Wins: {wins}\n" f"Losses: {losses}\n" f"Total Games: {total}\n" f"Win Rate: {win_rate:.2f}%" )

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