File tree 3 files changed +17
-2
lines changed
3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @modelcontextprotocol/sdk" ,
3
- "version" : " 1.0.2 " ,
3
+ "version" : " 1.0.3 " ,
4
4
"description" : " Model Context Protocol implementation for TypeScript" ,
5
5
"license" : " MIT" ,
6
6
"author" : " Anthropic, PBC (https://anthropic.com)" ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import {
11
11
ClientNotification ,
12
12
ClientRequest ,
13
13
ClientResult ,
14
+ CompatibilityCallToolResultSchema ,
14
15
CompleteRequest ,
15
16
CompleteResultSchema ,
16
17
EmptyResultSchema ,
@@ -376,7 +377,9 @@ export class Client<
376
377
377
378
async callTool (
378
379
params : CallToolRequest [ "params" ] ,
379
- resultSchema : typeof CallToolResultSchema ,
380
+ resultSchema :
381
+ | typeof CallToolResultSchema
382
+ | typeof CompatibilityCallToolResultSchema = CallToolResultSchema ,
380
383
options ?: RequestOptions ,
381
384
) {
382
385
return this . request (
Original file line number Diff line number Diff line change @@ -752,6 +752,15 @@ export const CallToolResultSchema = ResultSchema.extend({
752
752
isError : z . boolean ( ) . default ( false ) . optional ( ) ,
753
753
} ) ;
754
754
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
+
755
764
/**
756
765
* Used by the client to invoke a tool provided by the server.
757
766
*/
@@ -1186,6 +1195,9 @@ export type Tool = z.infer<typeof ToolSchema>;
1186
1195
export type ListToolsRequest = z . infer < typeof ListToolsRequestSchema > ;
1187
1196
export type ListToolsResult = z . infer < typeof ListToolsResultSchema > ;
1188
1197
export type CallToolResult = z . infer < typeof CallToolResultSchema > ;
1198
+ export type CompatibilityCallToolResult = z . infer <
1199
+ typeof CompatibilityCallToolResultSchema
1200
+ > ;
1189
1201
export type CallToolRequest = z . infer < typeof CallToolRequestSchema > ;
1190
1202
export type ToolListChangedNotification = z . infer <
1191
1203
typeof ToolListChangedNotificationSchema
You can’t perform that action at this time.
0 commit comments