Skip to main content
Glama
Orellius

claudeusage-mcp

get_weekly_limits

Retrieve your 7-day weekly usage limits for Claude models, including breakdowns for Opus, Sonnet, and combined totals.

Instructions

Get your 7-day weekly usage limits broken down by model: all models combined, Opus, and Sonnet.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The registration and handler implementation for the 'get_weekly_limits' tool in src/index.ts. It calls fetchUsage() and formats the output using formatWeeklyLimits().
    server.tool(
      "get_weekly_limits",
      "Get your 7-day weekly usage limits broken down by model: all models combined, Opus, and Sonnet.",
      {},
      async () => {
        const result = await fetchUsage();
    
        if (!result.data) {
          return {
            content: [{ type: "text", text: result.error ?? "Failed to fetch usage data." }],
            isError: true,
          };
        }
    
        return { content: [{ type: "text", text: formatWeeklyLimits(result.data) }] };
      }
  • The helper function 'formatWeeklyLimits' which processes the usage data to produce the formatted string for the 'get_weekly_limits' tool.
    export function formatWeeklyLimits(data: UsageResponse): string {
      const lines: string[] = [];
      lines.push("=== Weekly Limits (7-day) ===");
      lines.push("");
    
      lines.push(formatWindow("All Models", data.seven_day));
      lines.push("");
    
      if (data.seven_day_opus !== undefined) {
        lines.push(formatWindow("Opus Only", data.seven_day_opus));
        lines.push("");
      }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Orellius/claudeusage-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server