Skip to main content
Glama

util_random

Read-only

True random numbers, picks, shuffles, dice and tokens — Real randomness for agents (language models are bad at it). mode=int (min, max, count up to 1000, unique=true for no repeats), float (min, max, decimals), normal (mean, sd), pick or sample (items= list separated by newlines, | or commas; count, replace=true, weights= one number per item), shuffle (items=), coin (count), dice (roll= standard notation: 3d6+2, 2d20kh1 advantage, 4d6dl1, d%, 1d8-1d4; count up to 100 rolls; returns every die, kept dice, total, min and max possible), token (length, alphabet hex|base64url|base58|alnum|alpha|lower|numeric|crockford or chars=; entropy bits), date or datetime (start, end, weekdays=true). Mode is inferred from roll= or items= if omitted. Uses crypto.getRandomValues with unbiased rejection sampling; pass seed= for reproducible results (sfc32 PRNG - same seed, same output; never use seeded output as a secret). Offline. Price: $0.001 USDC (Base, via x402).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "mode": "<mode>",
      "roll": "<roll>"
    },
    "name": "util_random"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeYesdice
rollYes4d6dl1

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond the annotations: discloses the RNG source (crypto.getRandomValues with unbiased rejection sampling), the seeded sfc32 PRNG with a reproducibility guarantee and a security caveat, hard limits (count up to 1000, 100 rolls), an offline-execution claim, and a payment requirement ($0.001 USDC on Base via x402) that the annotations never mention. The only tension is 'Offline' versus openWorldHint=true, but that reads as an annotation mislabel rather than the description contradicting declared safety semantics.

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

Conciseness3/5

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

Front-loaded with purpose and free of filler, but the body is a single semicolon-chained run-on that packs nine modes into one paragraph, making mode-specific arguments hard to scan. A bulleted or line-per-mode layout would carry the same information at far lower parsing cost.

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 multi-mode generator with no output schema, the description covers the important ground: mode-by-mode arguments, what dice rolls return (every die, kept dice, total, min/max possible), and the reproducibility and cost model. Nothing needed to call it correctly for a given mode is missing from the prose.

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

Parameters3/5

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

The prose documents a large argument surface (min, max, count, unique, items, weights, replace, length, alphabet, start, end, weekdays, seed) that the schema does not expose at all — only mode and roll exist, and their schema descriptions are bare example values ('dice', '4d6dl1'). Worse, the schema marks both mode and roll as required while the description says mode is inferred when omitted and roll applies only to dice mode, so an agent following the schema will mis-invoke non-dice modes.

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?

Opens with a concrete verb+resource list: true random numbers, picks, shuffles, dice, tokens, and explicitly frames the value proposition ('language models are bad at it'). No sibling in the catalog (util_distribution, util_calc, util_convert, etc.) overlaps this behavior, so an agent can route to it unambiguously.

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 when-to-use framing ('Real randomness for agents — language models are bad at it') and detailed mode-selection guidance, including inference rules ('Mode is inferred from roll= or items= if omitted') and a when-NOT-to-use-security warning ('never use seeded output as a secret'). It does not name an alternative tool or state exclusion cases, which keeps it out of 5 territory.

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.

Resources