rpg-mcp
A persistent, rules-enforced RPG MCP backend for AI-driven campaigns, exposing tools for discovery/events, worlds and maps, tactical combat, characters and parties, inventory, quests, narrative memory, math, and grand-strategy turns.
Discover tools with
search_toolsandload_tool_schema, and subscribe/unsubscribe toworldorcombatevent notifications.Generate, create, inspect, update, delete, patch, and preview procedurally generated worlds/maps; inspect regions/tiles; find or suggest POI locations.
Create and run D&D-style combat encounters: state tracking, attacks/healing/movement/spellcasting, initiative advancement, death saves, lair actions, terrain generation/patching, prop placement, distance/AoE calculation, and ASCII map rendering.
Manage characters and parties: CRUD, XP/level progression, party membership/roles/leaders, active character selection, party movement/position, and unassigned-character lookup.
Manage item templates and inventories: create/search/update/delete items, give/remove/transfer/equip/use items, and view detailed inventory.
Create/track quests and objectives, assign/complete quests, and grant rewards.
Store and retrieve long-term narrative memory via typed notes and aggregate narrative context for LLM prompts.
Roll dice and perform probability, algebra, and projectile-physics calculations.
Run grand-strategy and turn-based nation simulations: nations, alliances, territorial claims, turn resolution/status, batched actions, and ready marking.
Runs as a Node.js application with support for standalone binary distribution, providing the runtime environment for the MCP server.
Uses SQLite as the persistence layer for storing world state, entities, inventories, combat encounters, quests, and all simulation data with full transaction support and migration system.
Implemented in TypeScript with full type safety across the codebase, providing strongly-typed schemas and APIs for all simulation systems.
Employs Zod for runtime schema validation of all entities, actions, world state, and constraints, ensuring type safety at API boundaries and preventing invalid data mutations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@rpg-mcp I attack the goblin with my longsword"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mnehmos.rpg.mcp: Agentic Embodied Simulation Kernel
A rules-enforced RPG backend that turns any LLM into a game master who can't cheat.
What Is This? (Start Here)
You are the player. The AI is the dungeon master.
You talk to an AI (Claude, GPT, etc.) in natural language. You say things like "I attack the goblin" or "I search the room for traps." The AI narrates what happens and describes the world.
The difference from pure AI storytelling: This engine enforces the rules. When you attack, it actually rolls dice, checks armor class, calculates damage, and updates HP in a real database. The AI can't just decide you hit or miss—the math happens, and both you and the AI see the result.
What can you actually do?
Explore procedurally generated worlds with 28+ biome types
Fight enemies using D&D 5e-style combat (initiative, AC, damage rolls, death saves)
Cast spells with real slot tracking—if you're out of slots, you can't cast
Manage inventory with equipment slots, weight, and item properties
Complete quests with tracked objectives and rewards
Interact with NPCs who remember your conversations across sessions
Everything persists—close the game, come back tomorrow, your character is exactly where you left them
Who is this for?
Solo RPG players who want AI-driven adventures with mechanical integrity
People frustrated with AI RPGs that fall apart when you ask "wait, how much HP do I have?"
Developers building AI game integrations who need a reference implementation
How do I play?
Install the MCP server (see Installation below)
Connect it to Claude Desktop (or any MCP-compatible client)
Tell the AI: "Let's start a new game. Create a character for me."
Play naturally—the AI handles narration, the engine handles mechanics
Related MCP server: DMCP
v1.0 Release (January 2026)
81% Tool Reduction: 195 → 36 Tools (31 Consolidated + 5 Meta/Event)
This release consolidates 195 individual tools into 31 action-based tools plus 5 standalone meta/event tools using:
Action enums - Each tool handles multiple operations via an
actionparameterFuzzy matching - Typo-tolerant action matching with suggestions
Guiding errors - Clear feedback when actions don't match
Before: create_character, get_character, update_character, delete_character, list_characters...
After: character_manage with action-based CRUD, progression, and source-backed creation options
Key Metrics
Metric | Before | After | Change |
MCP Tools | 195 | 36 | 81.5% reduction |
Tests | 1,242 | 2,214 | +78% coverage |
Token overhead | ~50K | ~6-8K | 85% reduction |
Meta-Tools for Discovery
Four standalone tools support discovery and real-time events:
Tool | Purpose |
| Search tools by keyword, category, or capability |
| Load full parameter schema before first use |
| Subscribe to PubSub event topics (combat, quest, etc.) |
| Unsubscribe from event topics |
Architecture Philosophy
This engine implements the Event-Driven Agentic AI Architecture:
┌─────────────────────────────────────────────────────────────────────────────────────────┐
│ │
│ EVENT │
│ │ │
│ ▼ │
│ ┌───────────┐ ┌───────────┐ ┌────────────┐ ┌───────────┐ ┌─────────┐ │
│ │ OBSERVE │ ──▶ │ ORIENT │ ──▶ │ DECIDE │ ──▶ │ ACT │ ──▶ │VALIDATE │ │
│ │ │ │ │ │ │ │ │ │ │ │
│ │ MCP Read │ │ LLM Brain │ │Orchestrator│ │ MCP Write │ │ Engine │ │
│ │ Tools │ │ Analyze │ │ Plan │ │ Tools │ │ Rules │ │
│ └───────────┘ └───────────┘ └────────────┘ └───────────┘ └────┬────┘ │
│ ▲ │ │
│ │ │ │
│ └───────────────────────────────────────────────────────────────────────┘ │
│ WORLD STATE │
│ (updates & loops) │
│ │
└─────────────────────────────────────────────────────────────────────────────────────────┘The Embodiment Model
Biological System | RPG-MCP Component | Role |
Brain | LLM Agent (external) | Strategic reasoning, planning, interpretation |
Nervous System | Engine + Orchestrator | Validates intent, enforces constraints, routes actions |
Reflex Arc | Constraint Validator | Blocks impossible actions before execution |
Sensory Organs | Observation Tools |
|
Muscles | Action Tools |
|
Environment | World State + Physics | SQLite-persisted, deterministic, forkable reality |
Key invariant: LLMs propose intentions. The engine validates and executes. LLMs never directly mutate world state.
Consolidated Tools Reference (31 Tools)
Character & Party
Tool | Actions | Description |
| create, get, update, delete, list, options, add_xp, level_up | Character CRUD plus pinned SRD creation mechanics |
| create, get, update, delete, add_member, remove_member, set_leader, context | Party management and member operations |
Combat System
Tool | Actions | Description |
| create, get, end, load, advance, death_save, lair_action, add_participant, remove_participant | Encounter lifecycle and initiative |
| attack, cast, move, dash, dodge, disengage, help, ready | Combat actions with full D&D 5e rules |
| get_terrain, set_terrain, get_positions, calculate_aoe | Tactical grid and terrain management |
Inventory & Economy
Tool | Actions | Description |
| create, get, update, delete, list, search, catalog_search, catalog_get, materialize | Custom items plus pinned SRD lookup/materialization |
| give, remove, transfer, equip, unequip, use | Inventory operations between characters |
| create, get, list, loot, harvest, advance_decay, cleanup | Death and loot mechanics |
| steal, check_stolen, check_recognition, report | Theft with heat tracking |
World & Spatial
Tool | Actions | Description |
| generate, get, update, list, delete | Procedural world generation |
| get_overview, get_region, patch, preview | Map queries and modifications |
| look, generate, update, get_exits, move, list, network_create, network_get, network_list | Dungeon navigation and room networks |
Quests & NPCs
Tool | Actions | Description |
| create, get, list, assign, complete, fail, abandon, add_objective, update_objective | Quest lifecycle management |
| get_relationship, update_relationship, record_memory, get_history, interact | NPC memory and social interactions |
| create, list, get_affecting, process, remove, expire | Area effects and buffs/debuffs |
Magic & Rest
Tool | Actions | Description |
| use, create, identify, get_dc, get_details | Scroll mechanics |
| long_rest, short_rest | HP and spell slot recovery |
| check_save, break, get_state, check_duration | Spell concentration tracking |
Utility & Meta
Tool | Actions | Description |
| create, get, list, update, delete, reveal, check_conditions | DM secrets with reveal conditions |
| add, search, update, get, delete, get_context | Story notes and session history |
| stunt, apply_effect, get_effects, remove_effect, process_triggers, advance_durations, synthesize, get_spellbook | Rule of Cool and custom effects |
| dice_roll, probability, algebra, physics | Dice and calculations |
| create_nation, get_state, propose_alliance, claim_region | Grand strategy simulation |
| init, get_status, submit_actions, mark_ready, poll_results | Async turn management |
| spawn_character, spawn_location, spawn_encounter, spawn_preset_location, spawn_tactical | Entity and encounter spawning |
| initialize_session, get_context | Session state management |
| travel, loot, rest | Party movement and field actions |
| create_characters, create_npcs, distribute_items, execute_workflow | Bulk operations |
LLM-Driven NPCs (Agents)
Tool | Actions | Description |
| create, get, list, update, delete, resume, health, budget, set_slice, remove_slice, toggle_slice, list_slices, narrate, broadcast, preview_prompt, add_secret, list_secrets, remove_secret, add_journal, get_journal, invoke, replay | Bind an LLM (OpenAI / OpenRouter) to a character as an autonomous NPC mind. Modular prompt slices (persona/directive/secrets/narrative_feed/recent/character_state), private journal, audit-logged calls, circuit breaker, plain-text intent declarations for DM dispatch. Auto-invokes on initiative when |
Installation
Option 1: npm (Recommended)
npm install mnehmos.rpg.mcpOption 2: Standalone Binaries
Download pre-built binaries from Releases:
# Windows
.\rpg-mcp-win.exe
# macOS (Intel)
chmod +x rpg-mcp-macos && ./rpg-mcp-macos
# macOS (Apple Silicon)
chmod +x rpg-mcp-macos-arm64 && ./rpg-mcp-macos-arm64
# Linux
chmod +x rpg-mcp-linux && ./rpg-mcp-linuxOption 3: From Source
git clone https://github.com/Mnehmos/mnehmos.rpg.mcp.git
cd mnehmos.rpg.mcp
npm install
npm run build
npm test # 2214 tests should passMCP Client Configuration
Claude Desktop / MCP Clients:
{
"mcpServers": {
"rpg-mcp": {
"command": "npx",
"args": ["-y", "-p", "mnehmos.rpg.mcp@1.0.3", "mnehmos-rpg-mcp"]
}
}
}Security note: pin an explicit package version in args to avoid unintentionally running a newly published release.
Using Binary:
{
"mcpServers": {
"rpg-mcp": {
"command": "path/to/rpg-mcp-win.exe"
}
}
}Core Systems
Combat & Encounters
Initiative tracking with advantage/disadvantage
Spatial combat with grid positioning and collision
Opportunity attacks with reaction economy
Death saving throws (D&D 5e rules)
Damage resistance/vulnerability/immunity
Legendary creatures with lair actions and legendary resistances
Encounter presets - Pre-balanced encounters by party level
Magic System
15+ SRD spells (Magic Missile, Fireball, Cure Wounds, etc.)
Spell slot tracking with class-based progression
Warlock pact magic with short rest recovery
Concentration tracking
Anti-hallucination validation - LLMs cannot cast spells they don't know
Theft & Economy
Stolen item tracking with heat levels (burning → cold)
Witness recording for theft detection
Fence NPCs with buy rates and heat capacity
Item recognition - original owners detect their stolen goods
NPC Memory
Relationship tracking (familiarity + disposition)
Conversation memory with importance levels
Context injection for LLM prompts
Interaction history across sessions
Improvisation Engine
Rule of Cool stunts - "I kick the brazier into the zombies"
Custom effects - Divine boons, curses, transformations
Arcane synthesis - Dynamic spell creation with wild surge risk
Project Structure
src/
├── schema/ # Zod schemas: entities, actions, world state
├── engine/
│ ├── combat/ # Encounters, initiative, damage, death saves
│ ├── spatial/ # Grid, collision, movement
│ ├── worldgen/ # Procedural generation (28+ biomes)
│ └── strategy/ # Nation simulation
├── data/
│ ├── creature-presets.ts # 1100+ creature templates
│ ├── encounter-presets.ts # 50+ balanced encounters
│ └── items/ # PHB weapons, armor, magic items
├── storage/
│ ├── migrations.ts # SQLite schema definitions
│ └── repos/ # Repository pattern for persistence
├── server/
│ ├── consolidated/ # 31 action-based tools
│ ├── handlers/ # Extracted handler implementations (combat, spatial)
│ ├── consolidated-registry.ts # Tool registration
│ ├── meta-tools.ts # search_tools, load_tool_schema
│ └── events.ts # PubSub + MCP notification streaming
└── utils/
├── fuzzy-enum.ts # Action matching with typo tolerance
└── schema-shorthand.ts # Token-efficient parsing
tests/ # 2214 tests mirroring src/ structure
docs/ # White paper and LLM spatial guideDesign Principles
LLMs propose, never execute The brain suggests; the nervous system validates.
All action is tool-mediated No direct world mutation. Every change flows through MCP tools.
Validation precedes observation Act → Validate → Observe. The reflex arc pattern.
Deterministic outcomes Same inputs → same outputs. Always reproducible.
Schema-driven everything Zod validates all data at boundaries. Type safety end-to-end.
Anti-hallucination by design LLMs cannot cast spells they don't know or claim damage they didn't roll.
Token efficiency 31 consolidated tools with action routing reduce context overhead by 85%.
Guiding errors Invalid actions return suggestions, not just failures.
Tool-surface policy
The consolidated MCP contracts are the public tool surface. The older
world-map helpers in src/server/tools.ts are retained in compatibility mode
as an internal adapter because world_map still delegates to their validated
world persistence and patch implementation. New public tools must be added to
the consolidated contracts, and the adapter matrix is enforced by
src/server/legacy-surface-policy.ts.
Test Coverage
npm test
# 2425 tests passing, 7 skipped
# 148 test files
# Coverage across all 36 tools (31 consolidated + 5 meta/event)Contributing
Contributions welcome! Please:
Fork the repo
Create a feature branch (
git checkout -b feature/your-feature)Write tests for new functionality
Follow existing code style (TypeScript + Zod + tests)
Submit a pull request
Roadmap
Full spellcasting system with validation
Theft and fence economy
Corpse and loot mechanics
NPC memory and relationships
Improvisation engine
Tool consolidation (195 → 36)
Fuzzy action matching
Preset systems (creatures, encounters, locations)
WebSocket real-time subscriptions
Dialogue tree system
Cover mechanics in combat
Quest chains with prerequisites
License
ISC — Use freely, attribution appreciated.
Related
Quest Keeper AI — Desktop AI dungeon master using this engine
Documentation
CLAUDE.md - Development instructions
docs/WHITE_PAPER.md - Design philosophy and architecture
docs/LLMSpatialGuide.md - LLM spatial navigation guide
docs/ADR-005-unified-ownership-architecture.md - Target ownership architecture
docs/EXECUTION-PRIORITIES-unified-ownership.md - Outcome-based execution priorities
Available Tools
196 toolsadd_narrative_noteC
Create a typed narrative note (plot thread, canonical moment, NPC voice, foreshadowing, or session log). Used to build long-term narrative memory.
Inputs: worldId (required), type (required), content (required), metadata, +6 more.
add_party_memberC
Add a character to a party with role (leader, member, companion, hireling, prisoner, mount).
Inputs: partyId (required), characterId (required), role, position, +2 more.
add_xpC
Add experience points to a character. Checks for level-up thresholds.
Inputs: characterId (required), amount (required), sessionId.
advance_corpse_decayC
Process corpse decay when game time advances.
Inputs: hoursAdvanced (required), sessionId.
advance_effect_durationsB
Advance round-based effect durations. Call at end of each round.
Inputs: target_id (required), target_type (required), rounds, sessionId.
advance_heat_decayC
Process heat decay for all stolen items when game time advances.
Inputs: daysAdvanced (required), sessionId.
advance_turnC
Advance to the next combatant's turn.
Inputs: encounterId (required), sessionId.
algebra_simplifyD
Simplify algebraic expressions.
Inputs: expression (required), exportFormat, sessionId.
algebra_solveC
Solve algebraic equations.
Inputs: equation (required), variable, exportFormat, sessionId.
apply_custom_effectB
Apply a custom effect (divine boon, curse, transformation) to a target.
Power Level Guidelines: 1: Hours duration, +1/-1 bonus, minor condition (Lucky charm) 2: Days duration, +2/-2 bonus, advantage/disadvantage (Battle blessing) 3: Weeks duration, +3/-3 bonus, resistance/vulnerability (Champion's mantle) 4: Months duration, +5/-5 bonus, immunity, extra actions (Avatar's grace) 5: Permanent, reality-warping effects (Demigod status)
Mechanic Types:
attack_bonus, damage_bonus, ac_bonus, saving_throw_bonus, skill_bonus
advantage_on, disadvantage_on
damage_resistance, damage_vulnerability, damage_immunity
damage_over_time, healing_over_time
extra_action, prevent_action, movement_modifier
sense_granted, sense_removed, speak_language, cannot_speak
custom_trigger
Example: { "target_id": "char-123", "target_type": "character", "name": "Blessing of the Sun God", "description": "Golden light surrounds you, burning undead on contact", "source": { "type": "divine", "entity_name": "Pelor" }, "category": "boon", "power_level": 3, "mechanics": [ { "type": "damage_bonus", "value": 2, "condition": "against undead" }, { "type": "damage_resistance", "value": "radiant" } ], "duration": { "type": "days", "value": 7 }, "triggers": [{ "event": "on_attack", "condition": "against undead" }], "removal_conditions": [{ "type": "dispelled", "difficulty_class": 15 }] }
Inputs: target_id (required), target_type (required), name (required), description (required), +10 more.
apply_map_patchA
Apply DSL commands to modify the world map. Use find_valid_poi_location first for structure placement. Example: { "worldId": "id", "script": "ADD_STRUCTURE..." }
Inputs: worldId (required), script (required), sessionId.
assign_questC
Assign a quest to a character.
Inputs: characterId (required), questId (required), sessionId.
attempt_arcane_synthesisA
Attempt to create a spell on the fly through Arcane Synthesis.
DC Calculation: Base DC = 10 + (Spell Level × 2)
Modifiers: +2 if in combat (encounter_id provided) +3 if novel effect (no similar spell known) -1 per 100gp of material component (max -5) -2 if related spell known -2 if school specialization -3 if near ley line/magical nexus -2 if celestial event (blood moon, eclipse) +2 if desperation/urgency
Outcomes:
Mastery (nat 20 OR beat DC by 10+): Spell works AND permanently learned
Success (beat DC): Spell works this time only
Fizzle (within 5 of DC): Slot consumed, no effect, minor mishap
Backfire (fail by 5-10): Spell damages caster (level × d6)
Catastrophic (nat 1 OR fail by 10+): WILD SURGE!
Spell Level Damage Guidelines: Level 1: Single 3d6, AoE 2d6 (10ft) Level 2: Single 4d6, AoE 3d6 (15ft) Level 3: Single 8d6, AoE 6d6 (20ft) Level 4: Single 10d6, AoE 8d6 (30ft) Level 5+: Progressively more powerful
Example: { "caster_id": "wizard-1", "caster_type": "character", "narrative_intent": "I weave shadows together to blind the orc chieftain", "proposed_name": "Shadow Blind", "estimated_level": 2, "school": "illusion", "effect_specification": { "type": "status", "condition": "blinded", "condition_duration": "1 minute" }, "targeting": { "type": "single", "range": 60 }, "saving_throw": { "ability": "wisdom", "effect_on_save": "negates" }, "components": { "verbal": true, "somatic": true }, "concentration": true, "duration": "1 minute" }
Inputs: caster_id (required), caster_type (required), narrative_intent (required), estimated_level (required), +13 more.
batch_create_charactersA
Create multiple characters at once. Perfect for generating a party, a squad of enemies, or a group of NPCs.
Maximum 20 characters per call. Each character needs at minimum a name.
Example - Create a 4-person adventuring party: { "characters": [ { "name": "Valeros", "class": "Fighter", "race": "Human" }, { "name": "Kyra", "class": "Cleric", "race": "Human" }, { "name": "Merisiel", "class": "Rogue", "race": "Elf" }, { "name": "Ezren", "class": "Wizard", "race": "Human" } ] }
Example - Create enemy goblins: { "characters": [ { "name": "Goblin Warrior 1", "class": "Warrior", "race": "Goblin", "characterType": "enemy", "hp": 7, "ac": 15 }, { "name": "Goblin Warrior 2", "class": "Warrior", "race": "Goblin", "characterType": "enemy", "hp": 7, "ac": 15 }, { "name": "Goblin Boss", "class": "Champion", "race": "Goblin", "characterType": "enemy", "hp": 21, "ac": 17 } ] }
Inputs: characters (required), sessionId.
batch_create_npcsB
Generate NPCs for a settlement or location. Creates a group of NPCs with specified roles.
Roles are flexible strings - use any profession like "blacksmith", "innkeeper", "guard captain", etc.
Example - Populate a village: { "locationName": "Thornwood Village", "npcs": [ { "name": "Marta", "role": "Innkeeper", "race": "Human" }, { "name": "Grom", "role": "Blacksmith", "race": "Dwarf" }, { "name": "Elara", "role": "Herbalist", "race": "Half-Elf" }, { "name": "Captain Vance", "role": "Guard Captain", "race": "Human" } ] }
Inputs: npcs (required), locationName, sessionId.
batch_distribute_itemsA
Give items to multiple characters at once. Perfect for starting equipment, loot distribution, or quest rewards.
Example - Give starting equipment: { "distributions": [ { "characterId": "char-1", "items": ["Longsword", "Chain Mail", "Shield"] }, { "characterId": "char-2", "items": ["Staff", "Spellbook", "Component Pouch"] }, { "characterId": "char-3", "items": ["Shortbow", "Leather Armor", "Thieves' Tools"] } ] }
Example - Distribute loot: { "distributions": [ { "characterId": "party-leader", "items": ["Gold Ring", "Healing Potion"] }, { "characterId": "wizard", "items": ["Scroll of Fireball", "Wand of Magic Missiles"] } ] }
Inputs: distributions (required), sessionId.
break_concentrationA
Manually break a character's concentration on a spell. Use this for voluntary breaks, incapacitation, death, or when casting a new concentration spell.
Inputs: characterId (required), reason (required), damageAmount, sessionId.
calculate_aoeA
Calculate which tiles and participants are affected by an Area of Effect spell or ability. Supports circle (Fireball), cone (Burning Hands), and line (Lightning Bolt) shapes.
Example - Fireball (20ft radius circle): { "encounterId": "encounter-1", "shape": "circle", "origin": { "x": 10, "y": 10 }, "radius": 4 }
Example - Burning Hands (15ft cone): { "encounterId": "encounter-1", "shape": "cone", "origin": { "x": 5, "y": 5 }, "direction": { "x": 1, "y": 0 }, "length": 3, "angle": 90 }
Example - Lightning Bolt (100ft line): { "encounterId": "encounter-1", "shape": "line", "origin": { "x": 0, "y": 5 }, "direction": { "x": 1, "y": 0 }, "length": 20 }
Inputs: encounterId (required), shape (required), origin (required), radius, +4 more.
check_automatic_concentration_breakC
Check if concentration should automatically break due to death or incapacitating conditions (unconscious, stunned, paralyzed, petrified).
Inputs: characterId (required), sessionId.
check_concentration_durationA
Check if a character's concentration has exceeded its maximum duration. Automatically breaks concentration if duration expired.
Inputs: characterId (required), currentRound (required), sessionId.
check_concentration_saveA
Roll a Constitution saving throw to maintain concentration after taking damage. DC = 10 or half damage (whichever is higher). Automatically breaks concentration if save fails.
Inputs: characterId (required), damageAmount (required), sessionId.
check_for_leaksC
Check if text contains potential secret leaks based on leak patterns.
Inputs: worldId (required), text (required), sessionId.
check_item_recognitionA
Check if NPC recognizes stolen item. Owner always recognizes; guards check vs heat/bounty.
Inputs: npcId (required), characterId (required), itemId (required), sessionId.
check_item_stolenC
Check if an item is stolen and get its provenance details.
Inputs: itemId (required), sessionId.
check_reveal_conditionsC
Check if any secrets should be revealed based on a game event.
Inputs: worldId (required), event (required), sessionId.
check_scroll_usabilityA
Check if a character can use a specific scroll without consuming it. Returns whether a check is required and the DC.
Inputs: characterId (required), scrollItemId (required), sessionId.
check_stolen_items_on_characterB
Check if a character carries stolen items. Useful for guard searches.
Inputs: characterId (required), checkerId, sessionId.
claim_regionC
Assert a territorial claim on a region.
Inputs: nationId (required), regionId (required), justification, sessionId.
cleanup_corpsesB
Remove corpses that have fully decayed (state = gone).
Inputs: sessionId.
complete_objectiveC
Mark an objective as fully completed.
Inputs: questId (required), objectiveId (required), sessionId.
complete_questC
Mark a quest as completed and grant rewards.
Inputs: characterId (required), questId (required), sessionId.
create_auraB
Create a new aura effect centered on a character (e.g., Spirit Guardians, Aura of Protection). Auras move with their owner and affect targets within radius. Optionally requires concentration.
Inputs: ownerId (required), spellName (required), spellLevel (required), radius (required), +8 more.
create_characterA
Create a new character. Only name is required - everything else has sensible defaults.
Character types:
pc: Player character (default)
npc: Non-player character (ally or neutral)
enemy: Hostile creature
neutral: Non-hostile, non-ally
Class and race can be ANY string - use standard D&D classes/races or create custom ones. Stats can be any positive integer (not limited to 3-18).
Example (minimal - just name): { "name": "Mysterious Stranger" }
Example (full): { "name": "Valeros", "class": "Fighter", "race": "Human", "hp": 20, "maxHp": 20, "ac": 18, "level": 1, "stats": { "str": 16, "dex": 14, "con": 14, "int": 10, "wis": 12, "cha": 10 }, "characterType": "pc" }
Example (custom class/race): { "name": "Whiskers", "class": "Chronomancer", "race": "Mousefolk", "stats": { "str": 6, "dex": 18, "con": 10, "int": 16, "wis": 14, "cha": 12 } }
Inputs: name (required), class, race, background, +19 more.
create_corpseC
Manually create a corpse for a dead character.
Inputs: characterId (required), characterName (required), characterType (required), creatureType, +6 more.
create_encounterA
Create a combat encounter with positioned combatants and terrain.
📋 WORKFLOW:
Generate terrain (obstacles, water, difficult)
Add props (buildings, trees, cover)
Place party (safe starting positions)
Place enemies (tactical positions)
⚠️ CRITICAL VERTICALITY RULES:
z=0 means "standing on surface at (x,y)" - EVEN ON TOP OF OBSTACLES
If obstacles exist at (15,3), placing a unit at {x:15,y:3,z:0} = STANDING ON the obstacle
z>0 = FLYING/LEVITATING only. Creatures without flight condition WILL FALL!
Do NOT use z values to represent "standing on high ground"
✅ CORRECT: Goblin on rock at (15,3) → position: {x:15, y:3, z:0} ❌ WRONG: Goblin on rock → position: {x:15, y:3, z:25} (will fall!)
🏔️ TERRAIN GENERATION RULES:
Obstacles should CLUSTER to form hills/mountains/caverns
Include SLOPES: Adjacent tiles stepping down to ground level
Isolated cliffs only if intentionally inaccessible
Water must CONNECT (rivers/streams/pools), never isolated tiles
📐 PATTERN TEMPLATES (USE THESE!):
RIVER VALLEY (cliffs on sides, river in middle): obstacles: ["5,0","5,1","5,2",...,"5,19"] (west cliff), ["13,0","13,1","13,2",...,"13,19"] (east cliff) water: ["8,0","9,0","10,0","8,1","9,1","10,1",...] (3-wide river at x=8,9,10)
CANYON (two parallel walls): obstacles: ["0,5","1,5","2,5",...,"9,5"] (north wall), ["0,15","1,15","2,15",...,"9,15"] (south wall)
Example: { "seed": "battle-1", "terrain": { "obstacles": ["10,5", "11,5", "10,6"], "water": ["5,10", "5,11", "6,11"] }, "participants": [ {"id": "hero-1", "name": "Valeros", "hp": 20, "maxHp": 20, "initiativeBonus": 2, "position": {"x": 15, "y": 15, "z": 0}}, {"id": "goblin-1", "name": "Goblin Archer", "hp": 7, "maxHp": 7, "initiativeBonus": 1, "position": {"x": 10, "y": 5, "z": 0}, "isEnemy": true} ] }
Inputs: seed (required), participants (required), terrain, sessionId.
create_item_templateC
Define a new type of item (e.g., "Iron Sword").
Inputs: name (required), type (required), description, weight, +3 more.
create_loot_tableC
Create a loot table for a creature type.
Inputs: name (required), creatureTypes (required), crRange, guaranteedDrops, +4 more.
create_nationC
Create a new nation in the world.
Inputs: worldId (required), name (required), leader (required), ideology (required), +5 more.
create_partyB
Create a new party (adventuring group).
Example: { "name": "The Fellowship", "description": "Nine companions on a quest to destroy the One Ring", "worldId": "middle-earth-id", "initialMembers": [ { "characterId": "gandalf-id", "role": "leader" }, { "characterId": "frodo-id", "role": "member" } ] }
Inputs: name (required), description, worldId, initialMembers, +1 more.
create_questC
Define a new quest in the world.
Inputs: worldId (required), name (required), description (required), status (required), +5 more.
create_secretB
Create a DM-only secret (NPC, location, item, plot). AI narrates around it without revealing.
Inputs: worldId (required), type (required), category (required), name (required), +9 more.
create_spell_scrollB
Create a new spell scroll item template (DM tool). The scroll can then be given to characters via give_item.
Inputs: spellName (required), spellLevel (required), scrollDC, scrollAttackBonus, +4 more.
create_worldC
Create a new world in the database with name, seed, and dimensions. Example: { "name": "New World", "seed": "abc", "width": 50, "height": 50 }
Inputs: name (required), seed (required), width (required), height (required), +2 more.
delete_characterC
Delete a character by ID.
Inputs: id (required), sessionId.
delete_itemC
Delete an item template from the database.
Inputs: itemId (required), sessionId.
delete_narrative_noteA
Delete a narrative note. Use sparingly - prefer archiving via status update.
Inputs: noteId (required), sessionId.
delete_partyB
Delete a party. Members become unassigned (not deleted).
Inputs: partyId (required), sessionId.
delete_secretC
Delete a secret from the world.
Inputs: secretId (required), sessionId.
delete_worldC
Delete a world by ID.
Inputs: id (required), sessionId.
dice_rollA
Roll dice using standard notation. Supports: basic rolls (2d6+3), drop lowest (4d6dl1), drop highest (4d6dh1), keep lowest (2d20kl1), keep highest (2d20kh1), advantage/disadvantage, and exploding dice (2d6!).
Inputs: expression (required), seed, exportFormat, sessionId.
end_encounterC
End the current combat encounter.
Inputs: encounterId (required), sessionId.
equip_itemC
Equip an item in a specific slot.
Inputs: characterId (required), itemId (required), slot (required), sessionId.
execute_combat_actionB
Execute a combat action (attack, heal, move, cast_spell, etc.).
Examples: { "action": "attack", "actorId": "hero-1", "targetId": "goblin-1", "attackBonus": 5, "dc": 12, "damage": 6 }
{ "action": "heal", "actorId": "cleric-1", "targetId": "hero-1", "amount": 8 }
{ "action": "move", "actorId": "hero-1", "targetPosition": { "x": 5, "y": 3 } }
{ "action": "disengage", "actorId": "hero-1" }
{ "action": "cast_spell", "actorId": "wizard-1", "spellName": "Fireball", "targetId": "goblin-1", "slotLevel": 3 }
Inputs: encounterId (required), action (required), actorId (required), targetId, +9 more.
execute_lair_actionB
Execute a lair action at initiative 20 when isLairActionPending is true. Apply environmental effects to targets.
Inputs: encounterId (required), actionDescription (required), targetIds, damage, +4 more.
execute_workflowB
Execute a workflow from a template or inline definition.
Workflows automate multi-step operations like creating a full party, setting up an encounter, or populating a village.
Example - Execute starter_party template: { "template": "starter_party", "params": { "partyName": "The Brave Ones" } }
Example - Execute inline workflow: { "workflow": { "name": "Quick Fight", "description": "Setup a quick goblin fight", "steps": [ { "name": "create_goblins", "tool": "batch_create_characters", "params": { "characters": [ { "name": "Goblin 1", "characterType": "enemy" }, { "name": "Goblin 2", "characterType": "enemy" } ] } } ] } }
Inputs: no named parameters.
expire_aurasC
Check for and remove any auras that have exceeded their duration.
Inputs: currentRound (required), sessionId.
find_valid_poi_locationB
Find terrain-valid locations for placing a POI/structure. Returns ranked candidates by suitability.
Inputs: worldId (required), poiType (required), nearWater, preferredBiomes, +5 more.
generate_lootC
Generate loot for a corpse based on creature type and CR.
Inputs: corpseId (required), creatureType (required), cr, sessionId.
generate_room_nodeC
Create a persistent room with immutable description. Optionally links to previous room.
Inputs: name (required), baseDescription (required), biomeContext (required), atmospherics, +3 more.
generate_terrain_patchA
Generate a terrain patch using procedural noise or preset patterns. Much easier than placing individual tiles - LLM describes the area and this tool generates it.
Biome Presets:
forest: Trees (climbable props), undergrowth (difficult terrain), paths
cave: Rocky walls (obstacles), stalactites (props), pools (water)
village: Buildings (obstacle clusters), roads (clear), market stalls (props)
dungeon: Walls (obstacles), rubble (difficult), traps (hazards)
swamp: Water, lily pads (props), dead trees, difficult terrain
battlefield: Barricades, craters (difficult), debris (props)
Density: 0.1 (sparse) to 1.0 (dense)
Example - Generate a forest clearing: { "encounterId": "encounter-1", "biome": "forest", "origin": { "x": 10, "y": 10 }, "width": 20, "height": 20, "density": 0.4, "seed": "goblin-ambush", "clearCenter": true }
Example - Dungeon room: { "encounterId": "encounter-1", "biome": "dungeon", "origin": { "x": 0, "y": 0 }, "width": 15, "height": 12, "density": 0.6, "seed": "throne-room" }
Inputs: encounterId (required), biome (required), origin (required), width (required), +6 more.
generate_terrain_patternA
Generate terrain using a pattern template. ONE CALL generates entire layout.
PATTERNS:
maze: Full procedural maze (corridors & walls) - USE THIS FOR MAZES
maze_rooms: Maze with open chambers/rooms connected by corridors
river_valley: Cliff walls on east/west with river in center
canyon: Parallel walls east-west with pass between
arena: Circular wall enclosing fighting area
mountain_pass: Narrowing corridor toward center
MAZE EXAMPLE (100x100 in ONE call): { "encounterId": "enc-1", "pattern": "maze", "origin": { "x": 0, "y": 0 }, "width": 100, "height": 100, "seed": "maze-runner-001" }
MAZE WITH ROOMS: { "pattern": "maze_rooms", "width": 100, "height": 100, "roomCount": 8 }
Inputs: encounterId (required), pattern (required), origin, width, +5 more.
generate_worldC
Generate a new procedural RPG world with seed, width, and height parameters. Example: { "seed": "atlas", "width": 50, "height": 50 }
Inputs: seed (required), width (required), height (required), landRatio, +3 more.
get_active_aurasB
List all currently active auras and their properties.
Inputs: sessionId.
get_auras_affecting_characterC
Check which auras are currently affecting a specific character based on their position.
Inputs: encounterId (required), characterId (required), sessionId.
get_characterC
Retrieve a character by ID.
Inputs: id (required), sessionId.
get_concentration_stateB
Query what spell a character is currently concentrating on, including duration and targets.
Inputs: characterId (required), sessionId.
get_conversation_historyC
Get conversation history between PC and NPC. Filter by minimum importance level.
Inputs: characterId (required), npcId (required), minImportance, limit, +1 more.
get_corpseC
Get details about a corpse, including loot and harvestable resources.
Inputs: corpseId (required), sessionId.
get_corpse_by_characterB
Get the corpse of a specific character (if they are dead).
Inputs: characterId (required), sessionId.
get_corpse_inventoryC
Get the inventory of a corpse (items available to loot).
Inputs: corpseId (required), sessionId.
get_custom_effectsC
Get all active effects on a target, with optional filtering.
Inputs: target_id (required), target_type (required), category, source_type, +2 more.
get_encounter_stateC
Get the current state of the active combat encounter.
Inputs: encounterId (required), sessionId.
get_event_historyC
Get recent event history with optional filters.
Inputs: limit, eventType, sourceType, includeConsumed, +1 more.
get_fenceC
Get information about a fence NPC.
Inputs: npcId (required), sessionId.
get_inventoryC
List all items in a character's inventory.
Inputs: characterId (required), sessionId.
get_inventory_detailedC
Get detailed inventory with full item info, sorted by equipped/type/name.
Inputs: characterId (required), sessionId.
get_itemC
Get details of a specific item by ID.
Inputs: itemId (required), sessionId.
get_level_progressionC
Get level progression details including XP needed for next level.
Inputs: level (required), sessionId.
get_loot_tableC
Get a loot table by ID or creature type.
Inputs: id, creatureType, cr, sessionId.
get_narrative_contextB
Aggregates comprehensive narrative context (Character, World, Combat, Secrets) for the LLM system prompt.
Inputs: worldId (required), characterId, encounterId, maxEvents, +1 more.
get_narrative_context_notesC
Retrieve aggregated narrative context for LLM prompt injection. Returns active plot threads, recent canonical moments, NPC voices, and pending foreshadowing.
Inputs: worldId (required), includeTypes, maxPerType, statusFilter, +2 more.
get_narrative_noteC
Retrieve a single narrative note by ID.
Inputs: noteId (required), sessionId.
get_nation_stateC
Get private state for a specific nation (LLM only).
Inputs: nationId (required), sessionId.
get_npc_contextB
Get relationship + conversation history for LLM NPC dialogue prompts.
Inputs: characterId (required), npcId (required), memoryLimit, sessionId.
get_npc_relationshipC
Get relationship status (familiarity, disposition) between a PC and NPC.
Inputs: characterId (required), npcId (required), sessionId.
get_parties_in_regionB
Get all parties within a certain distance of a coordinate (useful for finding nearby groups).
Inputs: worldId (required), x (required), y (required), radiusSquares, +1 more.
get_partyC
Get a party with all member details, leader, and active character info.
Inputs: partyId (required), sessionId.
get_party_contextC
Get party context for LLM prompts. Verbosity: minimal (~150 tokens), standard (~400), or detailed (~800).
Inputs: partyId (required), verbosity, sessionId.
get_party_membersC
Get all members of a party with their character details.
Inputs: partyId (required), sessionId.
get_party_positionC
Get the current position of a party on the world map.
Inputs: partyId (required), sessionId.
get_pending_event_countC
Get the count of unread events in the inbox.
Inputs: sessionId.
get_questC
Get a single quest by ID with full details.
Inputs: questId (required), sessionId.
get_quest_logC
Get the quest log for a character.
Inputs: characterId (required), sessionId.
get_recent_interactionsC
Get recent conversation memories across all NPCs for context building.
Inputs: characterId (required), limit, sessionId.
get_region_mapC
Returns detailed information about a specific region including its tiles and structures.
Inputs: worldId (required), regionId (required), sessionId.
get_room_exitsA
Get all exits from a room. Use look_at_surroundings for perception-filtered exits.
Inputs: roomId (required), sessionId.
get_scroll_detailsC
Get detailed information about a spell scroll item.
Inputs: scrollItemId (required), sessionId.
get_scroll_use_dcB
Calculate the DC required to use a spell scroll. Returns DC and whether a check is required based on character class/level.
Inputs: characterId (required), scrollItemId (required), sessionId.
get_secretC
Get a single secret by ID (DM view only).
Inputs: secretId (required), sessionId.
get_secrets_for_contextC
Get active secrets formatted for LLM context injection with DO NOT REVEAL instructions.
Inputs: worldId (required), sessionId.
get_strategy_stateB
Get the world state from the perspective of a specific nation (applies Fog of War for Grand Strategy).
Inputs: worldId (required), viewerNationId (required), sessionId.
get_synthesized_spellsC
Get all spells a character has permanently learned through Arcane Synthesis.
Inputs: character_id (required), school, sessionId.
get_templateB
Get details of a specific workflow template including full schema and parameters.
Inputs: name (required), sessionId.
get_turn_statusC
Check current turn state and which nations are ready
Inputs: worldId (required), sessionId.
get_unassigned_charactersB
Get characters not assigned to any party. Useful for adding members.
Inputs: excludeEnemies, sessionId.
get_worldC
Retrieve a world by ID.
Inputs: id (required), sessionId.
get_world_map_overviewB
Returns a high-level overview of the world including biome distribution and statistics.
Inputs: worldId (required), sessionId.
get_world_stateC
Retrieves the current state of the generated world.
Inputs: worldId (required), sessionId.
get_world_tilesB
Returns the full tile grid for rendering the world map. Includes biome, elevation, region, and river data for visualization.
Inputs: worldId (required), sessionId.
give_itemC
Add an item to a character's inventory.
Inputs: characterId (required), itemId (required), quantity, sessionId.
harvest_corpseB
Harvest resources from a corpse (scales, pelts). May require skill check.
Inputs: characterId (required), corpseId (required), resourceType (required), skillRoll, +2 more.
identify_scrollA
Identify a spell scroll using Arcana check (DC 10 + spell level) or the Identify spell (automatic success).
Inputs: characterId (required), scrollItemId (required), useIdentifySpell, sessionId.
initialize_sessionA
Initialize a new game session with world, party, and starting location.
REPLACES: create_world + create_party + N×create_character + move_party (6-10 calls → 1 call)
Example: { "worldName": "Forgotten Realms", "partyName": "The Silver Blades", "characters": [ { "name": "Valeros", "race": "Human", "characterClass": "fighter", "equipment": ["longsword", "chain_mail", "shield"] }, { "name": "Seoni", "race": "Human", "characterClass": "sorcerer", "equipment": ["quarterstaff"] } ], "startingLocation": { "name": "Sandpoint", "x": 50, "y": 50 } }
Inputs: partyName (required), characters (required), worldName, worldSeed, +2 more.
init_turn_stateC
Initialize turn management for a world (call once per world)
Inputs: worldId (required), sessionId.
interact_sociallyC
Social interaction with spatial awareness. Handles hearing range, stealth vs perception, and memory recording.
Inputs: speakerId (required), content (required), volume (required), targetId, +2 more.
level_upC
Increment character level and optionally update stats like HP.
Inputs: characterId (required), hpIncrease, targetLevel, sessionId.
list_charactersC
List all characters, optionally filtered by type (pc, npc, enemy, neutral).
Inputs: characterType, sessionId.
list_corpses_in_encounterC
List all corpses from a combat encounter.
Inputs: encounterId (required), sessionId.
list_corpses_nearbyC
List corpses near a position in the world.
Inputs: worldId (required), x (required), y (required), radius, +1 more.
list_fencesB
List all registered fences, optionally filtered by faction.
Inputs: factionId, sessionId.
list_itemsC
List all item templates in the database.
Inputs: type, sessionId.
list_loot_tablesC
List all registered loot tables.
Inputs: sessionId.
list_partiesB
List all parties, optionally filtered by status or world.
Inputs: status, worldId, sessionId.
list_questsB
List all quests, optionally filtered by world.
Inputs: worldId, sessionId.
list_secretsC
List all secrets for a world. DM view - shows hidden information.
Inputs: worldId (required), includeRevealed, type, linkedEntityId, +1 more.
list_templatesC
List all available workflow templates.
Returns template names, descriptions, and required parameters.
Inputs: category, sessionId.
list_worldsC
List all worlds.
Inputs: sessionId.
load_encounterC
Load a combat encounter from the database.
Inputs: encounterId (required), sessionId.
load_tool_schemaA
Load the full input schema for a specific tool (required before first use). Returns parameter definitions, types, and usage info.
Inputs: toolName (required), sessionId.
look_at_surroundingsC
Get filtered room description accounting for darkness, fog, and perception. Returns exits and entities.
Inputs: observerId (required), sessionId.
loot_corpseB
Loot items from a corpse. Specify itemId for specific item, or use lootAll for everything.
Inputs: characterId (required), corpseId (required), itemId, quantity, +2 more.
loot_encounterA
Loot all corpses from an encounter in a single call.
REPLACES: list_corpses_in_encounter + N×loot_corpse (5-10 calls → 1 call) TOKEN SAVINGS: ~85%
Automatically:
Finds all corpses from the encounter
Transfers all loot to specified character (or distributes to party)
Optionally includes currency/gold distribution
Returns comprehensive loot summary
Example - Single looter: { "encounterId": "encounter-123", "looterId": "char-456" }
Example - Distribute to party: { "encounterId": "encounter-123", "partyId": "party-789", "distributeEvenly": true }
Example - Selective looting: { "encounterId": "encounter-123", "looterId": "char-456", "includeItems": true, "includeCurrency": true, "includeHarvestable": false }
Inputs: encounterId (required), looterId, partyId, distributeEvenly, +4 more.
mark_readyC
Signal that your nation is done planning for this turn
Inputs: worldId (required), nationId (required), sessionId.
measure_distanceA
Calculate the distance between two points or entities on the battlefield. Returns distance in feet (5ft per square, diagonal = 5ft using D&D simplified rules).
Example - Between two coordinates: { "encounterId": "encounter-1", "from": { "type": "position", "value": "10,10" }, "to": { "type": "position", "value": "15,18" } }
Example - Between two entities: { "encounterId": "encounter-1", "from": { "type": "entity", "value": "hero-1" }, "to": { "type": "entity", "value": "goblin-3" } }
Example - From entity to position: { "encounterId": "encounter-1", "from": { "type": "entity", "value": "wizard-1" }, "to": { "type": "position", "value": "25,30" } }
Inputs: encounterId (required), from (required), to (required), sessionId.
move_character_to_roomC
Move a character to a room and increment its visit count.
Inputs: characterId (required), roomId (required), sessionId.
move_partyC
Move a party to world map coordinates or POI. Updates location name and optional POI reference.
Inputs: partyId (required), targetX (required), targetY (required), locationName (required), +2 more.
physics_projectileC
Calculate projectile motion trajectory.
Inputs: velocity (required), angle (required), height, gravity, +2 more.
place_propA
Place an improvised prop/object on the battlefield during combat.
Props are free-form terrain features with rich description that can be interacted with. Think: ladders, wagons, trees, buildings, towers, cliffs, chandeliers, etc.
⚠️ HEIGHT SEMANTICS (CRITICAL):
heightFeet describes the PROP'S visual/physical height, NOT entity position
A 30ft cliff at (5,5) is visually tall
Entities standing ON such a prop use position (5,5, z=0), NOT z=30!
The terrain height is implicit in the visualization
🏗️ PROP TYPES:
cliff: Stacked rocky terrain with slopes
wall: Stone/brick barriers
bridge: Spanning structures over gaps
tree: Vegetation cover
stairs: Stepped access to elevation
pit: Below-ground areas (negative Y)
Cover Types (D&D 5e):
half: +2 AC (waist-high wall, thick furniture)
three_quarter: +5 AC (arrow slit, portcullis)
full: Total cover (complete obstruction)
Example - Climbable cliff with slopes adjacent: { "encounterId": "encounter-1", "position": "15,20", "label": "Rocky Cliff", "propType": "structure", "heightFeet": 25, "cover": "half", "climbable": true, "climbDC": 12, "description": "A 25ft rocky outcrop. Adjacent tiles (14,20), (16,20) slope down." }
Inputs: encounterId (required), position (required), label (required), propType (required), +8 more.
poll_eventsA
Poll the event inbox for unread events. Returns events and marks them as consumed.
Events are generated by NPCs, combat, world systems, and schedulers. They represent things that happened "while the player wasn't looking" - making NPCs feel autonomous.
Example response: [ { "eventType": "npc_action", "payload": { "npcName": "Bartender", "action": "wipes a glass nervously" }}, { "eventType": "quest_update", "payload": { "questName": "Missing Merchant", "update": "New rumor heard" }} ]
Inputs: limit, sessionId.
poll_turn_resultsC
Check if turn has resolved and get results
Inputs: worldId (required), turnNumber (required), sessionId.
preview_map_patchA
Previews what a DSL patch script would do without applying it to the world.
Inputs: worldId (required), script (required), sessionId.
probability_calculateC
Calculate probabilities for dice rolls, including distributions and expected values.
Inputs: expression (required), target (required), comparison, modifiers, +2 more.
process_aura_effectsC
Process aura effects for a target at a specific trigger (e.g., start of turn, entering an aura). Returns all effects that were triggered.
Inputs: encounterId (required), targetId (required), trigger (required), sessionId.
process_effect_triggersC
Fire effect triggers at specific events (start_of_turn, on_attack, on_damage_taken, etc). Returns activated effects.
Inputs: target_id (required), target_type (required), event (required), context, +1 more.
propose_allianceC
Propose an alliance to another nation.
Inputs: fromNationId (required), toNationId (required), sessionId.
push_eventB
Push an event to the inbox. Used by DM or internal systems to queue events.
NPCs "doing things" on their own, combat updates, world changes - all go here. Frontend polls this to show what happened.
Inputs: eventType (required), payload (required), sourceType, sourceId, +3 more.
record_conversation_memoryC
Record a significant conversation/interaction. Importance: low (chat), medium, high (plot), critical.
Inputs: characterId (required), npcId (required), summary (required), importance, +2 more.
register_fenceC
Register an NPC as a fence (buys stolen goods).
Inputs: npcId (required), factionId, buyRate, maxHeatLevel, +4 more.
remove_auraA
Manually end an aura by ID (e.g., when concentration breaks or spell is dismissed).
Inputs: auraId (required), sessionId.
remove_character_aurasA
Remove all auras owned by a specific character (e.g., when they die or lose concentration).
Inputs: characterId (required), sessionId.
remove_custom_effectC
Remove a custom effect by ID or by name.
Inputs: effect_id, target_id, target_type, effect_name, +1 more.
remove_itemC
Remove an item from a character's inventory.
Inputs: characterId (required), itemId (required), quantity, sessionId.
remove_party_memberC
Remove a character from a party.
Inputs: partyId (required), characterId (required), sessionId.
render_mapB
Render an ASCII map of the current combat state showing participant positions, obstacles, and terrain. Returns a text-based grid visualization with:
A-Z for friendly participants
1-9 for enemies
█ for obstacles
░ for difficult terrain
☠ for defeated combatants
Example: { "encounterId": "encounter-battle-1-123456", "width": 15, "height": 15 }
Inputs: encounterId (required), width, height, showLegend, +1 more.
report_theftC
Report a theft to guards, setting bounty and increasing detection chance.
Inputs: reporterId (required), itemId (required), bountyOffered, sessionId.
resolve_improvised_stuntA
Resolve a creative player action using the Rule of Cool.
When a player says "I want to kick the brazier of coals into the zombie horde" or "I swing from the chandelier and kick both guards," this tool handles it mechanically.
DC Guidelines:
5: Trivial (kick open unlocked door)
10: Easy (swing from rope)
15: Medium (kick stuck mine cart)
20: Hard (catch thrown weapon)
25: Very Hard (run across crumbling bridge)
30: Nearly Impossible (catch arrow mid-flight)
Damage Guidelines:
1d4: Nuisance (thrown mug)
1d6: Light (chair smash)
2d6: Moderate (barrel roll)
3d6: Heavy (mine cart)
4d6: Severe (chandelier drop)
6d6: Massive (collapsing pillar)
8d6+: Catastrophic (building collapse)
Example: { "encounter_id": 1, "actor_id": 1, "actor_type": "character", "target_ids": [5, 6], "target_types": ["npc", "npc"], "narrative_intent": "I kick the brazier of hot coals into the zombie horde", "skill_check": { "skill": "athletics", "dc": 15 }, "action_cost": "action", "consequences": { "success_damage": "2d6", "damage_type": "fire", "area_of_effect": { "shape": "cone", "size": 15 } } }
Inputs: encounter_id (required), actor_id (required), actor_type (required), narrative_intent (required), +9 more.
resolve_turnC
Process a full turn cycle (economy, conflicts, etc.).
Inputs: worldId (required), turnNumber (required), sessionId.
rest_partyA
Rest entire party at once - heals all members and restores spell slots.
REPLACES: N×take_long_rest or N×take_short_rest (4-6 calls → 1 call) TOKEN SAVINGS: ~80%
Long rest (8 hours):
Restores ALL party members to max HP
Restores all spell slots
Clears concentration and active spells
Cannot rest while any member is in combat
Short rest (1 hour):
Rolls hit dice for healing (configurable per member)
Warlocks regain pact magic slots
Cannot rest while any member is in combat
Example - Long rest: { "partyId": "party-123", "restType": "long" }
Example - Short rest with hit dice: { "partyId": "party-123", "restType": "short", "hitDicePerMember": 2 }
Example - Short rest with custom allocation: { "partyId": "party-123", "restType": "short", "hitDiceAllocation": { "char-id-1": 3, "char-id-2": 1, "char-id-3": 0 } }
Inputs: partyId (required), restType (required), hitDicePerMember, hitDiceAllocation, +1 more.
reveal_secretC
Reveal a secret to the player. Include the spoilerMarkdown field in your response for clickable reveal.
Inputs: secretId (required), triggeredBy (required), partial, sessionId.
roll_ability_checkC
Roll a raw ability check (no skill proficiency). Uses only the ability modifier.
Inputs: characterId (required), ability (required), advantage, disadvantage, +3 more.
roll_death_saveA
Roll a d20 death saving throw for a character at 0 HP. 10+ success, nat 20 regains 1 HP, nat 1 counts as 2 failures.
Inputs: encounterId (required), characterId (required), sessionId.
roll_saving_throwC
Roll a saving throw. Applies proficiency bonus if character has save proficiency.
Inputs: characterId (required), ability (required), advantage, disadvantage, +3 more.
roll_skill_checkA
Roll a skill check using character stats. Automatically applies ability modifier and proficiency bonus if proficient. Example: roll_skill_check with characterId and skill="perception" for active character's Perception check.
Inputs: characterId (required), skill (required), advantage, disadvantage, +3 more.
search_itemsC
Search for items by name, type, or value range.
Inputs: name, type, minValue, maxValue, +1 more.
search_narrative_notesC
Search and filter narrative notes by type, status, tags, or text content. Returns matching notes for context building.
Inputs: worldId (required), query, type, status, +6 more.
search_toolsB
Search for available RPG tools by category, capability, or keyword. Use this to discover tools before using them.
Inputs: query, category, maxResults, contextAwareOnly, +1 more.
sell_to_fenceC
Sell stolen item to a fence NPC for reduced price. Clears stolen flag after cooldown.
Inputs: sellerId (required), fenceId (required), itemId (required), itemValue (required), +1 more.
set_active_characterC
Set the active character (player's POV). The character must already be a member.
Inputs: partyId (required), characterId (required), sessionId.
set_party_leaderC
Set the party leader. The character must already be a member.
Inputs: partyId (required), characterId (required), sessionId.
setup_tactical_encounterA
Create a full combat encounter with creatures from presets and terrain patterns.
REPLACES: create_encounter + N×create_character + N×update_terrain (6-12 calls → 1 call) TOKEN SAVINGS: ~90%
Creature templates: "goblin", "goblin:archer", "skeleton:warrior", "orc:berserker" Position shorthand: "10,5" instead of {x:10, y:5, z:0}
Example - Goblin Ambush: { "seed": "goblin-ambush", "participants": [ { "template": "goblin:warrior", "position": "5,5" }, { "template": "goblin:warrior", "position": "7,5" }, { "template": "goblin:archer", "position": "6,2" }, { "template": "hobgoblin:captain", "name": "Grishnak", "position": "6,3" } ], "terrain": { "obstacles": ["3,3", "3,4", "8,3", "8,4"], "difficultTerrain": ["5,6", "6,6", "7,6"] }, "partyPositions": ["10,10", "11,10", "10,11", "11,11"] }
Available creature templates: goblin, goblin:warrior, goblin:archer, goblin:boss, goblin:shaman, skeleton, skeleton:warrior, skeleton:archer, zombie, zombie:brute, orc, orc:warrior, orc:berserker, hobgoblin, hobgoblin:captain, wolf, dire_wolf, bandit, bandit_captain, ogre, troll, and more.
Inputs: seed (required), participants (required), terrain, partyPositions, +3 more.
spawn_equipped_characterA
Create a character with equipment from presets in a single call.
REPLACES: create_character + N×(create_item + give_item + equip_item) (8-16 calls → 1 call) TOKEN SAVINGS: ~85%
Equipment can be preset names or full item specs.
Example - Dwarf Fighter: { "name": "Gimli", "race": "Dwarf", "characterClass": "fighter", "level": 5, "stats": { "str": 18, "dex": 12, "con": 16, "int": 10, "wis": 12, "cha": 8 }, "equipment": ["battleaxe", "chain_mail", "shield"], "partyId": "fellowship-123" }
Example - From creature template: { "template": "bandit_captain", "name": "Red Raven", "equipment": ["rapier", "studded_leather"], "characterType": "npc" }
Available equipment presets: All PHB weapons (longsword, shortbow, greataxe...), armor (chain_mail, plate, leather...), and gear (rope, torch, healers_kit...).
Inputs: name (required), template, race, characterClass, +10 more.
spawn_populated_locationA
Create a complete location with POI, optional room network, and inhabitants in one call.
REPLACES: create_poi + create_network + N×create_room + N×spawn_character + N×(create_item + place_item) TOKEN SAVINGS: ~90%
Example - Goblin Cave: { "worldId": "world-123", "name": "Shadowfang Cave", "category": "dungeon", "icon": "cave", "position": "50,30", "description": "A dark cave system rumored to house goblin raiders", "level": 3, "tags": ["goblin", "cave", "treasure"], "rooms": [ { "name": "Cave Entrance", "description": "A shadowy opening in the hillside...", "biome": "cavern" }, { "name": "Guard Chamber", "description": "A small alcove where guards keep watch...", "biome": "cavern", "exits": ["north"] } ], "inhabitants": [ { "template": "goblin:warrior", "room": 0, "count": 2 }, { "template": "goblin:archer", "room": 1 }, { "template": "hobgoblin:captain", "name": "Skullcrusher", "room": 1 } ], "loot": [ { "preset": "longsword", "room": 1 }, { "preset": "potion_healing", "room": 0, "count": 2 } ] }
Example - Village Inn: { "worldId": "world-123", "name": "The Prancing Pony", "category": "commercial", "icon": "inn", "position": "100,75", "population": 15, "discoveryState": "discovered", "rooms": [ { "name": "Common Room", "description": "A warm tavern with crackling fireplace...", "biome": "urban" }, { "name": "Kitchen", "description": "The busy kitchen smells of fresh bread...", "biome": "urban", "exits": ["west"] } ], "inhabitants": [ { "name": "Barliman Butterbur", "race": "Human", "characterType": "npc", "room": 0 }, { "template": "bandit", "name": "Suspicious Stranger", "characterType": "neutral", "room": 0 } ] }
Categories: settlement, fortification, dungeon, landmark, religious, commercial, natural, hidden Icons: city, town, village, castle, fort, tower, dungeon, cave, ruins, temple, shrine, inn, market, mine, farm, camp Biomes: forest, mountain, urban, dungeon, coastal, cavern, divine, arcane
Inputs: worldId (required), name (required), category (required), icon (required), +11 more.
spawn_preset_encounterA
Create a complete combat encounter from a preset with a single call.
REPLACES: setup_tactical_encounter with manual participant/terrain specification TOKEN SAVINGS: ~95% (one ID vs full encounter specification)
Example - Goblin Ambush: { "preset": "goblin_ambush" }
Example - Scaled for large party: { "preset": "orc_warband", "partySize": 6, "partyLevel": 5 }
Example - Random encounter: { "random": true, "difficulty": "medium", "level": 3 }
Example - Random by tag: { "random": true, "tags": ["undead"], "level": 2 }
Available presets:
Goblinoid: goblin_ambush, goblin_lair, hobgoblin_patrol, bugbear_ambush
Orc: orc_raiding_party, orc_warband
Undead: skeleton_patrol, zombie_horde, crypt_guardians
Beast: wolf_pack, spider_nest, owlbear_territory
Bandit: bandit_roadblock, bandit_camp
Urban: tavern_brawl, cult_ritual
Dungeon: animated_guardians, mimic_trap, troll_bridge, dragon_wyrmling_lair
Fiend: imp_swarm
Elemental: elemental_breach
Difficulties: easy, medium, hard, deadly
Inputs: preset, random, difficulty, level, +7 more.
spawn_preset_locationA
Spawn a complete location from a preset. Creates POI, room network, and optionally NPCs.
TOKEN SAVINGS: ~85% vs manual specification
WHAT THIS TOOL DOES:
Creates a POI at specified world coordinates
Creates a room network with all preset rooms
Links the POI to the network
Optionally spawns preset NPCs
Example - Spawn a tavern: { "preset": "generic_tavern", "worldId": "world-1", "x": 50, "y": 75 }
Example - Spawn dungeon entrance with NPCs: { "preset": "dungeon_entrance", "worldId": "world-1", "x": 100, "y": 200, "spawnNpcs": true }
Example - Custom name: { "preset": "forest_clearing", "worldId": "world-1", "x": 25, "y": 30, "customName": "Whispering Glade" }
Available presets:
Taverns: generic_tavern, rough_tavern
Dungeons: dungeon_entrance, cave_entrance
Urban: town_square
Wilderness: forest_clearing, roadside_camp
Inputs: preset (required), worldId (required), x (required), y (required), +4 more.
steal_itemA
Record a theft event. Marks an item as stolen from one character and creates a "hot" theft record.
The theft creates a provenance record that:
Can be detected by the original owner
May trigger guard searches
Affects NPC disposition if detected
Heat decays over time (burning → hot → warm → cool → cold)
Example: { "thiefId": "rogue-1", "victimId": "merchant-1", "itemId": "ruby-necklace", "witnesses": ["guard-1"], "locationId": "marketplace" }
Inputs: thiefId (required), victimId (required), itemId (required), witnesses, +2 more.
submit_turn_actionsC
Submit actions for this turn (batched)
Inputs: worldId (required), nationId (required), actions (required), sessionId.
subscribe_to_eventsC
Subscribe to real-time events on world or combat topics. Events sent as JSON-RPC notifications.
Inputs: topics (required), sessionId.
suggest_poi_locationsC
Batch suggest locations for multiple POI types at once. Returns DSL script for easy application.
Inputs: worldId (required), requests (required), sessionId.
take_long_restC
Take a long rest (8 hours). Restores HP to maximum. Future: will restore spell slots.
Inputs: characterId (required), sessionId.
take_short_restC
Take a short rest (1 hour). Spend hit dice to recover HP.
Inputs: characterId (required), hitDiceToSpend, sessionId.
transfer_itemC
Transfer an item from one character to another.
Inputs: fromCharacterId (required), toCharacterId (required), itemId (required), quantity, +1 more.
travel_to_locationA
Move a party to a POI on the world map. Combines move_party + discover_poi + enter_room.
TOKEN SAVINGS: ~70% vs separate calls (3 tools → 1)
WHAT THIS TOOL DOES:
Moves party to POI coordinates on world map
Auto-discovers the POI if not yet discovered (with perception check if DC set)
Optionally enters the POI's entrance room if it has a network
Example - Travel to known location: { "partyId": "party-1", "poiId": "poi-tavern-1" }
Example - Travel and auto-enter dungeon: { "partyId": "party-1", "poiId": "poi-dungeon-1", "enterLocation": true }
Example - Travel with discovery bypass: { "partyId": "party-1", "poiId": "poi-hidden-temple", "autoDiscover": true }
Inputs: partyId (required), poiId (required), enterLocation, autoDiscover, +2 more.
unequip_itemC
Unequip an item.
Inputs: characterId (required), itemId (required), sessionId.
unsubscribe_from_eventsC
Unsubscribe from all event topics
Inputs: sessionId.
update_characterB
Update character properties. All fields except id are optional.
For conditions, you can pass an array to SET all conditions (replacing existing), or use addConditions/removeConditions for granular control.
Inputs: id (required), name, race, class, +16 more.
update_itemC
Update an existing item template.
Inputs: itemId (required), name, description, type, +4 more.
update_narrative_noteC
Update an existing narrative note. Common use: marking a plot_thread as resolved.
Inputs: noteId (required), content, metadata, status, +3 more.
update_npc_relationshipC
Update or create a PC-NPC relationship. Familiarity: stranger→acquaintance→friend→close_friend/rival/enemy.
Inputs: characterId (required), npcId (required), familiarity (required), disposition (required), +2 more.
update_objectiveC
Update progress on a quest objective.
Inputs: characterId (required), questId (required), objectiveId (required), progress, +1 more.
update_partyC
Update party properties (name, description, location, formation, status).
Inputs: partyId (required), name, description, currentLocation, +3 more.
update_party_memberC
Update a party member's role, position, or notes.
Inputs: partyId (required), characterId (required), role, position, +3 more.
update_secretC
Update a secret's properties.
Inputs: secretId (required), publicDescription, secretDescription, sensitivity, +4 more.
update_terrainA
Add, remove, or modify terrain in an active encounter. ALWAYS prefer ranges over tiles arrays for efficiency.
TERRAIN TYPES:
obstacles: Blocking terrain (walls, rocks, fallen trees)
difficultTerrain: Half-speed terrain (mud, rubble, underbrush)
water: Watery terrain (streams, rivers, pools)
INPUT OPTIONS (use ranges for efficiency):
ranges: Array of range shortcuts (PREFERRED - saves tokens)
tiles: Array of "x,y" strings (only for specific scattered tiles)
RANGE SHORTCUTS (use these!):
LINES:
"x=N" - vertical line at x=N (full height)
"x=N:y1:y2" - vertical line segment
"y=N" - horizontal line at y=N (full width)
"y=N:x1:x2" - horizontal line segment
"line:x1,y1,x2,y2" - diagonal/any line from point to point (Bresenham)
"hline:y:x1:x2" - horizontal line
"vline:x:y1:y2" - vertical line
"row:N" / "col:N" - aliases for y=N / x=N
SHAPES:
"rect:x,y,w,h" - filled rectangle
"box:x,y,w,h" - hollow rectangle (border only)
"border:margin" - outer border of grid (margin=0 for edge)
"fill:x1,y1,x2,y2" - fill between two corners
"circle:cx,cy,r" - filled circle
"ring:cx,cy,r" - hollow circle
ALGEBRA (for curves, diagonals):
"y=x:0:99" - diagonal line (y equals x)
"y=2*x+5:0:50" - any linear equation
"y=x/2:0:99" - half-speed diagonal
"expr:EQUATION:xMin:xMax" - explicit expression format
EXAMPLES:
Maze outer walls (1 call vs 4): { "ranges": ["border:0"], "gridWidth": 100, "gridHeight": 100 }
Complex maze section: { "ranges": ["y=10:0:50", "x=25:10:40", "line:50,50,75,25", "box:60,60,15,15"] }
Diagonal river: { "terrainType": "water", "ranges": ["y=x:0:99"] }
Circular arena: { "ranges": ["ring:50,50,40", "border:0"] }
Inputs: no named parameters.
update_world_environmentC
Update environmental properties (time, weather, lighting, etc.) for a world.
Inputs: id (required), environment (required), sessionId.
use_itemC
Use a consumable item (removes it from inventory and applies effects).
Inputs: characterId (required), itemId (required), targetId, sessionId.
use_spell_scrollA
Use a spell scroll from inventory. Scroll is consumed after use (even if the Arcana check fails). If the spell is on your class list and you can cast that level, no check is required.
Inputs: characterId (required), scrollItemId (required), targetId, targetPoint, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 196 tools
The tool set has significant overlap and ambiguity, with many tools performing similar functions or having unclear boundaries. For example, multiple tools handle concentration (break_concentration, check_automatic_concentration_break, check_concentration_duration, check_concentration_save, get_concentration_state), corpse management (advance_corpse_decay, cleanup_corpses, create_corpse, get_corpse, get_corpse_by_character, get_corpse_inventory, harvest_corpse, list_corpses_in_encounter, list_corpses_nearby, loot_corpse), and terrain generation (generate_terrain_patch, generate_terrain_pattern, update_terrain), making it difficult for an agent to choose the right one without deep context. While descriptions help, the sheer number of overlapping tools creates confusion.
Tool names are mostly consistent with a verb_noun pattern (e.g., create_character, update_character, delete_character, get_character), which aids predictability. However, there are minor deviations such as dice_roll (noun_verb), load_tool_schema (verb_noun_noun), and some tools using abbreviations like aoe or xp, slightly reducing uniformity. Overall, the naming is readable and follows clear conventions, with only occasional inconsistencies.
With 196 tools, the count is excessive for an RPG server, leading to overwhelming complexity and redundancy. Many tools could be consolidated (e.g., multiple concentration or corpse tools), and the high number suggests poor scoping. While RPG domains can be broad, this magnitude exceeds typical well-scoped sets (3-15 tools) and indicates a lack of focus, making it challenging for agents to navigate efficiently.
The tool set provides comprehensive coverage for RPG domains, including character management, combat, quests, world-building, narrative notes, and item systems. It supports full CRUD operations (e.g., create_character, get_character, update_character, delete_character) and lifecycle workflows (e.g., from character creation to combat to looting). There are no obvious gaps; tools like initialize_session and spawn_preset_encounter streamline complex tasks, ensuring agents can handle most RPG scenarios without dead ends.
Maintenance
Related MCP Connectors
Play and build AI RPG worlds: your agent tells the story, Worldtable keeps HP, items and the map.
D&D and TTRPG campaign manager for GMs: your AI reads and writes a live, typed campaign database.
A persistent tabletop RPG with an AI dungeon master. Agents and humans share one table.
The game engine built for AI. Any agent makes a multiplayer game and publishes it.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables creation and management of structured game worlds for text adventures and RPGs with character creation, world generation, and natural language interaction through AI integration.1MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that enables AI agents to act as dynamic dungeon masters for text-based RPGs with dynamically generated rule systems and comprehensive game state management.15MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI to act as Game Master for tabletop RPGs with deterministic dice, five-tier outcomes, FitD-style stress, combat tracking, clocks, investigations, NPC relationships, and world generation via 134 tools over MCP.2MIT
- AlicenseAqualityBmaintenanceHolonovel turns a tabletop RPG rulebook and an AI client into a running game. The server enforces every rule and remembers your campaign as structured state the AI can't forget; the AI just narrates. D&D 5e, Starfinder, or any rulebook.371MIT