mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🐛 fix: Error Handling in MCP Tool List Controller (#10570)
* 🔧 fix: Handle errors when fetching server tools and log missing tools in MCP tools controller, to prevent all MCP tools from not getting listed * 🔧 fix: Remove trailing colons from error messages in MCPConnection class * chore: Update test command patterns in package.json for cache integration tests
This commit is contained in:
parent
4a13867a47
commit
ce1812b7c2
4 changed files with 19 additions and 8 deletions
|
|
@ -336,7 +336,7 @@ export class MCPConnection extends EventEmitter {
|
|||
}
|
||||
}
|
||||
} catch (error) {
|
||||
this.emitError(error, 'Failed to construct transport:');
|
||||
this.emitError(error, 'Failed to construct transport');
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
|
|
@ -631,7 +631,7 @@ export class MCPConnection extends EventEmitter {
|
|||
const { resources } = await this.client.listResources();
|
||||
return resources;
|
||||
} catch (error) {
|
||||
this.emitError(error, 'Failed to fetch resources:');
|
||||
this.emitError(error, 'Failed to fetch resources');
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
|
@ -641,7 +641,7 @@ export class MCPConnection extends EventEmitter {
|
|||
const { tools } = await this.client.listTools();
|
||||
return tools;
|
||||
} catch (error) {
|
||||
this.emitError(error, 'Failed to fetch tools:');
|
||||
this.emitError(error, 'Failed to fetch tools');
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
|
@ -651,7 +651,7 @@ export class MCPConnection extends EventEmitter {
|
|||
const { prompts } = await this.client.listPrompts();
|
||||
return prompts;
|
||||
} catch (error) {
|
||||
this.emitError(error, 'Failed to fetch prompts:');
|
||||
this.emitError(error, 'Failed to fetch prompts');
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue