cache
In-memory cache for successful Scholar answers.
Every uncached call costs a 5-15 s delay and one or more requests that count towards Scholar’s bot detection. Agents repeat lookups (the same paper, the same query), so answering those from memory is faster and makes a block less likely. Only successful results are stored; errors are never cached.
- class google_scholar_search_mcp.cache.TTLCache(ttl_seconds=3600.0, max_entries=256)[source]
Bases:
objectA small thread-safe LRU cache whose entries expire.
- get(key)[source]
Look up a fresh entry.
- Parameters:
key (Hashable) – Cache key.
- Returns:
Any | None – The stored value, or
Noneif absent or expired.- Return type:
Any | None