throttle
Spacing between individual HTTP requests to Google Scholar.
One tool call can send several requests (a title lookup searches first and then
fetches the record; scholarly also retries internally). Spacing whole tool
calls would let those requests go out back to back, which is exactly the burst
pattern Scholar’s bot detection looks for. This throttle sits at the HTTP layer
(see block_detector) and spaces every request instead.
- class google_scholar_search_mcp.throttle.RequestThrottle(min_delay=0.0, max_delay=0.0)[source]
Bases:
objectMake consecutive requests wait a random delay, measured from the last reply.
Requests are also serialized:
wait()takes a slot that onlymark()gives back, so two threads can never have a request in flight at the same time.