Skip to main content
Glama

Roll Dice

roll_dice
Read-onlyIdempotent

Pipeworx dice engine: roll tabletop dice notation with real randomness, NdS terms joined by + or - (2d6+1d4+3, 1d20-2), keep/drop (4d6kh3, 2d20kl1 for disadvantage, 4d6dl1), exploding dice (3d6!), fudge/Fate dice (4dF) and percentile (d% or d100). Up to 1,000 dice and 10,000 sides. Returns every die rolled, which dice were kept, per-term subtotals, the total and a readable breakdown; times repeats the roll (up to 100) and adds min/max/mean. Omit seed for a fresh roll; pass the returned seed to reproduce it exactly. The outcome is random, the calling agent decides what it means.

Example tool call

This call uses example arguments supplied in the tool’s input schema.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "times": 6,
      "notation": "4d6kh3"
    },
    "name": "roll_dice"
  }
}

Input Schema

NameRequiredDescriptionDefault
seedNoOptional seed. Same seed + same arguments = same result. Omit for a fresh random roll; the seed used is always returned.
timesNoHow many times to roll the whole notation (default 1, max 100).
notationYesDice notation, e.g. "2d6+3", "4d6kh3", "2d20kl1", "d%", "4dF", "3d6!".

Output Schema

NameRequiredDescriptionDefault
maxNo
minNo
meanNo
metaNo
seedNo
rollsNo
termsNo
timesNo
totalNo
detailNo
totalsNo
notationNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "detail": {
      +      "type": "string"
      +    },
      +    "max": {
      +      "type": "number"
      +    },
      +    "mean": {
      +      "type": "number"
      +    },
      +    "meta": {
      +      "properties": {
      +        "deck": {
      +          "properties": {
      +            "id": {
      +              "type": "string"
      +            },
      +            "version": {
      +              "type": "string"
      +            }
      +          },
      +          "type": "object"
      +        },
      +        "procedure": {
      +          "type": "string"
      +        },
      +        "seed": {
      +          "type": "string"
      +        },
      +        "source": {
      +          "type": "string"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "min": {
      +      "type": "number"
      +    },
      +    "notation": {
      +      "type": "string"
      +    },
      +    "rolls": {
      +      "items": {
      +        "properties": {
      +          "detail": {
      +            "type": "string"
      +          },
      +          "notation": {
      +            "type": "string"
      +          },
      +          "terms": {
      +            "items": {
      +              "properties": {
      +                "kept": {
      +                  "items": {
      +                    "type": "number"
      +                  },
      +                  "type": "array"
      +                },
      +                "rolls": {
      +                  "items": {
      +                    "type": "number"
      +                  },
      +                  "type": "array"
      +                },
      +                "subtotal": {
      +                  "type": "number"
      +                },
      +                "term": {
      +                  "type": "string"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "total": {
      +            "type": "number"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "seed": {
      +      "type": "string"
      +    },
      +    "terms": {
      +      "items": {
      +        "properties": {
      +          "kept": {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          "rolls": {
      +            "items": {
      +              "type": "number"
      +            },
      +            "type": "array"
      +          },
      +          "subtotal": {
      +            "type": "number"
      +          },
      +          "term": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "times": {
      +      "type": "number"
      +    },
      +    "total": {
      +      "type": "number"
      +    },
      +    "totals": {
      +      "items": {
      +        "type": "number"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well past the annotations with hard limits (1,000 dice, 10,000 sides, times up to 100), the exact return contents (every die, kept dice, per-term subtotals, total, breakdown), and seed reproducibility semantics. One tension: annotations declare idempotentHint=true while the description explicitly says unseeded rolls are fresh each time — the description is the more accurate of the two, so this is an annotation imprecision rather than misleading prose.

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?

Front-loaded with the verb and notation grammar, then limits, then return shape, then seed semantics — a logical order with no filler sentences. It is dense as a single paragraph and re-lists schema examples, so it is efficient rather than maximally tight.

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?

For a read-only random generator with a full input schema and an output schema, everything an agent needs is present: notation grammar, caps, seed reproducibility, repeat semantics, and the fact that interpretation is the caller's job. Nothing material is left ambiguous.

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 the baseline is 3; the description still adds real meaning by explaining what kh3/kl1/dl1 do ('for disadvantage'), stating the dice-count and side limits, and clarifying that `times` yields min/max/mean. Some examples (2d6+3, 4d6kh3, d%) are repeated from the schema, which caps it below 5.

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?

States a concrete verb and resource ('roll tabletop dice notation with real randomness') and enumerates the supported notation families (NdS, keep/drop, exploding, fudge, percentile). The phrase 'real randomness' implicitly separates it from probability-style siblings such as dice_odds, and an agent can tell from the text alone that this tool produces actual rolls rather than computed odds.

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

Usage Guidelines4/5

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

Gives clear operational guidance: omit `seed` for a fresh roll, pass the returned seed to reproduce, use `times` when min/max/mean are wanted, and 'the calling agent decides what it means' clarifies that interpretation is out of scope. It never names an alternative tool (dice_odds, flip_coins) or states when not to use it, so it stops short of full when/when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.