Skip to content

Commit c3d1d88

Browse files
committed
fix tool's parameters
1 parent 3cabd50 commit c3d1d88

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

src/services/mcp/McpHub.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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) {

src/services/mcp/connection/handlers/base/BaseHandler.ts

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)