Skip to main content
Glama
study-flamingo

D&D MCP Server

get_sessions

Retrieve all session notes to track campaign progress and maintain continuity in Dungeons & Dragons adventures.

Instructions

Get all session notes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'get_sessions'. Decorated with @mcp.tool, it retrieves session notes from storage, formats them into a markdown-formatted string list sorted by session number, and returns it. This is both the handler logic and registration point.
    @mcp.tool
    def get_sessions() -> str:
        """Get all session notes."""
        sessions = storage.get_sessions()
        if not sessions:
            return "No session notes recorded."
    
        session_list = []
        for session in sorted(sessions, key=lambda s: s.session_number):
            title = session.title or "No title"
            date = session.date.strftime("%Y-%m-%d")
            session_list.append(f"**Session {session.session_number}** ({date}): {title}")
            session_list.append(f"  {session.summary[:100]}{'...' if len(session.summary) > 100 else ''}")
            session_list.append("")
    
        return "**Session Notes:**\n\n" + "\n".join(session_list)
  • Core helper method in the Storage class that returns the list of SessionNote objects from the current campaign's sessions attribute.
    def get_sessions(self) -> list[SessionNote]:
        """Get all session notes."""
        if not self._current_campaign:
            return []
        return self._current_campaign.sessions
  • Pydantic model defining the structure of each SessionNote object returned by the storage helper and used in the tool handler.
    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 = ""
Behavior2/5

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

With no annotations, the description carries full burden but only states the action without behavioral details. It doesn't disclose if this is read-only, requires permissions, has rate limits, returns paginated results, or what format the notes are in. This is inadequate for a 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, clear sentence with no wasted words. It's front-loaded with the core action and resource, making it highly efficient and easy to parse.

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 no annotations, no output schema, and the description's minimalism, this is incomplete for a data retrieval tool. It lacks details on return values, error handling, or behavioral traits, leaving significant gaps for an agent to understand how to use it effectively.

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 with 100% schema description coverage, so the schema fully documents the lack of inputs. The description adds no parameter information, which is acceptable here since there are no parameters to explain, 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.

Purpose4/5

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

The description clearly states the verb ('Get') and resource ('all session notes'), making the purpose specific and understandable. It distinguishes from siblings like 'add_session_note' (which creates) and 'get_events' (which retrieves different data), though it doesn't explicitly differentiate them in the text.

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, context for retrieving session notes, or compare with other data-fetching tools like 'get_events' or 'get_campaign_info', leaving usage entirely implicit.

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