Skip to main content
Glama
study-flamingo

D&D MCP Server

list_campaigns

Retrieve all available Dungeons & Dragons campaigns to manage characters, NPCs, locations, quests, and session tracking.

Instructions

List all available campaigns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP tool handler for 'list_campaigns'. Decorated with @mcp.tool for automatic registration and schema inference. Retrieves campaigns via storage layer and formats a markdown list indicating the current campaign.
    @mcp.tool
    def list_campaigns() -> str:
        """List all available campaigns."""
        campaigns = storage.list_campaigns()
        if not campaigns:
            return f"❌ No campaigns found in {storage.data_dir}!"
    
        current = storage.get_current_campaign()
        current_name = current.name if current else None
    
        campaign_list = []
        for campaign in campaigns:
            marker = " (current)" if campaign == current_name else ""
            campaign_list.append(f"• {campaign}{marker}")
    
        return "**Available Campaigns:**\n" + "\n".join(campaign_list)
  • Helper method in DnDStorage class that scans the campaigns directory and returns a list of campaign names by extracting JSON file stems.
    def list_campaigns(self) -> list[str]:
        """List all available campaigns."""
        campaigns_dir = self.data_dir / "campaigns"
        if not campaigns_dir.exists():
            return []
    
        return [f.stem for f in campaigns_dir.glob("*.json")]
  • The @mcp.tool decorator registers the list_campaigns function as an MCP tool with FastMCP, inferring input/output schemas from type annotations.
    @mcp.tool
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It states it lists campaigns but doesn't disclose behavioral traits like whether it returns all campaigns at once, requires authentication, has rate limits, or what the output format is. This leaves significant gaps for a tool with no annotations.

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 no wasted words. It's front-loaded with the core action and resource, making it highly concise and well-structured.

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 (simple list operation) but lack of annotations and output schema, the description is incomplete. It doesn't explain return values, pagination, or error handling, which are needed for a tool with no structured output documentation.

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 input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description doesn't add param info, which is appropriate, earning a baseline score of 4 for compensating with simplicity.

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 ('List') and resource ('all available campaigns'), making the purpose specific and understandable. It distinguishes from siblings like 'get_campaign_info' (detailed info) and 'load_campaign' (load specific campaign), though it doesn't explicitly mention these distinctions.

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 a loaded campaign, or differentiate from other list tools like 'list_characters' or 'list_quests' in 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