check_alerts
Monitor Cursor Pro usage limits and API quotas for Sonnet 4.5, Gemini, and GPT-5 services to receive alerts when approaching subscription thresholds.
Instructions
Check for services approaching or exceeding limits
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "check_alerts"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:255-303 (handler)Primary MCP tool handler for 'check_alerts'. Calls monitor.checkAlerts(), formats alerts into Markdown summary with status emojis and details if any, or no-alerts message.
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)Tool registration in ListTools response: defines name 'check_alerts', description, and empty input schema (no parameters required).
{ name: 'check_alerts', description: 'Check for services approaching or exceeding limits', inputSchema: { type: 'object', properties: {}, }, }, - src/cursorLimitsMonitor.ts:172-183 (helper)Helper method in CursorLimitsMonitor that checks all services for warning (>=80%) or critical (>=95%) usage and returns array of ServiceUsage for alerting services.
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); } - src/types.ts:73-81 (schema)TypeScript interface defining ServiceUsage structure used for alert outputs, including flags for warning and critical thresholds.
export interface ServiceUsage { service: ServiceType; current: number; max: number; percentage: number; remaining: number; isWarning: boolean; isCritical: boolean; }