Skip to main content
Glama

Cryptographically secure randomness

secure_random

Generate unbiased, cryptographically secure random bytes or uniform integers from a CSPRNG, with rejection sampling, for callers needing unpredictable randomness they cannot generate themselves.

Instructions

Cryptographically secure random values from a CSPRNG: either random bytes (hex and base64url) or uniform integers in an inclusive range. Integers are rejection-sampled, so the distribution is uniform rather than modulo-biased. For randomness nobody else could have seen, generate it yourself — this is for callers that cannot. Costs $0.003 USDC per call on Base mainnet (eip155:8453), paid automatically from the wallet in EVM_PRIVATE_KEY.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maxNoInclusive upper bound for integer mode. Requires min.
minNoInclusive lower bound for integer mode. Requires max.
bytesNoNumber of random bytes, 1..1024. Default 32. Ignored when min/max are given.
countNoHow many integers to draw, 1..1000. Default 1.
Behavior4/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It adds significant context: the randomness source (CSPRNG), the uniform distribution via rejection sampling (avoiding modulo bias), the cost ($0.003 USDC per call), the network (Base mainnet), and the payment mechanism (EVM_PRIVATE_KEY). This goes well beyond basic schema info, though it doesn't cover error handling or response format.

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?

The description is three sentences, each adding value: the first defines outputs, the second explains a statistical property, and the third covers use case and cost. It is front-loaded with the core purpose, contains no filler, and remains under the typical length limits.

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

Completeness4/5

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

Given the tool's moderate complexity and lack of output schema, the description covers the key contextual aspects: what it returns (bytes in hex/base64url, integers), how the randomization works, the cost, and the intended usage scenario. It falls short of a 5 because it doesn't precisely define the returned data structure or specify how to choose between hex vs base64url output, but it is sufficient for an agent to operate 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 the baseline is 3, but the description adds meaningful semantics by explaining the two operational modes: random bytes (when min/max are absent) and uniform integers (when min/max are provided). It also clarifies that integer generation is rejection-sampled to be uniform, which gives context for interpreting the min/max and count parameters beyond their schema definitions.

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 states the tool's function: generating cryptographically secure random bytes (hex/base64url) or uniform integers in an inclusive range. It uses a specific verb ('generate') and resource ('random values'), and the sibling tools are all unrelated (geocoding, search, etc.), making this tool's purpose distinct.

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?

The description provides clear usage context: 'For randomness nobody else could have seen, generate it yourself — this is for callers that cannot.' This tells the agent when to use the tool (when local generation isn't possible) and implies an alternative (self-generation). However, it doesn't explicitly enumerate alternative tools or exclusions beyond this contrast.

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/donnywin85/agent-utils-mcp'

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