get_campaign_info
Retrieve details about your current Dungeons & Dragons campaign, including characters, quests, locations, and session information for campaign management.
Instructions
Get information about the current campaign.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_campaign_info"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/gamemaster_mcp/main.py:69-94 (handler)The core handler function for the 'get_campaign_info' tool. Decorated with @mcp.tool for automatic registration. Retrieves the current campaign from storage, compiles key statistics, and returns a formatted markdown string with campaign 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()]) - src/gamemaster_mcp/main.py:69-69 (registration)The @mcp.tool decorator registers the get_campaign_info function as an MCP tool.
@mcp.tool