File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ export class McpHub {
302302 }
303303
304304 private async enhanceServersWithConnectionInfo ( servers : McpServer [ ] ) : Promise < McpServer [ ] > {
305- const connectedServers = this . connectionManager [ "factory" ] . getAllServers ( )
305+ const connectedServers = this . connectionManager . getAllServers ( )
306306 for ( const server of servers ) {
307307 const connected = connectedServers . find ( ( s ) => s . name === server . name && s . source === server . source )
308308 if ( connected ) {
Original file line number Diff line number Diff line change @@ -112,17 +112,15 @@ export abstract class BaseHandler implements ConnectionHandler {
112112 */
113113 protected async fetchToolsList ( connection : McpConnection ) : Promise < McpTool [ ] > {
114114 try {
115- const result = await connection . client . listTools ( )
116- const parsed = ListToolsResultSchema . parse ( result )
117-
118- return parsed . tools . map ( ( tool : any ) => ( {
119- name : tool . name ,
120- description : tool . description ,
121- inputSchema : tool . input_schema as object | undefined ,
122- alwaysAllow : false ,
115+ const result = await connection . client . request ( { method : "tools/list" } , ListToolsResultSchema )
116+
117+ // Preserve ALL original properties from the tool object
118+ return ( result ?. tools || [ ] ) . map ( ( tool : any ) => ( {
119+ ...tool , // Keep all original properties
120+ alwaysAllow : false , // Will be set by updateToolAlwaysAllowStatus
123121 } ) )
124122 } catch ( error ) {
125- // console.error(`Failed to fetch tools list for ${connection.server.name}:`, error)
123+ console . error ( `Failed to fetch tools list for ${ connection . server . name } :` , error )
126124 return [ ]
127125 }
128126 }
You can’t perform that action at this time.
0 commit comments