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 and team building.

Instructions

Find all Pokemon that can have a specific ability.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
abilityYesAbility name to search for

Implementation Reference

  • The handler logic within the @server.call_tool() function. Extracts the 'ability' argument, calls the loader's get_pokemon_with_ability method, formats a response listing matching Pokemon (up to 50), and returns it as TextContent.
    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 in the list_tools() function, including name, description, and input schema requiring an 'ability' string parameter.
    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 defining the tool's required parameter: an 'ability' string.
    inputSchema={ "type": "object", "properties": { "ability": { "type": "string", "description": "Ability name to search for" } }, "required": ["ability"] }
  • Helper method in PokemonDataLoader class that implements the search: iterates over all Pokemon data, checks if the normalized ability name matches any in the Pokemon's abilities dictionary, collects matching Pokemon names.
    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