Skip to main content
Glama
study-flamingo

D&D MCP Server

get_game_state

Retrieve the current state of your Dungeons & Dragons campaign, including characters, NPCs, locations, quests, and combat encounters for session tracking.

Instructions

Get the current game state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'get_game_state'. Fetches the game state from storage and returns a formatted string summary.
    @mcp.tool
    def get_game_state() -> str:
        """Get the current game state."""
        game_state = storage.get_game_state()
        if not game_state:
            return "No game state available."
    
        state_info = f"""**Game State**
    **Campaign:** {game_state.campaign_name}
    **Session:** {game_state.current_session}
    **Location:** {game_state.current_location or 'Unknown'}
    **Date (In-Game):** {game_state.current_date_in_game or 'Unknown'}
    **Party Level:** {game_state.party_level}
    **Party Funds:** {game_state.party_funds}
    **In Combat:** {'Yes' if game_state.in_combat else 'No'}
    
    **Active Quests:** {len(game_state.active_quests)}
    
    **Notes:** {game_state.notes or 'No current notes.'}
    """
    
        return state_info
  • Helper method in Storage class that retrieves the current GameState object from the active campaign.
    def get_game_state(self) -> GameState | None:
        """Get the current game state."""
        if not self._current_campaign:
            return None
        return self._current_campaign.game_state
  • Pydantic BaseModel defining the GameState data structure used by the tool.
    class GameState(BaseModel):
        """Current state of the game."""
        campaign_name: str
        current_session: int = 1
        current_date_in_game: str | None = None
        current_location: str | None = None
        active_quests: list[str] = Field(default_factory=list)
        party_level: int = 1
        party_funds: str = "0 gp"
        initiative_order: list[dict[str, Any]] = Field(default_factory=list)
        in_combat: bool = False
        current_turn: str | None = None
        notes: str = ""
        updated_at: datetime = Field(default_factory=datetime.now)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It only states the action without detailing what the game state includes, whether it's read-only, if it requires specific permissions, or how it behaves in different contexts (e.g., during combat). This leaves significant gaps in understanding the tool's operational traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with no wasted words. It's front-loaded and efficiently conveys the core action, making it easy to parse quickly without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity implied by sibling tools (e.g., game state likely involves multiple entities like characters, locations, and combat), the description is insufficient. With no annotations, no output schema, and minimal detail, it fails to provide enough context for an agent to understand what information is retrieved or how to interpret the result, leaving critical gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so there's no need for parameter details in the description. The description doesn't add semantic value beyond the schema, but this is acceptable given the lack of parameters, aligning with the baseline for zero parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states the verb ('Get') and resource ('game state'), making the basic purpose clear. However, it lacks specificity about what constitutes the game state (e.g., campaign details, character positions, combat status) and doesn't distinguish it from sibling tools like 'get_campaign_info' or 'update_game_state', leaving ambiguity in scope.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention prerequisites, such as needing an active campaign, or clarify its role relative to siblings like 'get_campaign_info' for broader metadata or 'update_game_state' for modifications, leaving the agent to infer usage from context alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/study-flamingo/gamemaster-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server