← Back to Blog

Every Tool in Embertold's AI Game Master Toolbox, Explained

Lorenzo Lorenzo · · 6 min read
Every Tool in Embertold's AI Game Master Toolbox, Explained

A human dungeon master juggles many responsibilities at once. Embertold's AI Game Master does the same, through a set of specialized, typed tools, each one a discrete function the model can call mid-turn.

The Tool System

Instead of generating everything in a single block of text, the Game Master calls discrete tools for each type of output, defined with typed schemas on top of the AI SDK. This ensures each element is handled properly, with the right format, the right timing, and the right constraints, and it gives us a place to enforce game rules in code rather than hoping the model gets them right.

Here's what's in the toolkit:

Narration

The core tool. The model uses this to describe scenes, action outcomes, environmental changes, and story progression. Narration is the backbone of the experience, everything else enhances it.

Narration is paced deliberately, sent in beats instead of one massive paragraph, giving you time to absorb each piece before moving on. Adventure creators can define a custom narration style that controls tone and personality, so a dark horror adventure reads differently from a lighthearted comedy.

NPC Dialogue and Lifecycle

When an NPC speaks, it goes through a dedicated dialogue tool, not just text in quotation marks inside narration. NPCs are formally registered the first time they appear, with personality traits and an assigned voice, which keeps the gruff blacksmith sounding the same whether they're introducing themselves or arguing with you ten turns later.

That registration isn't permanent scenery, though. A separate tool lets the model update a registered NPC's status, disposition, or location whenever the story actually moves them: they can die, turn hostile after a betrayal, or leave the story for good. This is the only path to change an NPC after their introduction, so the model can't quietly retcon a character's state through narration alone.

Dice Rolls and Skill Checks

Two tools handle uncertainty. A low-level dice tool rolls a d20 against a difficulty class and returns the raw roll, the modifier, the total, and the outcome as a visible event. A higher-level skill check tool wraps it: it pulls the character's relevant ability score straight from the effective-stats calculation (base stats, plus equipment bonuses, plus active status-effect modifiers), applies a D&D 5e-style proficiency bonus, and lets the model focus on picking the right difficulty class instead of doing the arithmetic itself. Natural 20s and natural 1s are always a critical success or failure, exactly like at a physical table.

Status Effects

A dedicated tool applies timed status effects to a character: burning, poisoned, stunned, charmed, bleeding, blessed, or cursed. Each has a duration in turns and, where it makes mechanical sense, a numeric modifier that feeds into future skill checks (blessed and cursed are worth +/-2 to rolls, for instance). Charmed is intentionally left narrative-only, it shapes how the model roleplays an NPC's disposition rather than touching any number.

Player Actions

After narrating, the model generates contextual action suggestions based on your current situation, character stats, inventory, and the narrative context. You're never locked into these, they're there to inspire, not to limit. Type whatever you want and the model adapts.

Knowledge Queries

The model can query the universe's lore mid-turn through a retrieval tool backed by our vector index. It supports batch queries: up to five focused lore questions in a single call, run in parallel, so the model can research a location's history, its current occupants, nearby factions, and political dynamics all at once. This happens silently, you don't see the query, you just get narration that's surprisingly well-informed about obscure details. See how lore feeds the story for the retrieval side of this.

Scene Images

When the narrative calls for it, the model crafts a visual prompt and sends it to the image generation pipeline, and the result appears in your session. The model is selective, images are generated for impactful moments, not every message.

Sound Effects and Ambient Audio

Two separate tools handle audio: one-shot sound effects for dramatic moments, and layered ambient soundscapes with smooth crossfade transitions between environments. The model chooses between them based on the moment, and a single turn triggers at most one or the other (up to two sound effects, or one ambient change), never both, to avoid audio overload. Messages containing audio auto-reveal during playback so the narrative flows without constant clicking.

Inventory and Health

The model adds and removes items through an explicit inventory tool, so changes are structured and trackable, not just mentioned in passing within narration. Damage and healing go through a dedicated health tool, which updates the character's hit points, triggers visual feedback, and can trigger story events. If health drops to zero, the outcome depends on the adventure's death behavior: some end permanently, others restore the character to their most recent chapter checkpoint and let the player retry.

Choice Tracking

When the model makes a call it judges consequential, it logs it through a choice-tracking tool: a short description, a consequence type, and which factions were affected. This is what powers the "Your Defining Choices" summary on a completed session, without requiring a separate pass over the transcript after the fact.

Chapter Management and Adventure Conclusion

When a chapter reaches a natural conclusion, the model triggers the chapter completion tool, which generates a summary, an AI-generated title, and starts a fresh chapter with full context. When the story reaches its end, victory or defeat, a conclusion tool generates a final summary, assigns an outcome, and transitions the session to its completed state. Players can also abandon a session at any point through the session settings, no tool call required on the model's side.

The Orchestration

The real magic isn't in any single tool, it's in how the model orchestrates them. A single player turn might involve querying lore about the current location, rolling a skill check, narrating the result, having an NPC react with voiced dialogue, updating the player's inventory, and generating action suggestions for the next turn, all coordinated by one model making real-time decisions about what the moment needs. That's the digital dungeon master at work. For the architecture behind it all, read How Does an AI Dungeon Master Work?

Related Posts