get_ability
Retrieve detailed battle descriptions for Pokemon abilities by name, providing competitive strategy information for Pokemon Showdown matches.
Instructions
Look up an ability by name. Returns full description of what the ability does in battle.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Ability name (e.g., 'truant', 'intimidate', 'levitate') |
Implementation Reference
- src/pokemon_server.py:322-326 (handler)Handler logic in call_tool that executes the get_ability tool: retrieves ability data via loader and returns formatted response or not found message.elif name == "get_ability": ability = loader.get_ability(arguments["name"]) if ability: return [TextContent(type="text", text=format_ability_response(ability))] return [TextContent(type="text", text=f"Ability '{arguments['name']}' not found.")]
- src/pokemon_server.py:213-226 (registration)Registers the get_ability tool with the MCP server, including name, description, and input schema requiring 'name' parameter.Tool( name="get_ability", description="Look up an ability by name. Returns full description of what the ability does in battle.", inputSchema={ "type": "object", "properties": { "name": { "type": "string", "description": "Ability name (e.g., 'truant', 'intimidate', 'levitate')" } }, "required": ["name"] } ),
- src/pokemon_server.py:216-225 (schema)Input schema for get_ability tool: object with required 'name' string parameter.inputSchema={ "type": "object", "properties": { "name": { "type": "string", "description": "Ability name (e.g., 'truant', 'intimidate', 'levitate')" } }, "required": ["name"] }
- src/pokemon_server.py:147-161 (helper)Helper function to format raw ability data dictionary into a markdown-formatted text response.def format_ability_response(ability: dict) -> str: """Format ability data into a readable response.""" name = ability.get("name", "Unknown") desc = ability.get("desc", ability.get("shortDesc", "No description.")) short_desc = ability.get("shortDesc", "") response = f"""## {name} ### Effect {desc} """ if short_desc and short_desc != desc: response += f"\n### Summary\n{short_desc}\n" return response
- src/data_loader.py:86-98 (helper)Core data retrieval method: normalizes ability name and looks up in loaded abilities dictionary from JSON cache.def get_ability(self, name: str) -> dict | None: """ Get ability data by name. Args: name: Ability name (case-insensitive) Returns: Ability data dict or None if not found """ self.load_all() key = name.lower().replace(" ", "").replace("-", "") return self.abilities.get(key)