Skip to main content
Glama
study-flamingo

D&D MCP Server

create_campaign

Create a new Dungeons & Dragons campaign by specifying its name, description, Dungeon Master, and setting details for campaign management.

Instructions

Create a new D&D campaign.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesCampaign name
descriptionYesBrief decription of the campaign, or a tagline
dm_nameNoDungeon Master name
settingNo Campaign setting - a full description of the setting of the campaign in markdown format, or the path to a `.txt` or `.md` file containing the same.

Implementation Reference

  • MCP tool handler for 'create_campaign'. Registers the tool via @mcp.tool decorator and implements the tool logic by delegating to storage.create_campaign, returning a success message.
    @mcp.tool
    def create_campaign(
        name: Annotated[str, Field(description="Campaign name")],
        description: Annotated[str, Field(description="Brief decription of the campaign, or a tagline")],
        dm_name: Annotated[str | None, Field(description="Dungeon Master name")] = None,
        setting: Annotated[str | Path | None, Field(description="""
            Campaign setting - a full description of the setting of the campaign in markdown format, or the path to a `.txt` or `.md` file containing the same.
            """)] = None,
    ) -> str:
        """Create a new D&D campaign."""
        campaign = storage.create_campaign(
            name=name,
            description=description,
            dm_name=dm_name,
            setting=setting
        )
        return f"🌟 Created campaign: '{campaign.name} and set as active 🌟'"
  • Core helper function in storage layer that instantiates a new Campaign model, initializes GameState, sets it as the current campaign, persists to JSON file, and returns the Campaign object.
    def create_campaign(self, name: str, description: str, dm_name: str | None = None, setting: str | Path | None = None) -> Campaign:
        """Create a new campaign."""
        logger.info(f"✨ Creating new campaign: '{name}'")
        game_state = GameState(campaign_name=name)
    
        campaign = Campaign(
            name=name,
            description=description,
            dm_name=dm_name,
            setting=setting,
            game_state=game_state
        )
    
        self._current_campaign = campaign
        self._save_campaign()
        logger.info(f"✅ Campaign '{name}' created and set as active.")
        return campaign
  • The @mcp.tool decorator registers the create_campaign function as an MCP tool.
    @mcp.tool
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'Create' implies a write/mutation operation but provides no information about permissions needed, whether this is idempotent, what happens on duplicate names, or what the response contains. Significant behavioral gaps remain unaddressed.

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 zero waste. It's front-loaded with the essential action and resource, making it immediately understandable 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?

For a creation/mutation tool with no annotations and no output schema, the description is inadequate. It doesn't address what happens after creation, what permissions are required, how to handle errors, or what the return value contains. The description should provide more context for this write operation.

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 already documents all parameters thoroughly. The description adds no additional parameter information beyond what's in the schema. Baseline 3 is appropriate when the schema does the heavy lifting for parameter documentation.

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 ('Create') and resource ('new D&D campaign'), making the purpose immediately understandable. It doesn't explicitly differentiate from siblings like 'load_campaign' or 'get_campaign_info', but the creation action is distinct enough for basic understanding.

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?

The description provides no guidance on when to use this tool versus alternatives like 'load_campaign' or 'list_campaigns'. There's no mention of prerequisites, dependencies, or typical workflow context for campaign creation.

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