get_player_wordcloud
Analyze a Dota 2 player's chat patterns by retrieving their most frequently used words from in-game communications using their Steam32 account ID.
Instructions
Get most common words used by player in chat.
Args:
account_id: Steam32 account ID of the player
Returns:
List of player's most frequently used words
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_id | Yes |
Implementation Reference
- src/opendota_server/server.py:1031-1064 (handler)The main handler function for the 'get_player_wordcloud' tool. It fetches wordcloud data from the OpenDota API endpoint '/players/{account_id}/wordcloud', extracts 'my_word_counts', sorts the top 20 words by frequency, and formats them into a readable string response.@mcp.tool() async def get_player_wordcloud(account_id: int) -> str: """Get most common words used by player in chat. Args: account_id: Steam32 account ID of the player Returns: List of player's most frequently used words """ wordcloud_data = await make_opendota_request(f"players/{account_id}/wordcloud") if "error" in wordcloud_data: return f"Error retrieving wordcloud data: {wordcloud_data['error']}" my_words = wordcloud_data.get("my_word_counts", {}) if not my_words: return "No chat data found for this player." # Sort words by frequency sorted_words = sorted(my_words.items(), key=lambda x: x[1], reverse=True) # Get top 20 words top_words = sorted_words[:20] formatted_output = [] for word, count in top_words: formatted_output.append(f"{word}: {count} times") return f"Most Common Words for Player ID {account_id}:\n\n" + "\n".join( formatted_output )