Skip to main content
Glama
study-flamingo

D&D MCP Server

load_campaign

Load a specific Dungeons & Dragons campaign by name to access its characters, NPCs, locations, quests, and session data for campaign management.

Instructions

Load a specific campaign.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesCampaign name to load

Implementation Reference

  • MCP tool handler for 'load_campaign'. Takes campaign name, loads it via storage, sets as current, and returns confirmation message.
    @mcp.tool
    def load_campaign(
        name: Annotated[str, Field(description="Campaign name to load")]
    ) -> str:
        """Load a specific campaign."""
        campaign = storage.load_campaign(name)
        return f"📖 Loaded campaign: '{campaign.name}'. Campaign is now active!"
  • Helper method in Storage class that loads the campaign JSON file, validates with Pydantic Campaign model, sets as current campaign, and returns it.
    def load_campaign(self, name: str) -> Campaign:
        """Load a specific campaign."""
        logger.info(f"📂 Attempting to load campaign: '{name}'")
        campaign_file = self._get_campaign_file(name)
        logger.debug(f"📂 Campaign file path: {campaign_file}")
    
        if not campaign_file.exists():
            logger.error(f"❌ Campaign file not found for '{name}'")
            raise FileNotFoundError(f"Campaign '{name}' not found")
    
        with open(campaign_file, 'r', encoding='utf-8') as f:
            data = json.load(f)
    
        self._current_campaign = Campaign.model_validate(data)
        logger.info(f"✅ Successfully loaded campaign '{name}'.")
        return self._current_campaign
  • Input schema for the tool: campaign name as string with description.
    name: Annotated[str, Field(description="Campaign name to load")]
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 of behavioral disclosure. 'Load' implies a read operation, but it doesn't specify if this retrieves data, sets state, requires permissions, or has side effects. Without annotations, this is a significant gap for understanding the tool's behavior.

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 and appropriately sized for the tool's complexity, earning its place 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?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what 'load' returns or how it differs from similar tools, leaving gaps in understanding the tool's full context and behavior for effective use.

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%, with the parameter 'name' documented as 'Campaign name to load.' The description adds no additional meaning beyond this, as it doesn't explain format, constraints, or examples. Baseline 3 is appropriate since the schema handles parameter documentation adequately.

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 states the tool's purpose as 'Load a specific campaign,' which is clear but vague. It specifies the verb 'load' and resource 'campaign,' but doesn't distinguish it from sibling tools like 'get_campaign_info' or 'list_campaigns,' leaving ambiguity about what 'load' entails compared to 'get' or 'list.'

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. With siblings like 'get_campaign_info' and 'list_campaigns,' the description lacks context on use cases, prerequisites, or exclusions, leaving the agent to infer usage without explicit direction.

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