Skip to content

Commit

Permalink
Remove CompatibilityCallToolResult
Browse files Browse the repository at this point in the history
Resolves #82.
  • Loading branch information
jspahrsummers committed Dec 3, 2024
1 parent becd787 commit e911ece
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
5 changes: 1 addition & 4 deletions src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
ClientNotification,
ClientRequest,
ClientResult,
CompatibilityCallToolResultSchema,
CompleteRequest,
CompleteResultSchema,
EmptyResultSchema,
Expand Down Expand Up @@ -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(
Expand Down
12 changes: 0 additions & 12 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -1195,9 +1186,6 @@ export type Tool = z.infer<typeof ToolSchema>;
export type ListToolsRequest = z.infer<typeof ListToolsRequestSchema>;
export type ListToolsResult = z.infer<typeof ListToolsResultSchema>;
export type CallToolResult = z.infer<typeof CallToolResultSchema>;
export type CompatibilityCallToolResult = z.infer<
typeof CompatibilityCallToolResultSchema
>;
export type CallToolRequest = z.infer<typeof CallToolRequestSchema>;
export type ToolListChangedNotification = z.infer<
typeof ToolListChangedNotificationSchema
Expand Down

0 comments on commit e911ece

Please sign in to comment.