Skip to main content
Glama
study-flamingo

D&D MCP Server

start_combat

Initiate a D&D combat encounter by specifying participants with initiative order to manage turn-based battles in your campaign.

Instructions

Start a combat encounter.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
participantsYesCombat participants with initiative order

Implementation Reference

  • The main handler function for the 'start_combat' tool. It takes a list of participant dictionaries, sorts them by initiative, updates the game state to enter combat mode with the initiative order and sets the first turn, then returns a formatted string with the initiative order and current turn.
    def start_combat( participants: Annotated[list[dict], Field(description="Combat participants with initiative order")] ) -> str: """Start a combat encounter.""" # Sort by initiative (highest first) initiative_order = sorted(participants, key=lambda x: x.get("initiative", 0), reverse=True) storage.update_game_state( in_combat=True, initiative_order=initiative_order, current_turn=initiative_order[0]["name"] if initiative_order else None ) order_text = "\n".join([ f"{i+1}. {p['name']} (Initiative: {p.get('initiative', 0)})" for i, p in enumerate(initiative_order) ]) return f"**Combat Started!**\n\n**Initiative Order:**\n{order_text}\n\n**Current Turn:** {initiative_order[0]['name'] if initiative_order else 'None'}"

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