File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ import type { Transport } from "@modelcontextprotocol/sdk/shared/transport";
1616import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js" ;
1717import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js" ;
1818import { ResultFormatter } from "./ResultFormatter.js" ;
19- import type { CallToolResult } from "@modelcontextprotocol/sdk/types" ;
2019
2120type ToolName = string ;
2221
@@ -198,7 +197,7 @@ export class McpClient {
198197 const client = this . clients . get ( toolName ) ;
199198 if ( client ) {
200199 const result = await client . callTool ( { name : toolName , arguments : toolArgs , signal : opts . abortSignal } ) ;
201- toolMessage . content = ResultFormatter . format ( result as CallToolResult ) ;
200+ toolMessage . content = ResultFormatter . format ( result ) ;
202201 } else {
203202 toolMessage . content = `Error: No session found for tool: ${ toolName } ` ;
204203 }
Original file line number Diff line number Diff line change 1- import type { CallToolResult , TextResourceContents , BlobResourceContents } from "@modelcontextprotocol/sdk/types" ;
1+ import type {
2+ TextResourceContents ,
3+ BlobResourceContents ,
4+ CompatibilityCallToolResult ,
5+ } from "@modelcontextprotocol/sdk/types" ;
26
37/**
48 * A utility class for formatting CallToolResult contents into human-readable text.
@@ -13,7 +17,7 @@ export class ResultFormatter {
1317 * @param result The CallToolResult to format
1418 * @returns A human-readable string representation of the result contents
1519 */
16- static format ( result : CallToolResult ) : string {
20+ static format ( result : CompatibilityCallToolResult ) : string {
1721 if ( ! result . content || ! Array . isArray ( result . content ) || result . content . length === 0 ) {
1822 return "[No content]" ;
1923 }
You can’t perform that action at this time.
0 commit comments