Skip to main content
Glama
QianJue-CN

Random.org MCP Server

by QianJue-CN

getUsage

Retrieve API usage statistics to monitor your random data generation quota and track consumption patterns.

Instructions

Get API usage statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The MCP server handler for the 'getUsage' tool. It calls RandomOrgClient.getUsage() and returns the result formatted as JSON text content.
    private async handleGetUsage(args: any) {
      const result = await this.randomOrgClient.getUsage();
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • src/server.ts:255-262 (registration)
    Registration of the 'getUsage' tool in the ListTools response, including name, description, and empty input schema.
    {
      name: 'getUsage',
      description: 'Get API usage statistics',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • TypeScript interface defining the structure of the UsageResult returned by the Random.org API 'getUsage' endpoint.
    export interface UsageResult {
      status: string;
      creationTime: string;
      bitsLeft: number;
      requestsLeft: number;
      totalBits: number;
      totalRequests: number;
    }
  • Helper method in RandomOrgClient that makes the actual API request to Random.org's 'getUsage' endpoint using makeRequest.
    async getUsage(): Promise<UsageResult> {
      return this.makeRequest<UsageResult>('getUsage', {});
    }

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