get_usage
Check your organization's plan and remaining allowance for documents, verifications, chat messages, and generated media before starting expensive batch operations.
Instructions
Check the organization's current plan, quota, and remaining allowance for documents, verifications, chat messages, and generated media. Call before kicking off expensive batch operations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/get_usage.ts:1-12 (handler)The main tool definition for 'get_usage'. Uses defineTool to create a tool that calls GET /v1/usage via the client to check the organization's current plan, quota, and remaining allowance.
import { z } from "zod"; import { defineTool } from "./types.js"; const Input = z.object({}).describe("No arguments."); export const getUsage = defineTool({ name: "get_usage", description: "Check the organization's current plan, quota, and remaining allowance for documents, verifications, chat messages, and generated media. Call before kicking off expensive batch operations.", inputSchema: Input, handler: async (_input, { client }) => client.get("/v1/usage"), }); - src/tools/get_usage.ts:4-4 (schema)Input schema: an empty Zod object (no arguments required) with description 'No arguments.'
const Input = z.object({}).describe("No arguments."); - src/tools/index.ts:9-9 (registration)Import of the getUsage tool from its module.
import { getUsage } from "./get_usage.js"; - src/tools/index.ts:19-19 (registration)Registration of getUsage in the tools array, making it available as an MCP tool.
getUsage, - src/tools/types.ts:17-24 (helper)The defineTool helper function used to define the get_usage tool with proper typing.
export function defineTool<Input extends z.ZodTypeAny>(t: { name: string; description: string; inputSchema: Input; handler: (input: z.infer<Input>, ctx: ToolContext) => Promise<unknown>; }): ToolDef { return t as unknown as ToolDef; }