File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -497,6 +497,12 @@ export class Client<
497497 this . _toolListChangedOptions = toolListChangedOptions ;
498498
499499 const refreshToolList = async ( ) => {
500+ // If autoRefresh is false, call the callback for the notification, but without tools data
501+ if ( ! toolListChangedOptions . autoRefresh ) {
502+ toolListChangedOptions . onToolListChanged ?.( null , null ) ;
503+ return ;
504+ }
505+
500506 let tools : Tool [ ] | null = null ;
501507 let error : Error | null = null ;
502508 try {
@@ -509,12 +515,6 @@ export class Client<
509515 } ;
510516
511517 this . setNotificationHandler ( ToolListChangedNotificationSchema , ( ) => {
512- // If autoRefresh is false, call the callback for the notification, but without tools data
513- if ( ! toolListChangedOptions . autoRefresh ) {
514- toolListChangedOptions . onToolListChanged ?.( null , null ) ;
515- return ;
516- }
517-
518518 if ( toolListChangedOptions . debounceMs ) {
519519 // Clear any pending debounce timer
520520 if ( this . _toolListChangedDebounceTimer ) {
You can’t perform that action at this time.
0 commit comments