File tree 1 file changed +20
-12
lines changed
1 file changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -83,20 +83,28 @@ export class Server extends Protocol<
83
83
return this . _clientVersion ;
84
84
}
85
85
86
- private getCapability (
87
- reqType : ClientRequest [ "method" ] ,
88
- ) : ServerCapabilities [ keyof ServerCapabilities ] {
89
- return this . _requestHandlers . has ( reqType as string ) ? { } : undefined ;
90
- }
91
-
92
86
private getCapabilities ( ) : ServerCapabilities {
93
87
return {
94
- prompts : this . getCapability ( ListPromptsRequestSchema . shape . method . value ) ,
95
- resources : this . getCapability (
96
- ListResourcesRequestSchema . shape . method . value ,
97
- ) ,
98
- tools : this . getCapability ( ListToolsRequestSchema . shape . method . value ) ,
99
- logging : this . getCapability ( SetLevelRequestSchema . shape . method . value ) ,
88
+ prompts : this . _requestHandlers . has (
89
+ ListPromptsRequestSchema . shape . method . value as string ,
90
+ )
91
+ ? { }
92
+ : undefined ,
93
+ resources : this . _requestHandlers . has (
94
+ ListResourcesRequestSchema . shape . method . value as string ,
95
+ )
96
+ ? { }
97
+ : undefined ,
98
+ tools : this . _requestHandlers . has (
99
+ ListToolsRequestSchema . shape . method . value as string ,
100
+ )
101
+ ? { }
102
+ : undefined ,
103
+ logging : this . _requestHandlers . has (
104
+ SetLevelRequestSchema . shape . method . value as string ,
105
+ )
106
+ ? { }
107
+ : undefined ,
100
108
} ;
101
109
}
102
110
}
You can’t perform that action at this time.
0 commit comments