Skip to main content
Glama
study-flamingo

D&D MCP Server

get_events

Retrieve and filter adventure log events from a Dungeons & Dragons campaign, including combat, roleplay, exploration, quests, and session records.

Instructions

Get events from the adventure log.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum number of events to return
event_typeNoFilter by event type
searchNoSearch events by title/description

Implementation Reference

  • The primary handler for the 'get_events' MCP tool. Decorated with @mcp.tool for automatic registration. Fetches events from storage (filtering by limit, type, or search), formats them into a markdown list, and returns as string.
    @mcp.tool
    def get_events(
        limit: Annotated[int | None, Field(description="Maximum number of events to return", ge=1)] = None,
        event_type: Annotated[Literal["combat", "roleplay", "exploration", "quest", "character", "world", "session"] | None, Field(description="Filter by event type")] = None,
        search: Annotated[str | None, Field(description="Search events by title/description")] = None,
    ) -> str:
        """Get events from the adventure log."""
        if search:
            events = storage.search_events(search)
        else:
            events = storage.get_events(limit=limit, event_type=event_type)
    
        if not events:
            return "No events found."
    
        event_list = []
        for event in events:
            timestamp = event.timestamp.strftime("%Y-%m-%d %H:%M")
            session_text = f" (Session {event.session_number})" if event.session_number else ""
            importance_stars = "★" * event.importance
    
            event_list.append(f"**{event.title}** [{event.event_type}] {importance_stars}")
            event_list.append(f"  {timestamp}{session_text}")
            event_list.append(f"  {event.description[:150]}{'...' if len(event.description) > 150 else ''}")
            if event.location:
                event_list.append(f"  📍 {event.location}")
            event_list.append("")
    
        return "**Adventure Log:**\n\n" + "\n".join(event_list)
  • Helper method on the Storage class that retrieves, filters by event_type, sorts by timestamp (newest first), limits, and returns list of AdventureEvent objects. Called by the main handler.
    def get_events(self, limit: int | None = None, event_type: str | None = None) -> list[AdventureEvent]:
        """Get adventure events, optionally filtered."""
        events = self._events
    
        if event_type:
            events = [e for e in events if e.event_type == event_type]
    
        # Sort by timestamp (newest first)
        events = sorted(events, key=lambda e: e.timestamp, reverse=True)
    
        if limit:
            events = events[:limit]
    
        return events
  • Input schema definitions using Pydantic Field and typing.Literal for the tool parameters: limit (optional int >=1), event_type (optional specific literal strings), search (optional str).
        limit: Annotated[int | None, Field(description="Maximum number of events to return", ge=1)] = None,
        event_type: Annotated[Literal["combat", "roleplay", "exploration", "quest", "character", "world", "session"] | None, Field(description="Filter by event type")] = None,
        search: Annotated[str | None, Field(description="Search events by title/description")] = None,
    ) -> str:
Behavior2/5

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

No annotations are provided, so the description carries full burden. 'Get events' implies a read operation, but it doesn't disclose behavioral traits like whether this requires authentication, returns paginated results, has rate limits, or what format the events come in. The description is too minimal to provide meaningful behavioral context.

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 extremely concise with a single sentence that gets straight to the point. There's no wasted words or unnecessary elaboration, making it easy to parse quickly.

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 and no output schema, the description is incomplete. It doesn't explain what 'events' are, what fields they contain, how they're ordered, or what the return structure looks like. For a tool with three parameters and no structured output documentation, this leaves significant gaps.

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 three parameters (limit, event_type, search). The description adds no parameter semantics beyond what's in the schema, but since schema coverage is high, baseline 3 is appropriate.

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 'Get events from the adventure log' clearly states the action (get) and resource (events from adventure log), but it's vague about scope and doesn't distinguish from siblings like 'get_sessions' or 'get_campaign_info'. It doesn't specify whether this retrieves all events, recent events, or filtered events.

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 on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get_sessions' (which might retrieve session-specific events) or 'list_quests' (which might overlap with quest events). There's no context about prerequisites or when this tool is appropriate.

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