HTTP 400
invalid_content_length

Invalid Content-Length

The MCP request contains an invalid Content-Length header.

Resolution

Send a valid non-negative Content-Length value or let the HTTP client set it.

Response handling

Keep the response's request_id for diagnostics. Retry only transient rate limits and 503 responses, respecting Retry-After with bounded exponential backoff and jitter. For monthly_quota_exceeded, stop polling until RateLimit-Reset or upgrade. Correct 400, 401, 403, and 406 requests before retrying.