get_usage
Monitor Claude Pro/Max subscription usage by checking session limits, weekly quotas across models, and available credits to manage API consumption.
Instructions
Get a full dashboard of your Claude Pro/Max subscription usage: session limits, weekly limits (all models, Opus, Sonnet), and extra usage credits.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:18-39 (handler)The implementation of the get_usage tool handler, which fetches usage data using fetchUsage and formats it with formatFullUsage.
server.tool( "get_usage", "Get a full dashboard of your Claude Pro/Max subscription usage: session limits, weekly limits (all models, Opus, Sonnet), and extra usage credits.", {}, async () => { const result = await fetchUsage(); if (!result.data) { return { content: [{ type: "text", text: result.error ?? "Failed to fetch usage data." }], isError: true, }; } let output = formatFullUsage(result.data, result.source); if (result.error) { output += `\n\nNote: ${result.error}`; } return { content: [{ type: "text", text: output }] }; } );