mirror of
https://github.com/samanhappy/mcphub.git
synced 2025-12-24 02:39:19 -05:00
fix: handle error when sending tool list changed notification (#13)
This commit is contained in:
@@ -27,8 +27,14 @@ export const getMcpServer = (): Server => {
|
||||
|
||||
export const notifyToolChanged = async () => {
|
||||
await registerAllTools(currentServer, true);
|
||||
currentServer.sendToolListChanged();
|
||||
console.log('Tool list changed notification sent');
|
||||
currentServer
|
||||
.sendToolListChanged()
|
||||
.catch((error) => {
|
||||
console.error('Failed to send tool list changed notification:', error);
|
||||
})
|
||||
.then(() => {
|
||||
console.log('Tool list changed notification sent successfully');
|
||||
});
|
||||
};
|
||||
|
||||
// Store all server information
|
||||
|
||||
Reference in New Issue
Block a user