mirror of
https://github.com/samanhappy/mcphub.git
synced 2025-12-23 18:29:21 -05:00
fix: handle error when sending tool list changed notification (#13)
This commit is contained in:
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -16,4 +16,4 @@ jobs:
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
gen_release_notes: true
|
||||
generate_release_notes: true
|
||||
|
||||
@@ -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