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