Skip to main content
Glama
cordlesssteve

Claude Telemetry MCP

get_usage_summary

Retrieve session, daily, and weekly usage analytics to monitor Claude Code token consumption, costs, and tool patterns.

Instructions

Get comprehensive usage summary for session, today, and this week in one call

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP tool handler for 'get_usage_summary' in CallToolRequestSchema. Delegates to telemetryService.getUsageSummary() and formats response with formatUsageSummary.
    case 'get_usage_summary': {
      const summary = await this.telemetryService.getUsageSummary();
      return {
        content: [
          {
            type: 'text',
            text: this.formatUsageSummary(summary),
          },
        ],
      };
    }
  • Core logic implementation: aggregates current session, today, and weekly usage data into a UsageSummary object.
    async getUsageSummary(): Promise<UsageSummary> {
      const [currentSession, today, thisWeek] = await Promise.all([
        this.getCurrentSessionUsage(),
        this.getTodayUsage(),
        this.getWeekUsage()
      ]);
    
      return {
        currentSession,
        today,
        thisWeek,
        period: {
          start: this.getStartOfWeek().toISOString(),
          end: new Date().toISOString()
        }
      };
    }
  • Helper function to format the UsageSummary into a readable markdown text response.
    private formatUsageSummary(summary: UsageSummary): string {
      let result = '# Usage Summary\n\n';
      
      result += this.formatUsageData('Current Session', summary.currentSession) + '\n\n';
      result += this.formatUsageData('Today', summary.today) + '\n\n';
      result += this.formatUsageData('This Week', summary.thisWeek) + '\n\n';
      
      result += `**Period**: ${new Date(summary.period.start).toLocaleDateString()} - ${new Date(summary.period.end).toLocaleDateString()}`;
      
      return result;
    }
  • src/index.ts:63-69 (registration)
    Tool registration entry in the ListToolsRequestHandler response, defining name, description, and input schema (no parameters).
      name: 'get_usage_summary',
      description: 'Get comprehensive usage summary for session, today, and this week in one call',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    },
  • TypeScript interface defining the structure of the UsageSummary return type used by the tool.
    export interface UsageSummary {
      currentSession: UsageData;
      today: UsageData;
      thisWeek: UsageData;
      period: {
        start: string;
        end: string;
      };
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool retrieves a summary but doesn't describe what 'comprehensive' entails, potential rate limits, authentication needs, or the format of the returned data. This leaves significant gaps for a tool with no annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the key information: 'Get comprehensive usage summary for session, today, and this week in one call.' It has zero waste and is appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 0 parameters and no output schema, the description provides basic purpose but lacks details on behavioral aspects like data format or limitations. With no annotations to supplement, it's minimally adequate but leaves gaps in understanding how the tool behaves or what it returns.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, and the baseline for 0 parameters is 4, as it avoids unnecessary details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get comprehensive usage summary for session, today, and this week in one call.' It specifies the verb ('Get'), resource ('usage summary'), and scope ('session, today, and this week in one call'). However, it doesn't explicitly differentiate from siblings like 'get_today_usage' or 'get_week_usage' beyond implying comprehensiveness.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by mentioning 'comprehensive usage summary... in one call,' suggesting efficiency for aggregated data. However, it doesn't provide explicit guidance on when to use this tool versus alternatives like 'get_today_usage' or 'get_week_usage,' nor does it mention any exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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