Skip to main content
Glama
drewsungg

Pokemon Showdown MCP Server

by drewsungg

get_type_effectiveness

Calculate type effectiveness multipliers for Pokemon battles by analyzing attack types against defending Pokemon types to inform strategic decisions.

Instructions

Calculate type effectiveness multiplier for an attack against a Pokemon's types.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
attack_typeYesThe attacking move's type (e.g., 'electric', 'fire')
defend_typesYesList of the defending Pokemon's types (e.g., ['water', 'flying'])

Implementation Reference

  • Main handler for the get_type_effectiveness tool. Extracts arguments, calls the data loader's method for computation, determines descriptive text based on multiplier, and returns formatted TextContent response.
    elif name == "get_type_effectiveness": attack_type = arguments["attack_type"] defend_types = arguments["defend_types"] multiplier = loader.get_type_effectiveness(attack_type, defend_types) # Describe the effectiveness if multiplier == 0: desc = "No effect (immune)" elif multiplier == 0.25: desc = "Not very effective (0.25x)" elif multiplier == 0.5: desc = "Not very effective (0.5x)" elif multiplier == 1: desc = "Normal effectiveness (1x)" elif multiplier == 2: desc = "Super effective (2x)" elif multiplier == 4: desc = "Super effective (4x)" else: desc = f"{multiplier}x" response = f"""## Type Effectiveness **{attack_type.capitalize()}** vs **{'/'.join(t.capitalize() for t in defend_types)}** **Multiplier:** {multiplier}x **Result:** {desc} """ return [TextContent(type="text", text=response)]
  • Input schema definition specifying required parameters: attack_type (string) and defend_types (array of strings).
    inputSchema={ "type": "object", "properties": { "attack_type": { "type": "string", "description": "The attacking move's type (e.g., 'electric', 'fire')" }, "defend_types": { "type": "array", "items": {"type": "string"}, "description": "List of the defending Pokemon's types (e.g., ['water', 'flying'])" } }, "required": ["attack_type", "defend_types"] }
  • Tool registration in the @server.list_tools() callback, including name, description, and input schema.
    Tool( name="get_type_effectiveness", description="Calculate type effectiveness multiplier for an attack against a Pokemon's types.", inputSchema={ "type": "object", "properties": { "attack_type": { "type": "string", "description": "The attacking move's type (e.g., 'electric', 'fire')" }, "defend_types": { "type": "array", "items": {"type": "string"}, "description": "List of the defending Pokemon's types (e.g., ['water', 'flying'])" } }, "required": ["attack_type", "defend_types"] } ),
  • Core computation function in PokemonDataLoader class. Loads typechart data if needed, normalizes types to lowercase, and multiplies effectiveness factors from typechart for each defending type.
    def get_type_effectiveness( self, attack_type: str, defend_types: list[str] ) -> float: """ Calculate type effectiveness multiplier. Args: attack_type: The attacking move's type defend_types: List of defending Pokemon's types Returns: Effectiveness multiplier (0, 0.25, 0.5, 1, 2, 4) """ self.load_all() attack_type = attack_type.lower() defend_types = [t.lower() for t in defend_types] multiplier = 1.0 # Type chart maps defending type -> attacking type -> multiplier for defend_type in defend_types: type_data = self.typechart.get(defend_type, {}) eff = type_data.get(attack_type, 1.0) multiplier *= eff return multiplier

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