get_campaign_info
Retrieve detailed data about the active Dungeons & Dragons campaign. Access campaign-specific information to streamline session planning and campaign management.
Instructions
Get information about the current campaign.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/gamemaster_mcp/main.py:69-94 (handler)The `get_campaign_info` tool handler, decorated with `@mcp.tool` for registration. It fetches the current campaign from storage and returns formatted information including name, description, counts of entities, and game state details.@mcp.tool def get_campaign_info() -> str: """Get information about the current campaign.""" campaign = storage.get_current_campaign() if not campaign: return "No active campaign." info = { "name": campaign.name, "description": campaign.description, "dm_name": campaign.dm_name, "setting": campaign.get_setting(), "character_count": len(campaign.characters), "npc_count": len(campaign.npcs), "location_count": len(campaign.locations), "quest_count": len(campaign.quests), "session_count": len(campaign.sessions), "current_session": campaign.game_state.current_session, "current_location": campaign.game_state.current_location, "party_level": campaign.game_state.party_level, "in_combat": campaign.game_state.in_combat } return f"**Campaign: {campaign.name}**\n\n" + \ "\n".join([f"**{k.replace('_', ' ').title()}:** {v}" for k, v in info.items()])