Skip to main content
Glama
saidsurucu

d20-mcp

by saidsurucu

roll_detailed

Get a complete breakdown of any dice roll, including individual die values, kept/dropped dice, and the full AST structure. Ideal for debugging complex rolls, character creation, and transparent gameplay.

Instructions

Roll dice with comprehensive breakdown including AST structure and individual die values.

PURPOSE: Use this tool when you need to see exactly what happened during a dice roll, including which specific values each die showed, which dice were kept or dropped, and the complete Abstract Syntax Tree (AST) structure of the roll. Perfect for debugging, transparency, and understanding complex roll mechanics.

WHEN TO USE:

  • Character creation: See which specific values you rolled for ability scores (4d6kh3)

  • Debugging: Understand why a complex roll gave a particular result

  • Transparency: Show players exactly what each die rolled

  • Learning: Understand how keep/drop/reroll mechanics work

  • Complex rolls: Analyze multi-step expressions with nested operations

  • Statistical analysis: See individual die distributions

WHEN NOT TO USE:

  • Simple rolls where you only need the total (use roll instead)

  • Multiple different rolls (use roll_batch instead)

  • You don't need the AST complexity for basic gameplay

AST STRUCTURE EXPLANATION: The "ast" field contains a tree structure representing the roll:

  • "type": Type of node (Expression, Dice, Number, etc.)

  • "total": Numeric value of this node

  • "number": Number of dice rolled (for Dice nodes)

  • "size": Dice size, e.g., 6 for d6 (for Dice nodes)

  • "values": Array of individual die results with "value" and "kept" (true/false)

  • "children": Nested operations (for complex expressions)

INDIVIDUAL DIE RESULTS: The "values" array shows each die roll:

  • {"value": 4, "kept": true} → This die was kept in the final result

  • {"value": 2, "kept": false} → This die was dropped (e.g., in 4d6kh3)

COMMON EXAMPLES:

  • Character Stats: "4d6kh3" → See which 3 of 4 dice were kept

  • Advantage: "2d20kh1" → See both d20 results, know which was kept

  • Reroll Analysis: "4d6rr1" → See which dice were rerolled

  • Exploding Dice: "3d6e" → See which dice exploded and their chain

  • Complex Expression: "(1d4+1)*2d6kh1" → Full breakdown of nested operations

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
expressionYesDice expression to evaluate
allow_commentsNoAllow comments after the expression
Behavior5/5

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

With no annotations, the description fully carries the behavioral transparency burden. It explains the AST structure, individual die results with 'kept' flags, and provides examples for complex mechanics like rerolls and exploding dice, leaving no ambiguity about what the tool returns.

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?

Though lengthy, the description is well-organized with clear section headers and notable front-loading. Every section contributes to understanding, and the examples earn their place. It is appropriately detailed for a tool with complex output.

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

Completeness5/5

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

Given the tool's complexity and lack of output schema, the description is exceptionally complete. It covers the AST tree fields, individual die result format, and common examples, fully preparing an agent to use the tool correctly.

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 coverage is 100%, so baseline is 3. The description adds value beyond the schema by explaining the expected expression format and providing concrete examples (e.g., '4d6kh3', '2d20kh1') that clarify how parameters should be used in context.

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 identifies the tool as rolling dice with a comprehensive breakdown including AST structure and individual die values. It distinguishes itself from siblings by emphasizing detailed output, making the purpose unambiguous.

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

Usage Guidelines5/5

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

The 'WHEN TO USE' and 'WHEN NOT TO USE' sections explicitly state appropriate contexts and name alternative tools (roll, roll_batch) for different needs. This provides crystal-clear guidance on tool selection.

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/saidsurucu/d20-mcp'

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