Skip to main content
Glama
study-flamingo

D&D MCP Server

update_game_state

Modify Dungeons & Dragons campaign progress by updating location, session number, party level, combat status, and other game state details.

Instructions

Update the current game state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
current_locationNoCurrent party location
current_sessionNoCurrent session number
current_date_in_gameNoCurrent in-game date
party_levelNoAverage party level
party_fundsNoParty treasure/funds
in_combatNoWhether party is in combat
notesNoCurrent situation notes

Implementation Reference

  • MCP tool handler for 'update_game_state'. Defines input schema via Annotated parameters with Field descriptions and constraints. Collects provided kwargs and delegates to storage.update_game_state. Returns confirmation message. The @mcp.tool decorator handles registration.
    @mcp.tool
    def update_game_state(
        current_location: Annotated[str | None, Field(description="Current party location")] = None,
        current_session: Annotated[int | None, Field(description="Current session number", ge=1)] = None,
        current_date_in_game: Annotated[str | None, Field(description="Current in-game date")] = None,
        party_level: Annotated[int | None, Field(description="Average party level", ge=1, le=20)] = None,
        party_funds: Annotated[str | None, Field(description="Party treasure/funds")] = None,
        in_combat: Annotated[bool | None, Field(description="Whether party is in combat")] = None,
        notes: Annotated[str | None, Field(description="Current situation notes")] = None,
    ) -> str:
        """Update the current game state."""
        kwargs = {}
        if current_location is not None:
            kwargs["current_location"] = current_location
        if current_session is not None:
            kwargs["current_session"] = current_session
        if current_date_in_game is not None:
            kwargs["current_date_in_game"] = current_date_in_game
        if party_level is not None:
            kwargs["party_level"] = party_level
        if party_funds is not None:
            kwargs["party_funds"] = party_funds
        if in_combat is not None:
            kwargs["in_combat"] = in_combat
        if notes is not None:
            kwargs["notes"] = notes
    
        storage.update_game_state(**kwargs)
        return "Updated game state"
  • Storage class method that implements the actual game state update logic by dynamically setting attributes on the GameState object based on kwargs, updating timestamps, and persisting to file.
    def update_game_state(self, **kwargs) -> None:
        """Update the game state."""
        if not self._current_campaign:
            raise ValueError("No current campaign")
    
        game_state = self._current_campaign.game_state
        for key, value in kwargs.items():
            if hasattr(game_state, key):
                setattr(game_state, key, value)
    
        game_state.updated_at = datetime.now()
        self._current_campaign.updated_at = datetime.now()
        self._save_campaign()
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure but offers minimal information. 'Update' implies a mutation operation, but the description doesn't address permissions needed, whether changes are reversible, what happens when only partial parameters are provided, or how this tool interacts with related tools like 'get_game_state'. The description fails to provide meaningful behavioral context beyond the basic action implied by the name.

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 maximally concise at just 5 words. While this conciseness comes at the expense of helpful information, the description contains zero wasted words and is perfectly front-loaded with the core action. Every word serves the minimal purpose of stating the tool's basic function.

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?

For a mutation tool with 7 parameters, no annotations, and no output schema, the description is severely inadequate. It doesn't explain what 'game state' encompasses, how updates affect the system, what validation occurs, or what the tool returns. The combination of sparse description and missing structured metadata leaves significant gaps in understanding this tool's behavior and proper use.

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

Parameters3/5

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

The description provides no parameter information, but the input schema has 100% description coverage with clear documentation for all 7 parameters. Each parameter has a descriptive title and explanation of what it represents (e.g., 'Current party location', 'Average party level', 'Whether party is in combat'). The schema does the heavy lifting, establishing a baseline score of 3.

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

Purpose2/5

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

The description 'Update the current game state' is essentially a tautology that restates the tool name 'update_game_state' without adding meaningful specificity. It doesn't clarify what aspects of game state are updated or how this differs from sibling tools like 'update_character' or 'update_quest' that also modify game-related data.

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

Usage Guidelines1/5

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

The description provides absolutely no guidance about when to use this tool versus alternatives. With multiple sibling tools that modify game data (update_character, update_quest, bulk_update_characters, etc.), there's no indication of what distinguishes this tool's purpose or appropriate context for its use.

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