Skip to main content
Glama

get_player_wordcloud

Analyzes a Dota 2 player's in-game chat to identify their most frequently used words, providing insight into communication patterns.

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
NameRequiredDescriptionDefault
account_idYes

Implementation Reference

  • The main handler function for the get_player_wordcloud tool, decorated with @mcp.tool() for registration. It fetches wordcloud data from OpenDota API for a given player account_id, processes the top 20 most frequent words from chat, and returns a formatted string summary.
    @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
        )
  • The @mcp.tool() decorator registers this function as an MCP tool.
    @mcp.tool()

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