get_item
Retrieve detailed battle effects for held items in Pokemon Showdown. Enter an item name to get its in-game functionality and strategic impact.
Instructions
Look up a held item by name. Returns full description of what the item does in battle.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Item name (e.g., 'choice-scarf', 'leftovers', 'life-orb') |
Implementation Reference
- src/data_loader.py:100-112 (handler)Core handler function that loads item data if needed, normalizes the input name to a dictionary key (lowercase, no spaces or hyphens), and retrieves the item data from the pre-loaded items.json cache.def get_item(self, name: str) -> dict | None: """ Get item data by name. Args: name: Item name (case-insensitive) Returns: Item data dict or None if not found """ self.load_all() key = name.lower().replace(" ", "").replace("-", "") return self.items.get(key)
- src/pokemon_server.py:227-240 (registration)Registers the 'get_item' tool with the MCP server in the list_tools() function, defining its name, battle-focused description, and input schema requiring a single 'name' string parameter.Tool( name="get_item", description="Look up a held item by name. Returns full description of what the item does in battle.", inputSchema={ "type": "object", "properties": { "name": { "type": "string", "description": "Item name (e.g., 'choice-scarf', 'leftovers', 'life-orb')" } }, "required": ["name"] } ),
- src/pokemon_server.py:328-332 (handler)Tool dispatch handler in call_tool(): invokes the data loader's get_item, formats the result using format_item_response if found, or returns a not-found message.elif name == "get_item": item = loader.get_item(arguments["name"]) if item: return [TextContent(type="text", text=format_item_response(item))] return [TextContent(type="text", text=f"Item '{arguments['name']}' not found.")]
- src/pokemon_server.py:164-178 (helper)Helper function to format raw item dictionary into a structured markdown response, including the item's effect description and optional short summary.def format_item_response(item: dict) -> str: """Format item data into a readable response.""" name = item.get("name", "Unknown") desc = item.get("desc", item.get("shortDesc", "No description.")) short_desc = item.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/pokemon_server.py:230-239 (schema)Input schema definition for the 'get_item' tool, specifying an object with a required 'name' string property and example item names.inputSchema={ "type": "object", "properties": { "name": { "type": "string", "description": "Item name (e.g., 'choice-scarf', 'leftovers', 'life-orb')" } }, "required": ["name"] }