Skip to main content
Glama
mehmetfiskindal

Cursor Pro Limits MCP Server

get_service_usage

Check usage statistics for AI services (Sonnet 4.5, Gemini, GPT-5) to monitor API quotas and subscription limits in real-time.

Instructions

Get usage statistics for a specific service

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serviceYesService to check usage for

Implementation Reference

  • The primary handler function for the 'get_service_usage' tool. It validates the input service parameter, fetches the usage data from the CursorLimitsMonitor, determines the status (OK/WARNING/CRITICAL), formats a detailed markdown response, and returns it.
      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,
            },
          ],
        };
      }
  • Type definition for ServiceUsage, which represents the output structure returned by the tool handler and the getServiceUsage helper.
    export interface ServiceUsage {
      service: ServiceType;
      current: number;
      max: number;
      percentage: number;
      remaining: number;
      isWarning: boolean;
      isCritical: boolean;
    }
  • src/index.ts:48-62 (registration)
    Registration of the 'get_service_usage' tool in the ListTools response, including name, description, and JSON input schema for validation.
    {
      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'],
      },
    },
  • Type definition for ServiceType, used in the input schema enum and ServiceUsage interface.
    export type ServiceType = 'sonnet45' | 'gemini' | 'gpt5' | 'total';
  • Helper method in CursorLimitsMonitor that computes detailed usage statistics for a specific service, including current usage, max quota, percentage, remaining, 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,
      };
    }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a 'Get' operation, implying read-only behavior, but doesn't clarify authentication needs, rate limits, error conditions, or what the statistics include (e.g., time range, metrics). This leaves significant gaps for a tool that likely returns data.

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 directly states the tool's function without unnecessary words. It is appropriately sized and front-loaded, making it easy to parse quickly.

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

Completeness2/5

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

Given no annotations and no output schema, the description is incomplete for a tool that returns usage statistics. It doesn't explain what the statistics include (e.g., counts, dates, units), potential limitations, or how to interpret results, leaving the agent with insufficient context for effective use.

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

Parameters3/5

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

The input schema has 100% description coverage, with the 'service' parameter fully documented via its enum and description. The tool description adds no additional parameter information beyond what the schema provides, so it meets the baseline for high schema coverage without compensating value.

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 verb 'Get' and the resource 'usage statistics for a specific service', making the purpose immediately understandable. However, it doesn't distinguish this tool from its sibling 'get_usage_stats', which appears to be a similar usage-related tool, preventing a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'get_usage_stats' or 'check_alerts'. It lacks context about prerequisites, timing, or exclusions, leaving the agent with minimal usage direction.

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

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