Skip to content

Commit 0b9fc4c

Browse files
committed
fix: add type casting for CallToolResultSchema compatibility with SDK v1.20.0
The SDK v1.20.0 has a different response type structure. Added type casting to maintain backward compatibility with the existing McpToolCallResponse type.
1 parent d3f9de9 commit 0b9fc4c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/services/mcp/McpHub.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ export class McpHub {
16011601
timeout = 60 * 1000
16021602
}
16031603

1604-
return await connection.client.request(
1604+
const result = await connection.client.request(
16051605
{
16061606
method: "tools/call",
16071607
params: {
@@ -1614,6 +1614,9 @@ export class McpHub {
16141614
timeout,
16151615
},
16161616
)
1617+
1618+
// Cast the result to our expected type structure for backward compatibility
1619+
return result as McpToolCallResponse
16171620
}
16181621

16191622
/**

0 commit comments

Comments
 (0)