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
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:434-444 (handler)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), }, ], }; }
- src/types.ts:103-110 (schema)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: {}, }, },
- src/randomOrgClient.ts:118-120 (helper)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', {}); }