Skip to main content
Glama
QianJue-CN

Random.org MCP Server

by QianJue-CN

getUsage

Retrieve API usage statistics for the Random.org MCP Server to monitor your true random number generation consumption and track remaining quota.

Instructions

Get API usage statistics

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'getUsage': fetches usage stats from Random.org client and formats the result 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), }, ], }; }
  • TypeScript interface defining the structure of the usage result returned by the Random.org API.
    export interface UsageResult { status: string; creationTime: string; bitsLeft: number; requestsLeft: number; totalBits: number; totalRequests: number; }
  • src/server.ts:255-262 (registration)
    Registration of the 'getUsage' MCP tool, including name, description, and empty input schema (no parameters required).
    { name: 'getUsage', description: 'Get API usage statistics', inputSchema: { type: 'object', properties: {}, }, },
  • Helper method in RandomOrgClient that sends the 'getUsage' request to the Random.org API via 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