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 @@ -820,6 +820,12 @@ export class Client<
820820 this . _toolListChangedOptions = toolListChangedOptions ;
821821
822822 const refreshToolList = async ( ) => {
823+ // If autoRefresh is false, call the callback for the notification, but without tools data
824+ if ( ! toolListChangedOptions . autoRefresh ) {
825+ toolListChangedOptions . onToolListChanged ?.( null , null ) ;
826+ return ;
827+ }
828+
823829 let tools : Tool [ ] | null = null ;
824830 let error : Error | null = null ;
825831 try {
@@ -832,12 +838,6 @@ export class Client<
832838 } ;
833839
834840 this . setNotificationHandler ( ToolListChangedNotificationSchema , ( ) => {
835- // If autoRefresh is false, call the callback for the notification, but without tools data
836- if ( ! toolListChangedOptions . autoRefresh ) {
837- toolListChangedOptions . onToolListChanged ?.( null , null ) ;
838- return ;
839- }
840-
841841 if ( toolListChangedOptions . debounceMs ) {
842842 // Clear any pending debounce timer
843843 if ( this . _toolListChangedDebounceTimer ) {
You can’t perform that action at this time.
0 commit comments