roll_death_save
Roll a death saving throw for D&D 5e characters at 0 HP to determine if they stabilize or die, applying modifiers and roll modes while tracking successes and failures.
Instructions
Roll a death saving throw for a character at 0 HP. D&D 5e rules: 10+ success, 9- failure, nat 1 = 2 failures, nat 20 = revive at 1 HP. 3 successes = stable (unconscious but not dying), 3 failures = death. Supports modifiers from spells like Bless and roll modes (advantage/disadvantage). Returns ASCII-formatted death save result with visual tracker.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| encounterId | Yes | The encounter containing the dying character | |
| characterId | Yes | The character making the death save | |
| modifier | No | Bonus/penalty to the roll (e.g., Bless spell gives +1d4) | |
| rollMode | No | Roll mode - advantage rolls 2d20 keep highest, disadvantage keeps lowest | normal |
| manualRoll | No | Override the d20 roll (for testing) | |
| manualRolls | No | Override both dice for advantage/disadvantage (for testing) |
Implementation Reference
- src/registry.ts:840-858 (registration)Registration of the 'roll_death_save' tool in the central tool registry. Defines name, description, input schema (converted from Zod rollDeathSaveSchema), and a wrapper handler that validates args and delegates to the rollDeathSave implementation function.roll_death_save: { name: 'roll_death_save', description: 'Roll a death saving throw for a character at 0 HP. D&D 5e rules: 10+ success, 9- failure, nat 1 = 2 failures, nat 20 = revive at 1 HP. 3 successes = stable (unconscious but not dying), 3 failures = death. Supports modifiers from spells like Bless and roll modes (advantage/disadvantage). Returns ASCII-formatted death save result with visual tracker.', inputSchema: toJsonSchema(rollDeathSaveSchema), handler: async (args) => { try { const validated = rollDeathSaveSchema.parse(args); const result = rollDeathSave(validated); return success(result); } catch (err) { if (err instanceof z.ZodError) { const messages = err.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', '); return error(`Validation failed: ${messages}`); } const message = err instanceof Error ? err.message : String(err); return error(message); } }, },
- src/registry.ts:844-857 (handler)The MCP-compatible tool handler for roll_death_save. Performs Zod validation using rollDeathSaveSchema, calls the core rollDeathSave(validated) function, wraps result in success(), and handles validation/parsing errors.handler: async (args) => { try { const validated = rollDeathSaveSchema.parse(args); const result = rollDeathSave(validated); return success(result); } catch (err) { if (err instanceof z.ZodError) { const messages = err.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', '); return error(`Validation failed: ${messages}`); } const message = err instanceof Error ? err.message : String(err); return error(message); } },