Skip to main content
Glama
drewsungg

Pokemon Showdown MCP Server

by drewsungg

search_pokemon_by_ability

Find all Pokemon that can have a specific ability. Use this tool to identify which Pokemon possess a particular ability for competitive battle strategy planning.

Instructions

Find all Pokemon that can have a specific ability.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
abilityYesAbility name to search for

Implementation Reference

  • Handler logic in call_tool function: extracts ability name, calls loader.get_pokemon_with_ability, formats and returns the list of matching Pokemon or a not-found message.
        elif name == "search_pokemon_by_ability":
            ability = arguments["ability"]
            pokemon_list = loader.get_pokemon_with_ability(ability)
    
            if not pokemon_list:
                return [TextContent(type="text", text=f"No Pokemon found with ability '{ability}'.")]
    
            response = f"""## Pokemon with {ability.title()}
    
    Found {len(pokemon_list)} Pokemon:
    {', '.join(sorted(pokemon_list)[:50])}
    """
            if len(pokemon_list) > 50:
                response += f"\n... and {len(pokemon_list) - 50} more."
    
            return [TextContent(type="text", text=response)]
  • Registers the tool with the MCP server in list_tools(), including name, description, and input schema requiring 'ability' string.
    Tool(
        name="search_pokemon_by_ability",
        description="Find all Pokemon that can have a specific ability.",
        inputSchema={
            "type": "object",
            "properties": {
                "ability": {
                    "type": "string",
                    "description": "Ability name to search for"
                }
            },
            "required": ["ability"]
        }
    ),
  • Input schema definition: object with required 'ability' property of type string.
        inputSchema={
            "type": "object",
            "properties": {
                "ability": {
                    "type": "string",
                    "description": "Ability name to search for"
                }
            },
            "required": ["ability"]
        }
    ),
  • Supporting method in PokemonDataLoader: scans all loaded Pokemon data to collect names of those possessing the given ability (case-insensitive match).
    def get_pokemon_with_ability(self, ability_name: str) -> list[str]:
        """Find all Pokemon that can have a specific ability."""
        self.load_all()
        ability_lower = ability_name.lower()
        result = []
    
        for poke_id, poke_data in self.pokemon.items():
            abilities = poke_data.get("abilities", {})
            for ability in abilities.values():
                if ability.lower() == ability_lower:
                    result.append(poke_data.get("name", poke_id))
                    break
    
        return result

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/drewsungg/mcpkmn-showdown'

If you have feedback or need assistance with the MCP directory API, please join our Discord server