Skip to main content
Glama
study-flamingo

D&D MCP Server

add_session_note

Record D&D session details including summary, events, characters, experience, and treasure to track campaign progress and maintain game history.

Instructions

Add notes for a game session.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
session_numberYesSession number
summaryYesSession summary
titleNoSession title
eventsNoKey events that occurred
characters_presentNoCharacters present in session
experience_gainedNoExperience points gained
treasure_foundNoTreasure or items found
notesNoAdditional notes

Implementation Reference

  • MCP tool handler decorated with @mcp.tool. Validates inputs using Pydantic Annotated Fields, constructs a SessionNote instance, persists it using storage, and returns a confirmation message.
    @mcp.tool
    def add_session_note(
        session_number: Annotated[int, Field(description="Session number", ge=1)],
        summary: Annotated[str, Field(description="Session summary")],
        title: Annotated[str | None, Field(description="Session title")] = None,
        events: Annotated[list[str] | None, Field(description="Key events that occurred")] = None,
        characters_present: Annotated[list[str] | None, Field(description="Characters present in session")] = None,
        experience_gained: Annotated[int | None, Field(description="Experience points gained", ge=0)] = None,
        treasure_found: Annotated[list[str] | None, Field(description="Treasure or items found")] = None,
        notes: Annotated[str, Field(description="Additional notes")] = "",
    ) -> str:
        """Add notes for a game session."""
        session_note = SessionNote(
            session_number=session_number,
            title=title,
            summary=summary,
            events=events or [],
            characters_present=characters_present or [],
            experience_gained=experience_gained,
            treasure_found=treasure_found or [],
            notes=notes
        )
    
        storage.add_session_note(session_note)
        return f"Added session note for Session {session_note.session_number}"
  • Pydantic BaseModel defining the structure and validation for SessionNote objects used by the tool.
    class SessionNote(BaseModel):
        """Session notes and summary."""
        id: str = Field(default_factory=lambda: random(length=8))
        session_number: int
        date: datetime = Field(default_factory=datetime.now)
        title: str | None = None
        summary: str
        events: list[str] = Field(default_factory=list)
        characters_present: list[str] = Field(default_factory=list)
        experience_gained: int | None = None
        treasure_found: list[str] = Field(default_factory=list)
        notes: str = ""
  • Helper method in DnDStorage class that appends the SessionNote to the current campaign's sessions list and persists the changes to disk.
    def add_session_note(self, session_note: SessionNote) -> None:
        """Add a session note."""
        if not self._current_campaign:
            raise ValueError("No current campaign")
    
        self._current_campaign.sessions.append(session_note)
        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 but offers minimal behavioral insight. It implies a write operation ('Add'), but doesn't disclose permissions needed, whether it creates or updates notes, error conditions, or response format. This is inadequate for a mutation tool with zero annotation coverage.

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, efficient sentence with zero waste. It's appropriately sized and front-loaded, making it easy to parse 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 of an 8-parameter mutation tool with no annotations and no output schema, the description is incomplete. It lacks crucial details like behavioral traits, usage context, and return values, leaving significant gaps for an AI agent to operate effectively.

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?

Schema description coverage is 100%, so the schema fully documents all 8 parameters. The description adds no additional meaning beyond the schema's parameter descriptions (e.g., 'Session summary'), resulting in a baseline score of 3 where the schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the action ('Add notes') and the resource ('for a game session'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'get_sessions' or 'update_game_state', which would require more specificity about what kind of notes or how they're stored.

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 (e.g., needing an existing session), exclusions, or how it relates to siblings like 'update_game_state' or 'get_sessions', leaving the agent to infer usage context.

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