Skip to main content
Glama
mehmetfiskindal

Cursor Pro Limits MCP Server

get_service_usage

Check usage statistics for Sonnet 4.5, Gemini, or GPT-5 services to monitor API quotas and track request consumption against subscription limits.

Instructions

Get usage statistics for a specific service

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYesService to check usage for

Implementation Reference

  • MCP tool handler for 'get_service_usage': validates service input, delegates to monitor.getServiceUsage, formats and returns markdown response with status, usage details, and alerts.
    private async handleGetServiceUsage(args: { service: string }) { const { service } = args; if (!['sonnet45', 'gemini', 'gpt5', 'total'].includes(service)) { throw new Error( 'Invalid service. Must be one of: sonnet45, gemini, gpt5, total' ); } const usage = this.monitor.getServiceUsage( service as 'sonnet45' | 'gemini' | 'gpt5' | 'total' ); const status = usage.isCritical ? '🔴 CRITICAL' : usage.isWarning ? '🟡 WARNING' : '🟢 OK'; const content = ` # ${service.toUpperCase()} Service Usage ## Status: ${status} - **Current**: ${usage.current} - **Maximum**: ${usage.max} - **Percentage**: ${usage.percentage.toFixed(1)}% - **Remaining**: ${usage.remaining} ${usage.isCritical ? '⚠️ This service is at or near its limit!' : ''} ${usage.isWarning ? '⚠️ This service is approaching its limit.' : ''} `.trim(); return { content: [ { type: 'text', text: content, }, ], }; }
  • src/index.ts:48-62 (registration)
    Tool registration in ListTools response, defining name, description, and input schema with service enum.
    { name: 'get_service_usage', description: 'Get usage statistics for a specific service', inputSchema: { type: 'object', properties: { service: { type: 'string', enum: ['sonnet45', 'gemini', 'gpt5', 'total'], description: 'Service to check usage for', }, }, required: ['service'], }, },
  • Core helper method implementing service usage computation: retrieves stats, current/max values, percentage, remaining requests, and warning/critical flags.
    public getServiceUsage( service: 'sonnet45' | 'gemini' | 'gpt5' | 'total' ): ServiceUsage { const stats = this.getUsageStats(); const current = this.getCurrentUsage(service); const max = this.getMaxUsage(service); const percentage = stats.usagePercentages[service]; const remaining = stats.remaining[service]; return { service, current, max, percentage, remaining, isWarning: percentage >= 0.8, isCritical: percentage >= 0.95, }; }
  • Type definitions for ServiceType enum and ServiceUsage interface used in getServiceUsage output.
    export type ServiceType = 'sonnet45' | 'gemini' | 'gpt5' | 'total'; export interface ServiceUsage { service: ServiceType; current: number; max: number; percentage: number; remaining: number; isWarning: boolean; isCritical: boolean; }

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/mehmetfiskindal/cursor-pro-limits-mcp'

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