Skip to main content
Glama
QianJue-CN

Random.org MCP Server

by QianJue-CN

generateIntegerSequences

Generate true random integer sequences for simulations, cryptography, or statistical sampling by specifying count, length, and value ranges.

Instructions

Generate sequences of true random integers

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nYesNumber of sequences to generate (1-10,000)
lengthYesLength of each sequence (1-10,000)
minYesMinimum value (inclusive)
maxYesMaximum value (inclusive)
replacementNoAllow replacement within each sequence
baseNoNumber base (2, 8, 10, or 16)

Implementation Reference

  • MCP server handler function that calls the RandomOrgClient to generate integer sequences and formats the response as MCP content.
    private async handleGenerateIntegerSequences(args: any) {
      const result = await this.randomOrgClient.generateIntegerSequences(args);
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              data: result.random.data,
              completionTime: result.random.completionTime,
              bitsUsed: result.bitsUsed,
              bitsLeft: result.bitsLeft,
              requestsLeft: result.requestsLeft,
              advisoryDelay: result.advisoryDelay,
            }, null, 2),
          },
        ],
      };
    }
  • src/server.ts:77-121 (registration)
    Tool registration in the listTools handler, including name, description, and detailed input schema.
    {
      name: 'generateIntegerSequences',
      description: 'Generate sequences of true random integers',
      inputSchema: {
        type: 'object',
        properties: {
          n: {
            type: 'number',
            description: 'Number of sequences to generate (1-10,000)',
            minimum: 1,
            maximum: 10000,
          },
          length: {
            type: 'number',
            description: 'Length of each sequence (1-10,000)',
            minimum: 1,
            maximum: 10000,
          },
          min: {
            type: 'number',
            description: 'Minimum value (inclusive)',
            minimum: -1000000000,
            maximum: 1000000000,
          },
          max: {
            type: 'number',
            description: 'Maximum value (inclusive)',
            minimum: -1000000000,
            maximum: 1000000000,
          },
          replacement: {
            type: 'boolean',
            description: 'Allow replacement within each sequence',
            default: true,
          },
          base: {
            type: 'number',
            description: 'Number base (2, 8, 10, or 16)',
            enum: [2, 8, 10, 16],
            default: 10,
          },
        },
        required: ['n', 'length', 'min', 'max'],
      },
    },
  • Core client handler that validates input parameters and makes the HTTP request to Random.org API for generating integer sequences.
    async generateIntegerSequences(params: IntegerSequenceParams): Promise<IntegerSequenceResult> {
      this.validateIntegerSequenceParams(params);
      return this.makeRequest<IntegerSequenceResult>('generateIntegerSequences', params);
    }
  • TypeScript interface defining the input parameters for generateIntegerSequences, used for type safety.
    export interface IntegerSequenceParams {
      n: number;
      length: number;
      min: number;
      max: number;
      replacement?: boolean;
      base?: number;
    }
  • Validation helper function ensuring input parameters meet Random.org API constraints for integer sequences.
    private validateIntegerSequenceParams(params: IntegerSequenceParams): void {
      if (params.n < 1 || params.n > 10000) {
        throw new Error('n must be between 1 and 10,000');
      }
      if (params.length < 1 || params.length > 10000) {
        throw new Error('length must be between 1 and 10,000');
      }
      if (params.min < -1000000000 || params.min > 1000000000) {
        throw new Error('min must be between -1,000,000,000 and 1,000,000,000');
      }
      if (params.max < -1000000000 || params.max > 1000000000) {
        throw new Error('max must be between -1,000,000,000 and 1,000,000,000');
      }
      if (params.min >= params.max) {
        throw new Error('min must be less than max');
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While 'generate' implies creation, it doesn't specify whether this is a read-only operation, what permissions might be needed, rate limits, or what format the output takes. The 'true random' qualifier adds some context about randomness quality, but overall behavioral traits are minimally described.

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 extremely concise - a single sentence with no wasted words. It's front-loaded with the core purpose and efficiently communicates the essential function without unnecessary elaboration.

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

Completeness2/5

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

For a tool with 6 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the output looks like (e.g., format, structure), doesn't clarify the relationship with sibling tools, and provides minimal behavioral context despite the complexity of generating random sequences.

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 schema description coverage is 100%, providing comprehensive parameter documentation. The description adds no parameter-specific information beyond what's in the schema, so it meets the baseline expectation but doesn't enhance understanding of parameter meanings or relationships.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Generate sequences of true random integers' clearly states the verb ('generate') and resource ('sequences of true random integers'), but it doesn't distinguish this tool from its sibling 'generateIntegers' - both appear to generate random integers, making the purpose somewhat vague in context.

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

Usage Guidelines2/5

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

No guidance is provided about when to use this tool versus alternatives like 'generateIntegers' or other sibling tools. The description offers no context about appropriate use cases, prerequisites, or exclusions.

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/QianJue-CN/TRUERandomMCP'

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