|
1 | 1 | import { Server, ServerOptions } from './index.js'; |
2 | | -import { z, ZodRawShape, ZodObject, ZodString, AnyZodObject, ZodTypeAny, ZodType, ZodTypeDef, ZodOptional } from 'zod'; |
| 2 | +import { z, ZodRawShape, ZodObject, ZodString, ZodTypeAny, ZodType, ZodOptional } from 'zod'; |
3 | 3 | import { |
4 | 4 | Implementation, |
5 | 5 | Tool, |
@@ -1008,16 +1008,16 @@ export class ResourceTemplate { |
1008 | 1008 | */ |
1009 | 1009 | export type ToolCallback<Args extends undefined | ZodRawShape = undefined> = Args extends ZodRawShape |
1010 | 1010 | ? ( |
1011 | | - args: z.objectOutputType<Args, ZodTypeAny>, |
| 1011 | + args: z.infer<ZodObject<Args>>, |
1012 | 1012 | extra: RequestHandlerExtra<ServerRequest, ServerNotification> |
1013 | 1013 | ) => CallToolResult | Promise<CallToolResult> |
1014 | 1014 | : (extra: RequestHandlerExtra<ServerRequest, ServerNotification>) => CallToolResult | Promise<CallToolResult>; |
1015 | 1015 |
|
1016 | 1016 | export type RegisteredTool = { |
1017 | 1017 | title?: string; |
1018 | 1018 | description?: string; |
1019 | | - inputSchema?: AnyZodObject; |
1020 | | - outputSchema?: AnyZodObject; |
| 1019 | + inputSchema?: ZodObject<any>; |
| 1020 | + outputSchema?: ZodObject<any>; |
1021 | 1021 | annotations?: ToolAnnotations; |
1022 | 1022 | _meta?: Record<string, unknown>; |
1023 | 1023 | callback: ToolCallback<undefined | ZodRawShape>; |
@@ -1138,7 +1138,7 @@ type PromptArgsRawShape = { |
1138 | 1138 |
|
1139 | 1139 | export type PromptCallback<Args extends undefined | PromptArgsRawShape = undefined> = Args extends PromptArgsRawShape |
1140 | 1140 | ? ( |
1141 | | - args: z.objectOutputType<Args, ZodTypeAny>, |
| 1141 | + args: z.infer<ZodObject<Args>>, |
1142 | 1142 | extra: RequestHandlerExtra<ServerRequest, ServerNotification> |
1143 | 1143 | ) => GetPromptResult | Promise<GetPromptResult> |
1144 | 1144 | : (extra: RequestHandlerExtra<ServerRequest, ServerNotification>) => GetPromptResult | Promise<GetPromptResult>; |
|
0 commit comments