Skip to main content
Glama

Generar token aleatorio

random-token
Read-only

Genera un token aleatorio de 1 a 256 bytes en hex, base64url o base58. Cuándo: hay que generar un identificador en este formato o leer los campos que lleva dentro. No para: generar IDs aleatorios compactos y seguros para URL (nanoid). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). No determinista: aleatorio salvo que se dé seed. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.

EN: Generates a random token of 1-256 bytes encoded as hex, base64url or base58, e.g. for API keys or nonces. A seed is meant only for test fixtures. When: an identifier has to be generated in this format or its embedded fields decoded. Not for: generating compact URL-safe random IDs (nanoid). Side effects: none (read-only, no network access, no stored state). Not deterministic: random unless seed is given. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.

Input Schema

NameRequiredDescriptionDefault
seedNoOptional seed. With a seed the output is reproducible; without one, cryptographically random bytes are used (string; optional; up to 256 chars).
bytesNoNumber of random bytes (integer; optional; default 32; min 1; max 256).
encodingNoOutput encoding (optional; one of: hex, base64url, base58; default "hex").hex

Output Schema

NameRequiredDescriptionDefault
bitsNo
avisoNo
tokenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedOutput schema / properties / aviso
      Added value: +{
      +  "type": [
      +    "null",
      +    "string"
      +  ]
      +}
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

While annotations cover the safety hints, the description adds critical behavioral context not covered by structured data, specifically stating that the tool is non-deterministic unless a seed is provided. It also clearly outlines operational limits (64KB input, 1s call time, 1MB result).

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 highly effective and structured, moving logically from the core function to its intended use, its limitations (nanoid), and operational constraints. It avoids fluff and is organized for maximum information density.

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?

Given the parameters and annotations, the description provides all necessary contextual information for an agent to safely and accurately select this tool, especially regarding its non-deterministic nature and performance limits.

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?

Given 100% schema coverage, the baseline is high. The description adds semantic value by explaining the *effect* of the seed parameter: that it allows the output to be reproducible for test fixtures, a functional detail beyond the basic type definition in the schema.

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 is highly specific, stating that it generates a random token within a specific range (1-256 bytes) and lists the exact encoding options (hex, base64url, base58). This clearly defines its scope and purpose.

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

Usage Guidelines5/5

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

The description provides excellent guidance by explicitly stating when to use the tool ('when: an identifier has to be generated in this format') and providing a strong negative constraint ('not for: generating compact URL-safe random IDs (nanoid)').

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