check_alerts
Monitor Cursor Pro usage limits and API quotas across AI services like Sonnet 4.5, Gemini, and GPT-5. Get alerts when approaching subscription limits to prevent service interruptions.
Instructions
Check for services approaching or exceeding limits
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:255-303 (handler)MCP tool handler for 'check_alerts': fetches alerts from monitor and returns formatted markdown response with summary and details.private async handleCheckAlerts() { const alerts = this.monitor.checkAlerts(); if (alerts.length === 0) { return { content: [ { type: 'text', text: '✅ No alerts - all services are within normal limits.', }, ], }; } const alertContent = alerts .map(alert => { const status = alert.isCritical ? '🔴 CRITICAL' : '🟡 WARNING'; return `- **${alert.service.toUpperCase()}**: ${status} (${alert.percentage.toFixed(1)}% used)`; }) .join('\n'); const content = ` # Alert Summary ${alertContent} ## Details ${alerts .map(alert => ` ### ${alert.service.toUpperCase()} - Current: ${alert.current}/${alert.max} - Percentage: ${alert.percentage.toFixed(1)}% - Remaining: ${alert.remaining} - Status: ${alert.isCritical ? 'CRITICAL' : 'WARNING'} `.trim() ) .join('\n')} `.trim(); return { content: [ { type: 'text', text: content, }, ], }; }
- src/index.ts:63-70 (registration)Registration of 'check_alerts' tool in ListTools response, including name, description, and empty input schema.{ name: 'check_alerts', description: 'Check for services approaching or exceeding limits', inputSchema: { type: 'object', properties: {}, }, },
- src/cursorLimitsMonitor.ts:172-183 (helper)Core implementation logic: iterates over services, computes usage, filters for warning (≥80%) or critical (≥95%) levels.public checkAlerts(): ServiceUsage[] { const services: Array<'sonnet45' | 'gemini' | 'gpt5' | 'total'> = [ 'sonnet45', 'gemini', 'gpt5', 'total', ]; return services .map(service => this.getServiceUsage(service)) .filter(usage => usage.isWarning || usage.isCritical); }