File tree Expand file tree Collapse file tree 1 file changed +20
-12
lines changed
Expand file tree Collapse file tree 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<
8383 return this . _clientVersion ;
8484 }
8585
86- private getCapability (
87- reqType : ClientRequest [ "method" ] ,
88- ) : ServerCapabilities [ keyof ServerCapabilities ] {
89- return this . _requestHandlers . has ( reqType as string ) ? { } : undefined ;
90- }
91-
9286 private getCapabilities ( ) : ServerCapabilities {
9387 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 ,
100108 } ;
101109 }
102110}
You can’t perform that action at this time.
0 commit comments