get_rate_limit_status
Check real-time rate limit status and usage quotas for deployments in Optimizely DXP MCP Server to manage API request thresholds effectively.
Instructions
View current rate limiting status and usage quotas
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | ||
| projectName | No |
Implementation Reference
- lib/rate-limiter.ts:57-68 (schema)Type definition (schema) for the RateLimitStatus object returned by the tool implementation.interface RateLimitStatus { projectId: string; requestsLastMinute: number; requestsLastHour: number; maxRequestsPerMinute?: number; maxRequestsPerHour?: number; isThrottled: boolean; throttleRetryAfter?: number; consecutiveFailures: number; backoffUntil: number | null; lastRequest: number; }
- lib/rate-limiter.ts:512-544 (handler)Core handler function that computes and returns the current rate limit status for a given project ID. This is the primary logic executed for the get_rate_limit_status tool.getStatus(projectId: string): RateLimitStatus { const now = Date.now(); const limits = this.projectLimits.get(projectId); const throttle = this.throttleState.get(projectId); if (!limits) { return { projectId, requestsLastMinute: 0, requestsLastHour: 0, isThrottled: false, consecutiveFailures: 0, backoffUntil: null, lastRequest: 0 }; } const oneMinuteAgo = now - (60 * 1000); const oneHourAgo = now - (60 * 60 * 1000); return { projectId, requestsLastMinute: limits.requests.filter(r => r.timestamp > oneMinuteAgo).length, requestsLastHour: limits.requests.filter(r => r.timestamp > oneHourAgo).length, maxRequestsPerMinute: this.options.maxRequestsPerMinute, maxRequestsPerHour: this.options.maxRequestsPerHour, isThrottled: throttle ? throttle.retryAfter > now : false, throttleRetryAfter: throttle?.retryAfter, consecutiveFailures: limits.consecutiveFailures, backoffUntil: limits.backoffUntil > now ? limits.backoffUntil : null, lastRequest: limits.lastRequest }; }
- lib/utils/tool-availability-matrix.ts:334-338 (registration)Tool registration/availability declaration in the TOOL_MATRIX, marking it as a Monitoring tool available across all hosting types.'get_rate_limit_status': { hostingTypes: ['dxp-paas', 'dxp-saas', 'self-hosted', 'unknown'], category: 'Monitoring', description: 'Get rate limit status' },
- lib/cache-manager.ts:100-100 (helper)Configuration marking get_rate_limit_status as a no-cache operation since it requires real-time data.'get_rate_limit_status',