Skip to main content
Glama

get_heroes

Retrieve a complete list of Dota 2 heroes with basic information for game analysis and strategy planning.

Instructions

Get list of all Dota 2 heroes.

Returns:
    List of all heroes with basic information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_heroes' tool. It fetches heroes data from OpenDota API, formats it with details like ID, name, primary attribute, attack type, and roles, and returns a formatted string. Registered via @mcp.tool() decorator.
    @mcp.tool()
    async def get_heroes() -> str:
        """Get list of all Dota 2 heroes.
    
        Returns:
            List of all heroes with basic information
        """
        heroes_data = await make_opendota_request("heroes")
    
        if "error" in heroes_data:
            return f"Error retrieving heroes data: {heroes_data['error']}"
    
        if not heroes_data or not isinstance(heroes_data, list) or len(heroes_data) == 0:
            return "No heroes data found."
    
        # Sort by hero ID
        sorted_heroes = sorted(heroes_data, key=lambda x: x.get("id", 0))
    
        formatted_heroes = []
    
        for hero in sorted_heroes:
            hero_id = hero.get("id", 0)
            name = hero.get("localized_name", f"Hero {hero_id}")
            primary_attr = hero.get("primary_attr", "Unknown")
            attack_type = hero.get("attack_type", "Unknown")
            roles = ", ".join(hero.get("roles", []))
    
            formatted_heroes.append(
                f"{name} (ID: {hero_id})\n"
                f"Primary Attribute: {primary_attr}\n"
                f"Attack Type: {attack_type}\n"
                f"Roles: {roles}"
            )
    
        return "Dota 2 Heroes:\n\n" + "\n\n".join(formatted_heroes)
  • The @mcp.tool() decorator registers the get_heroes function as an MCP tool.
    @mcp.tool()
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It states the tool returns 'List of all heroes with basic information', which implies read-only behavior, but lacks details on rate limits, authentication needs, pagination, or what 'basic information' entails. This is insufficient for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with two sentences: one stating the purpose and one describing the return. It's front-loaded with the main action, but could be slightly more structured (e.g., clarifying 'basic information').

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 simplicity (0 parameters, output schema exists), the description is somewhat complete but lacks behavioral context. With no annotations and an output schema, it should ideally explain more about the return format or usage constraints, but it's minimally adequate.

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 tool has 0 parameters, and schema description coverage is 100%. The description doesn't need to add parameter semantics, so it meets the baseline of 4 for zero-parameter tools without unnecessary details.

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 list of all Dota 2 heroes' with a specific verb ('Get') and resource ('Dota 2 heroes'). It distinguishes from siblings like get_hero_stats (statistics) and get_match_heroes (match-specific heroes), but doesn't explicitly differentiate them.

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?

No guidance on when to use this tool versus alternatives. It doesn't mention when to choose get_heroes over get_hero_stats (for detailed stats) or get_match_heroes (for heroes in a match), nor does it provide context or exclusions.

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