Skip to main content
Glama

list_campaigns

Retrieve all available Dungeons & Dragons campaigns managed through the DM20 Protocol server for campaign selection and management.

Instructions

List all available campaigns.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The `DnDStorage.list_campaigns` method iterates through the campaign storage directory, detecting both legacy monolithic files and new split-format directories to return a sorted list of campaign names.
    def list_campaigns(self) -> list[str]:
        """List all available campaigns (both monolithic and split formats)."""
        campaigns_dir = self.data_dir / "campaigns"
        if not campaigns_dir.exists():
            return []
    
        campaigns = []
    
        # Find monolithic campaigns (JSON files)
        for f in campaigns_dir.glob("*.json"):
            campaigns.append(f.stem)
    
        # Find split campaigns (directories with campaign.json)
        for d in campaigns_dir.iterdir():
            if d.is_dir():
                campaign_file = d / "campaign.json"
                if campaign_file.exists():
                    campaigns.append(d.name)
    
        return sorted(campaigns)
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/Polloinfilzato/dm20-protocol'

If you have feedback or need assistance with the MCP directory API, please join our Discord server