Skip to main content
Glama

take_rest

Process short or long rests for D&D 5e characters to heal using hit dice, restore health points, and clear conditions. Supports batch processing for party management.

Instructions

Process short or long rest for D&D 5e character. Short rest: spend hit dice to heal. Long rest: restore all HP, half hit dice (rounded up), and clear until_rest conditions. Supports batch for party rests.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
characterIdNo
characterNameNo
restTypeNo
hitDiceToSpendNo
restoreHpNo
restoreSpellSlotsNo
restoreHitDiceNo
clearConditionsNo
uninterruptedNo
batchNo

Implementation Reference

  • Registration of the 'take_rest' MCP tool. Defines name, description, converts Zod schema to JSON schema for MCP compatibility, and provides typed handler that validates input and delegates to core takeRest implementation.
    take_rest: {
      name: 'take_rest',
      description: 'Process short or long rest for D&D 5e character. Short rest: spend hit dice to heal. Long rest: restore all HP, half hit dice (rounded up), and clear until_rest conditions. Supports batch for party rests.',
      inputSchema: toJsonSchema(takeRestSchema),
      handler: async (args) => {
        try {
          const validated = takeRestSchema.parse(args);
          const result = takeRest(validated);
    
          if (!result.success) {
            return error(result.error || 'Failed to process rest');
          }
    
          return success(result.markdown);
        } 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);
        }
      },
  • The tool handler function. Performs Zod validation on input arguments using takeRestSchema, executes the core takeRest logic function with validated args, handles success/error responses with markdown formatting, and catches validation/runtime errors.
    handler: async (args) => {
      try {
        const validated = takeRestSchema.parse(args);
        const result = takeRest(validated);
    
        if (!result.success) {
          return error(result.error || 'Failed to process rest');
        }
    
        return success(result.markdown);
      } 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);
      }
  • Reference to takeRestSchema used for input validation (Zod schema parsed from args before calling handler). Schema imported from './modules/characters.js'.
    const validated = takeRestSchema.parse(args);
    const result = takeRest(validated);
  • Import statement for character-related tools including the core takeRest function (implements rest mechanics) and takeRestSchema (Zod input schema) from characters module.
    import {
      createCharacter,
      createCharacterSchema,
      getCharacter,
      getCharacterSchema,
      updateCharacter,
      updateCharacterSchema,
      deleteCharacter,
      deleteCharacterSchema,
      takeRest,
      takeRestSchema,
      manageSpellSlots,
      manageSpellSlotsSchema,
      rollCheck,
      rollCheckSchema,
      levelUp,
      levelUpSchema
    } from './modules/characters.js';
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It describes key behavioral traits: short rest mechanics (spend hit dice to heal), long rest mechanics (restore all HP, half hit dice, clear conditions), and batch support. However, it lacks details on permissions, rate limits, or what happens if parameters conflict (e.g., using both characterId and batch). It does not contradict annotations, as none exist.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, starting with the core purpose and immediately detailing short and long rest mechanics. Every sentence adds value: the first defines the tool, the second and third explain rest types, and the fourth mentions batch support. It could be slightly more structured by separating short and long rest details into distinct sentences for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (10 parameters, no annotations, no output schema), the description is moderately complete. It covers the main purpose and key mechanics but lacks details on parameter interactions, error conditions, or return values. Without annotations or output schema, it should do more to explain behavioral outcomes, such as what happens if a rest fails or how results are reported.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It adds meaning by explaining 'restType' (short vs. long), 'hitDiceToSpend' (for short rests), and 'clearConditions' (for long rests), covering at least 3 of the 10 parameters. However, it does not fully explain all parameters like 'restoreHp', 'restoreSpellSlots', or 'uninterrupted', leaving gaps in parameter understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('process short or long rest'), the resource ('D&D 5e character'), and distinguishes between short and long rest mechanics. It explicitly mentions 'short rest: spend hit dice to heal' and 'long rest: restore all HP, half hit dice (rounded up), and clear until_rest conditions,' providing detailed differentiation from sibling tools that handle other character/encounter operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying when to use short vs. long rests based on healing needs and condition clearing, but does not explicitly state when to use this tool versus alternatives like 'manage_spell_slots' or 'manage_condition' for similar effects. It mentions 'supports batch for party rests' which hints at multi-character scenarios, but lacks explicit exclusions or named alternatives.

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/Mnehmos/mnehmos.chatrpg.game'

If you have feedback or need assistance with the MCP directory API, please join our Discord server