Dice Roller

v0.2.1
io.github.pipeworx-io/dice-roller Checked 4 days ago Published 1 month ago

dice-roller — tabletop dice, coin flips and exact dice odds on the Pipeworx chance engine…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

roll_dice

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.

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

flip_coins

Pipeworx dice engine: flip fair coins with real randomness — up to 1,000 per call. Returns the sequence (H/T), heads and tails counts, and the longest run. Omit `seed` for fresh flips; pass the returned `seed` to reproduce them exactly. The outcome is random — the calling agent decides what it means.

ParameterTypeDescription
countintegerNumber of coins to flip (default 1, max 1000).
seedstringOptional seed. Same seed + same count = same flips. Omit for fresh flips; the seed used is always returned.

dice_odds

Pipeworx dice engine: the probability distribution of a dice notation (same grammar as roll_dice: 2d6+3, 4d6kh3, 2d20kl1, 4dF, 3d6!) — min, max, mean, standard deviation, mode, the probability of every total and, given `target`, the chance the total is >=, >, <=, < or == that target (e.g. "what are the odds of 15 or more on 3d6"). Exact by enumeration where the outcomes can be enumerated (plain sums, and keep/drop pools up to 1,000,000 outcomes); otherwise a 100,000-sample Monte Carlo estimate labelled method:"monte_carlo" (exploding dice always use it). `seed` makes a Monte Carlo estimate r…

ParameterTypeDescription
notation *stringDice notation, e.g. "3d6", "4d6kh3", "2d20kh1+5".
comparisonstringHow the total is compared with target (default ">=").
seedstringOptional seed for the Monte Carlo path; exact results ignore it. Always returned.
targetnumberOptional target total to compute a probability for.