Skip to main content
Glama

roll_check

Roll D&D 5e dice for skill checks, saving throws, attack rolls, and initiative to resolve game actions and determine outcomes.

Instructions

Roll D&D 5e checks including skill checks, ability checks, saving throws, attack rolls, and initiative

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
characterIdNo
characterNameNo
checkTypeYes
skillNo
abilityNo
dcNo
advantageNo
disadvantageNo
bonusNo
contestedByNo
contestedCheckNo

Implementation Reference

  • The registered handler for the 'roll_check' tool. It validates the input arguments using rollCheckSchema, calls the rollCheck function with validated args, and returns a formatted success response with markdown or an error.
    handler: async (args) => {
      try {
        const validated = rollCheckSchema.parse(args);
        const result = rollCheck(validated);
    
        if (!result.success) {
          return error(result.error || 'Failed to roll check');
        }
    
        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);
      }
    },
  • Registration of the 'roll_check' tool in the toolRegistry object, defining name, description, input schema (converted from Zod schema), and handler.
    roll_check: {
      name: 'roll_check',
      description: 'Roll D&D 5e checks including skill checks, ability checks, saving throws, attack rolls, and initiative',
      inputSchema: toJsonSchema(rollCheckSchema),
      handler: async (args) => {
        try {
          const validated = rollCheckSchema.parse(args);
          const result = rollCheck(validated);
    
          if (!result.success) {
            return error(result.error || 'Failed to roll check');
          }
    
          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);
        }
      },
    },
  • Import declaration for rollCheck function and rollCheckSchema Zod schema used by the roll_check tool.
    rollCheck,
    rollCheckSchema,
  • Core execution: parsing with schema and calling rollCheck helper function with validated arguments.
    const validated = rollCheckSchema.parse(args);
    const result = rollCheck(validated);
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states what types of checks can be rolled but doesn't describe how the tool behaves: whether it applies character modifiers automatically, how advantage/disadvantage mechanics work, what the output format is, or if there are any limitations (like maximum bonus values). For a complex 11-parameter tool with no annotation coverage, this is insufficient.

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

Conciseness5/5

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

The description is a single, efficient sentence that front-loads the core purpose. Every word earns its place by specifying the game system (D&D 5e) and enumerating the check types. There's no wasted verbiage or redundant information.

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

Completeness2/5

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

Given the tool's complexity (11 parameters, nested objects, no output schema, and no annotations), the description is incomplete. It doesn't address how results are returned, what happens with contested checks, how bonuses are applied, or the relationships between parameters. For a tool that likely returns complex dice results with modifiers, the lack of output information is particularly problematic.

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

Parameters1/5

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

Schema description coverage is 0%, meaning none of the 11 parameters have descriptions in the schema. The tool description provides no information about any parameters - it doesn't explain what 'checkType' values are valid, how 'characterId' vs 'characterName' should be used, what 'contestedBy' and 'contestedCheck' do, or the relationships between parameters like 'skill' and 'ability'. This leaves all parameters completely undocumented.

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 tool's purpose with specific verbs ('Roll D&D 5e checks') and enumerates the types of checks it handles (skill checks, ability checks, saving throws, attack rolls, initiative). It distinguishes itself from sibling tools like 'roll_dice' (generic dice rolling) and 'roll_death_save' (specific death saving throws) by focusing on comprehensive D&D 5e check mechanics.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose 'roll_check' over 'roll_dice' for simple dice rolls, 'roll_death_save' for death saves, or other combat-related tools like 'execute_action'. There's no context about prerequisites, such as needing character data or an active encounter.

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