mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
🔧 fix: Invalidate Tool Caching after MCP Initialization (#8384)
- Added Constants import in PluginController for better organization. - Renamed cachedTools to cachedToolsArray for clarity in PluginController. - Ensured getCachedTools returns an empty object if no tools are found. - Cleared tools array cache after MCP initialization in initializeMCP for consistency.
This commit is contained in:
parent
e4531d682d
commit
8523074e87
2 changed files with 8 additions and 6 deletions
|
|
@ -44,6 +44,9 @@ async function initializeMCP(app) {
|
|||
await mcpManager.mapAvailableTools(toolsCopy, flowManager);
|
||||
await setCachedTools(toolsCopy, { isGlobal: true });
|
||||
|
||||
const cache = getLogStores(CacheKeys.CONFIG_STORE);
|
||||
await cache.delete(CacheKeys.TOOLS);
|
||||
logger.debug('Cleared tools array cache after MCP initialization');
|
||||
logger.info('MCP servers initialized successfully');
|
||||
} catch (error) {
|
||||
logger.error('Failed to initialize MCP servers:', error);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue