Skip to main content
Glama
cordlesssteve

Claude Telemetry MCP

estimate_remaining_capacity

Calculate available usage capacity by estimating remaining tokens against daily or weekly limits for Claude Code sessions.

Instructions

Estimate remaining usage capacity for specified daily/weekly limits

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
daily_token_limitNoDaily token limit for capacity estimation
weekly_token_limitNoWeekly token limit for capacity estimation

Implementation Reference

  • The main handler logic for the 'estimate_remaining_capacity' tool. It retrieves the usage summary, calculates remaining tokens for daily and weekly limits based on input arguments, formats the result as markdown, and returns it.
    case 'estimate_remaining_capacity': {
      const summary = await this.telemetryService.getUsageSummary();
      const dailyLimit = typeof args?.daily_token_limit === 'number' ? args.daily_token_limit : undefined;
      const weeklyLimit = typeof args?.weekly_token_limit === 'number' ? args.weekly_token_limit : undefined;
    
      let result = '## Remaining Capacity Estimation\n\n';
      
      if (dailyLimit) {
        const remaining = Math.max(0, dailyLimit - summary.today.tokens);
        const percentage = (remaining / dailyLimit) * 100;
        result += `**Daily**: ${remaining.toLocaleString()} tokens remaining (${percentage.toFixed(1)}%)\n`;
      }
    
      if (weeklyLimit) {
        const remaining = Math.max(0, weeklyLimit - summary.thisWeek.tokens);
        const percentage = (remaining / weeklyLimit) * 100;
        result += `**Weekly**: ${remaining.toLocaleString()} tokens remaining (${percentage.toFixed(1)}%)\n`;
      }
    
      if (!dailyLimit && !weeklyLimit) {
        result += 'Please specify daily_token_limit and/or weekly_token_limit for capacity estimation.';
      }
    
      return {
        content: [
          {
            type: 'text',
            text: result,
          },
        ],
      };
    }
  • src/index.ts:113-130 (registration)
    Registration of the 'estimate_remaining_capacity' tool in the ListTools response, including its name, description, and input schema definition.
    {
      name: 'estimate_remaining_capacity',
      description: 'Estimate remaining usage capacity for specified daily/weekly limits',
      inputSchema: {
        type: 'object',
        properties: {
          daily_token_limit: {
            type: 'number',
            description: 'Daily token limit for capacity estimation',
          },
          weekly_token_limit: {
            type: 'number',
            description: 'Weekly token limit for capacity estimation',
          },
        },
        required: [],
      },
    },

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/cordlesssteve/claude-telemetry-mcp'

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