Expand description
ToolCache — lazily populated, refresh-on-demand tool schema store.
The cache is populated on the first call to ToolCache::get_all and
reused for subsequent calls. Explicit ToolCache::refresh forces a
re-fetch from the backend.
Include/exclude filters are applied at population time, so every read after the initial fetch sees only the filtered view.
§Concurrency
ToolCache uses a tokio::sync::RwLock for the cached data. Multiple
concurrent readers do not block each other. A write (populate or refresh)
acquires an exclusive lock. Double-checked locking prevents redundant
backend fetches when multiple tasks race to populate the cache.
Structs§
- Tool
Cache - Lazily-populated, thread-safe tool schema cache.
Traits§
- Tool
Backend - Abstraction over the upstream MCP client used in tests and production.