RPG dice engine — expression parser, probability analyzer, loot tables, beautiful terminal output
Roll demonstrates solid tool design with complete input schemas, clear descriptions, and domain-specific expertise. All 6 tools have explicit definitions with proper JSON Schema. Descriptions are detailed (100-300 chars) and explain WHAT the tool does and WHEN to use it. However, parameter descriptions lack depth, many are terse (e.g., 'Dice expression to analyze') without format guidance or constraints. Output schemas are undocumented, forcing LLMs to infer result structure. Error handling and recovery guidance are absent. Naming is verb-forward and clear (roll_, analyze_, compare_, query_). No security issues detected (read-only tools, no secrets). Composition is sound, each tool has one responsibility and tools chain naturally (e.g., analyze_dice → roll_dice).
Compute the probability distribution and statistics for a dice expression. Returns mean, median, mode, std dev, percentiles, entropy, the full distribution, and a `method` field ("exact" for a closed-form result, or "monte-carlo" with a `samples` count when the expression is too complex for exact analysis and was sampled). Optionally computes P(result >= target), P(result <= target), P(result == target), and P(lo <= result <= hi) so you get the whole query family in one call.
Analyze a game table for a given context: returns each ELIGIBLE entry's real selection probability (matching the engine's weighted rolls), the value mean + full value distribution of any roll/quantity dice, and the EXCLUDED entries with the reason each was filtered out (level gate / condition). The headline tool for AI-driven balance work — see the odds of every drop without rolling.
Compare two dice expressions side by side. Returns statistics for both (mean, median, mode, std dev, range, entropy) PLUS a `versus` verdict: P(A>B), P(tie), P(B>A), and the mean margin (A - B) — the win-probability head-to-head.
Inspect a game table definition. Returns the table's entries, conditions, and metadata without rolling.
Roll a dice expression using full RPG notation. Supports: NdM, keep/drop (kh/kl/dh/dl), exploding (!), compounding (!!), penetrating (!p), reroll (r/ro), min/max, success counting (cs>=N), failure counting (cf<=N), sorting (sa/sd). Returns individual die results and total.
Output schemas are not documented. LLMs cannot infer what fields roll_dice, analyze_dice, or analyze_table return, forcing them to guess at result structure and downstream field names.
Parameter descriptions are terse and lack format/constraint guidance. 'Dice expression to analyze' does not explain valid syntax, examples, or error cases. 'Optional context' does not document the structure of context objects.
No error handling or recovery guidance. If an LLM passes an invalid dice expression (e.g., '99d999'), the tool will fail but the error response does not guide the LLM to correct syntax or suggest alternatives.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 59 | <=2025-11-25 | v2 |
Roll on a game table (loot, encounter, critical, fumble, reward, status, event). Supports weighted selection, conditions, level filtering, nested tables, chains, and dice expressions for quantity/roll/duration.
Table tools accept 'collection' as a raw JSON object parameter. This forces the LLM to construct or pass entire GameTableCollection structures inline, which is error-prone and wastes tokens. Consider accepting a table_id or URL instead.
No pagination or result limits documented. If analyze_table returns a large distribution or many excluded entries, the response could bloat the context window. Specify max result counts and pagination strategy.