list_characters
Retrieve and display all characters in your Dungeons & Dragons campaign to streamline character management and improve campaign organization.
Instructions
List all characters in the current campaign.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/gamemaster_mcp/main.py:351-364 (handler)MCP tool handler for 'list_characters'. Retrieves character list from storage, fetches details for each, and formats a markdown list of characters with levels, races, and classes.@mcp.tool def list_characters() -> str: """List all characters in the current campaign.""" characters = storage.list_characters() if not characters: return "No characters in the current campaign." char_list = [] for char_name in characters: char = storage.get_character(char_name) if char: char_list.append(f"• {char.name} (Level {char.character_class.level} {char.race.name} {char.character_class.name})") return "**Characters:**\n" + "\n".join(char_list)
- Helper method in DnDStorage class that returns the list of character names (keys) from the current campaign's characters dictionary.def list_characters(self) -> list[str]: """List all character names in the current campaign.""" if not self._current_campaign: return [] return list(self._current_campaign.characters.keys())