get_usage
Check your API usage quota for the current billing month to track consumption and avoid exceeding limits.
Instructions
Check your API usage quota for the current billing month
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:320-327 (handler)The handler function for the get_usage tool. It calls client.request('GET', '/v1/usage') to retrieve API usage quota data and returns the JSON result, or an error on failure.
async () => { try { const result = await client.request("GET", "/v1/usage"); return jsonResult(result); } catch (err) { return errorResult(err); } }, - src/tools.ts:308-328 (registration)Registration of the 'get_usage' tool via server.tool() with description, empty schema (no parameters), metadata hints (readOnly, idempotent, etc.), and the handler callback.
// 7. get_usage server.tool( "get_usage", "Check your API usage quota for the current billing month", {}, { title: "Get API Usage", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, async () => { try { const result = await client.request("GET", "/v1/usage"); return jsonResult(result); } catch (err) { return errorResult(err); } }, ); - src/tools.ts:310-312 (schema)Tool name 'get_usage' with description 'Check your API usage quota for the current billing month' and an empty schema object (no input parameters).
"get_usage", "Check your API usage quota for the current billing month", {},