From e911ece970934f614f1ab61d349e7f3ecf162140 Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Tue, 3 Dec 2024 16:03:26 +0000 Subject: [PATCH] Remove `CompatibilityCallToolResult` Resolves #82. --- src/client/index.ts | 5 +---- src/types.ts | 12 ------------ 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/src/client/index.ts b/src/client/index.ts index 1ad5161..afc7242 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -11,7 +11,6 @@ import { ClientNotification, ClientRequest, ClientResult, - CompatibilityCallToolResultSchema, CompleteRequest, CompleteResultSchema, EmptyResultSchema, @@ -377,9 +376,7 @@ export class Client< async callTool( params: CallToolRequest["params"], - resultSchema: - | typeof CallToolResultSchema - | typeof CompatibilityCallToolResultSchema = CallToolResultSchema, + resultSchema: typeof CallToolResultSchema, options?: RequestOptions, ) { return this.request( diff --git a/src/types.ts b/src/types.ts index 44a44d8..5db06a5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -752,15 +752,6 @@ export const CallToolResultSchema = ResultSchema.extend({ isError: z.boolean().default(false).optional(), }); -/** - * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. - */ -export const CompatibilityCallToolResultSchema = CallToolResultSchema.or( - ResultSchema.extend({ - toolResult: z.unknown(), - }), -); - /** * Used by the client to invoke a tool provided by the server. */ @@ -1195,9 +1186,6 @@ export type Tool = z.infer; export type ListToolsRequest = z.infer; export type ListToolsResult = z.infer; export type CallToolResult = z.infer; -export type CompatibilityCallToolResult = z.infer< - typeof CompatibilityCallToolResultSchema ->; export type CallToolRequest = z.infer; export type ToolListChangedNotification = z.infer< typeof ToolListChangedNotificationSchema