File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @modelcontextprotocol/sdk" ,
3- "version" : " 1.0.2 " ,
3+ "version" : " 1.0.3 " ,
44 "description" : " Model Context Protocol implementation for TypeScript" ,
55 "license" : " MIT" ,
66 "author" : " Anthropic, PBC (https://anthropic.com)" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
1111 ClientNotification ,
1212 ClientRequest ,
1313 ClientResult ,
14+ CompatibilityCallToolResultSchema ,
1415 CompleteRequest ,
1516 CompleteResultSchema ,
1617 EmptyResultSchema ,
@@ -376,7 +377,9 @@ export class Client<
376377
377378 async callTool (
378379 params : CallToolRequest [ "params" ] ,
379- resultSchema : typeof CallToolResultSchema ,
380+ resultSchema :
381+ | typeof CallToolResultSchema
382+ | typeof CompatibilityCallToolResultSchema = CallToolResultSchema ,
380383 options ?: RequestOptions ,
381384 ) {
382385 return this . request (
Original file line number Diff line number Diff line change @@ -752,6 +752,15 @@ export const CallToolResultSchema = ResultSchema.extend({
752752 isError : z . boolean ( ) . default ( false ) . optional ( ) ,
753753} ) ;
754754
755+ /**
756+ * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07.
757+ */
758+ export const CompatibilityCallToolResultSchema = CallToolResultSchema . or (
759+ ResultSchema . extend ( {
760+ toolResult : z . unknown ( ) ,
761+ } ) ,
762+ ) ;
763+
755764/**
756765 * Used by the client to invoke a tool provided by the server.
757766 */
@@ -1186,6 +1195,9 @@ export type Tool = z.infer<typeof ToolSchema>;
11861195export type ListToolsRequest = z . infer < typeof ListToolsRequestSchema > ;
11871196export type ListToolsResult = z . infer < typeof ListToolsResultSchema > ;
11881197export type CallToolResult = z . infer < typeof CallToolResultSchema > ;
1198+ export type CompatibilityCallToolResult = z . infer <
1199+ typeof CompatibilityCallToolResultSchema
1200+ > ;
11891201export type CallToolRequest = z . infer < typeof CallToolRequestSchema > ;
11901202export type ToolListChangedNotification = z . infer <
11911203 typeof ToolListChangedNotificationSchema
You can’t perform that action at this time.
0 commit comments