Skip to main content
Glama
drewsungg

Pokemon Showdown MCP Server

by drewsungg

get_pokemon

Look up Pokemon data for competitive battles, including base stats, types, abilities, weight, and tier information to support strategic decision-making.

Instructions

Look up a Pokemon by name. Returns base stats, types, abilities with descriptions, weight, and competitive tier.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesPokemon name (e.g., 'pikachu', 'slaking', 'charizard')

Implementation Reference

  • Handler logic for the get_pokemon tool: fetches Pokemon data using the data loader and returns a formatted text response or not found message.
    if name == "get_pokemon":
        pokemon = loader.get_pokemon(arguments["name"])
        if pokemon:
            return [TextContent(type="text", text=format_pokemon_response(pokemon))]
        return [TextContent(type="text", text=f"Pokemon '{arguments['name']}' not found.")]
  • Registers the get_pokemon tool in the MCP server's list_tools method, including name, description, and input schema.
    Tool(
        name="get_pokemon",
        description="Look up a Pokemon by name. Returns base stats, types, abilities with descriptions, weight, and competitive tier.",
        inputSchema={
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "Pokemon name (e.g., 'pikachu', 'slaking', 'charizard')"
                }
            },
            "required": ["name"]
        }
    ),
  • Input schema definition for the get_pokemon tool, requiring a 'name' string parameter.
    inputSchema={
        "type": "object",
        "properties": {
            "name": {
                "type": "string",
                "description": "Pokemon name (e.g., 'pikachu', 'slaking', 'charizard')"
            }
        },
        "required": ["name"]
    }
  • Helper function that formats raw Pokemon data into a detailed, readable markdown response including stats, types, tier, weight, and ability descriptions.
    def format_pokemon_response(pokemon: dict) -> str:
        """Format Pokemon data into a readable response."""
        name = pokemon.get("name", "Unknown")
        types = pokemon.get("types", [])
        stats = pokemon.get("baseStats", {})
        abilities = pokemon.get("abilities", {})
        weight = pokemon.get("weightkg", 0)
        tier = pokemon.get("tier", "Unknown")
    
        # Get ability descriptions
        loader = get_loader()
        ability_details = []
        for key, ability_name in abilities.items():
            ability_data = loader.get_ability(ability_name)
            if ability_data:
                desc = ability_data.get("shortDesc") or ability_data.get("desc", "")
                slot = "Hidden" if key == "H" else f"Slot {int(key) + 1}"
                ability_details.append(f"  - {ability_name} ({slot}): {desc}")
            else:
                slot = "Hidden" if key == "H" else f"Slot {int(key) + 1}"
                ability_details.append(f"  - {ability_name} ({slot})")
    
        response = f"""## {name}
    
    **Types:** {', '.join(types)}
    **Tier:** {tier}
    **Weight:** {weight}kg
    
    ### Base Stats
    - HP: {stats.get('hp', '?')}
    - Attack: {stats.get('atk', '?')}
    - Defense: {stats.get('def', '?')}
    - Sp. Attack: {stats.get('spa', '?')}
    - Sp. Defense: {stats.get('spd', '?')}
    - Speed: {stats.get('spe', '?')}
    - **Total:** {sum(stats.values())}
    
    ### Abilities
    {chr(10).join(ability_details)}
    """
        return response
  • Data loader method that normalizes the Pokemon name and retrieves the corresponding data from the loaded pokedex.
    def get_pokemon(self, name: str) -> dict | None:
        """
        Get Pokemon data by name.
    
        Args:
            name: Pokemon name (case-insensitive, handles forms like "Mega Charizard Y")
    
        Returns:
            Pokemon data dict or None if not found
        """
        self.load_all()
        key = self._normalize_pokemon_name(name)
        return self.pokemon.get(key)

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