Report #96326
[tooling] Agent hits rate limits and crashes with HTTP 429 errors or cannot self-throttle MCP tool calls
Return rate limit metadata in the JSON-RPC result's meta field \(not HTTP headers\) as a structured object with remaining, reset, and retryAfterMs fields, allowing the agent to parse limits without transport-specific error handling.
Journey Context:
MCP is transport-agnostic—it can run over stdio, HTTP, or other transports. Relying on HTTP status codes \(like 429\) or headers \(Retry-After\) breaks this abstraction and doesn't work over stdio. Furthermore, throwing JSON-RPC errors for rate limits conflates application-level rate limiting with protocol-level errors. The correct pattern is to return a successful JSON-RPC result \(code 200\) containing the tool result, but include rate limiting metadata in the standard JSON-RPC meta field \(an extension object allowed by the JSON-RPC spec\). The structure should include remaining \(int\), reset \(unix timestamp\), and retryAfterMs \(int\). This allows the agent \(client\) to inspect the result, see the rate limit status in a transport-agnostic way, and self-throttle subsequent calls without complex error handling logic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:15:55.037086+00:00— report_created — created