UNPKG

@modelcontextprotocol/sdk

Version:

Model Context Protocol implementation for TypeScript

841 lines 1.28 MB
import { z, ZodTypeAny } from "zod"; export declare const LATEST_PROTOCOL_VERSION = "2024-11-05"; export declare const SUPPORTED_PROTOCOL_VERSIONS: string[]; export declare const JSONRPC_VERSION = "2.0"; /** * A progress token, used to associate progress notifications with the original request. */ export declare const ProgressTokenSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>; /** * An opaque token used to represent a cursor for pagination. */ export declare const CursorSchema: z.ZodString; export declare const RequestSchema: z.ZodObject<{ method: z.ZodString; params: z.ZodOptional<z.ZodObject<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">>>; }, "strip", z.ZodTypeAny, { method: string; params?: z.objectOutputType<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough"> | undefined; }, { method: string; params?: z.objectInputType<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough"> | undefined; }>; export declare const NotificationSchema: z.ZodObject<{ method: z.ZodString; params: z.ZodOptional<z.ZodObject<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">>>; }, "strip", z.ZodTypeAny, { method: string; params?: z.objectOutputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough"> | undefined; }, { method: string; params?: z.objectInputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough"> | undefined; }>; export declare const ResultSchema: z.ZodObject<{ /** * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">>; /** * A uniquely identifying ID for a request in JSON-RPC. */ export declare const RequestIdSchema: z.ZodUnion<[z.ZodString, z.ZodNumber]>; /** * A request that expects a response. */ export declare const JSONRPCRequestSchema: z.ZodObject<z.objectUtil.extendShape<{ jsonrpc: z.ZodLiteral<"2.0">; id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; }, { method: z.ZodString; params: z.ZodOptional<z.ZodObject<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">>>; }>, "strict", z.ZodTypeAny, { method: string; jsonrpc: "2.0"; id: string | number; params?: z.objectOutputType<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough"> | undefined; }, { method: string; jsonrpc: "2.0"; id: string | number; params?: z.objectInputType<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough"> | undefined; }>; /** * A notification which does not expect a response. */ export declare const JSONRPCNotificationSchema: z.ZodObject<z.objectUtil.extendShape<{ jsonrpc: z.ZodLiteral<"2.0">; }, { method: z.ZodString; params: z.ZodOptional<z.ZodObject<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">>>; }>, "strict", z.ZodTypeAny, { method: string; jsonrpc: "2.0"; params?: z.objectOutputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough"> | undefined; }, { method: string; jsonrpc: "2.0"; params?: z.objectInputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough"> | undefined; }>; /** * A successful (non-error) response to a request. */ export declare const JSONRPCResponseSchema: z.ZodObject<{ jsonrpc: z.ZodLiteral<"2.0">; id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; result: z.ZodObject<{ /** * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">>; }, "strict", z.ZodTypeAny, { jsonrpc: "2.0"; id: string | number; result: { _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; } & { [k: string]: unknown; }; }, { jsonrpc: "2.0"; id: string | number; result: { _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; } & { [k: string]: unknown; }; }>; /** * Error codes defined by the JSON-RPC specification. */ export declare enum ErrorCode { ConnectionClosed = -32000, RequestTimeout = -32001, ParseError = -32700, InvalidRequest = -32600, MethodNotFound = -32601, InvalidParams = -32602, InternalError = -32603 } /** * A response to a request that indicates an error occurred. */ export declare const JSONRPCErrorSchema: z.ZodObject<{ jsonrpc: z.ZodLiteral<"2.0">; id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; error: z.ZodObject<{ /** * The error type that occurred. */ code: z.ZodNumber; /** * A short description of the error. The message SHOULD be limited to a concise single sentence. */ message: z.ZodString; /** * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). */ data: z.ZodOptional<z.ZodUnknown>; }, "strip", z.ZodTypeAny, { code: number; message: string; data?: unknown; }, { code: number; message: string; data?: unknown; }>; }, "strict", z.ZodTypeAny, { jsonrpc: "2.0"; id: string | number; error: { code: number; message: string; data?: unknown; }; }, { jsonrpc: "2.0"; id: string | number; error: { code: number; message: string; data?: unknown; }; }>; export declare const JSONRPCMessageSchema: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{ jsonrpc: z.ZodLiteral<"2.0">; id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; }, { method: z.ZodString; params: z.ZodOptional<z.ZodObject<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">>>; }>, "strict", z.ZodTypeAny, { method: string; jsonrpc: "2.0"; id: string | number; params?: z.objectOutputType<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough"> | undefined; }, { method: string; jsonrpc: "2.0"; id: string | number; params?: z.objectInputType<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications. */ progressToken: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough"> | undefined; }>, z.ZodObject<z.objectUtil.extendShape<{ jsonrpc: z.ZodLiteral<"2.0">; }, { method: z.ZodString; params: z.ZodOptional<z.ZodObject<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">>>; }>, "strict", z.ZodTypeAny, { method: string; jsonrpc: "2.0"; params?: z.objectOutputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough"> | undefined; }, { method: string; jsonrpc: "2.0"; params?: z.objectInputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough"> | undefined; }>, z.ZodObject<{ jsonrpc: z.ZodLiteral<"2.0">; id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; result: z.ZodObject<{ /** * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">>; }, "strict", z.ZodTypeAny, { jsonrpc: "2.0"; id: string | number; result: { _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; } & { [k: string]: unknown; }; }, { jsonrpc: "2.0"; id: string | number; result: { _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; } & { [k: string]: unknown; }; }>, z.ZodObject<{ jsonrpc: z.ZodLiteral<"2.0">; id: z.ZodUnion<[z.ZodString, z.ZodNumber]>; error: z.ZodObject<{ /** * The error type that occurred. */ code: z.ZodNumber; /** * A short description of the error. The message SHOULD be limited to a concise single sentence. */ message: z.ZodString; /** * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). */ data: z.ZodOptional<z.ZodUnknown>; }, "strip", z.ZodTypeAny, { code: number; message: string; data?: unknown; }, { code: number; message: string; data?: unknown; }>; }, "strict", z.ZodTypeAny, { jsonrpc: "2.0"; id: string | number; error: { code: number; message: string; data?: unknown; }; }, { jsonrpc: "2.0"; id: string | number; error: { code: number; message: string; data?: unknown; }; }>]>; /** * A response that indicates success but carries no data. */ export declare const EmptyResultSchema: z.ZodObject<{ /** * This result property is reserved by the protocol to allow clients and servers to attach additional metadata to their responses. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, "strict", z.ZodTypeAny, { _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; }, { _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; }>; /** * This notification can be sent by either side to indicate that it is cancelling a previously-issued request. * * The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished. * * This notification indicates that the result will be unused, so any associated processing SHOULD cease. * * A client MUST NOT attempt to cancel its `initialize` request. */ export declare const CancelledNotificationSchema: z.ZodObject<z.objectUtil.extendShape<{ method: z.ZodString; params: z.ZodOptional<z.ZodObject<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">>>; }, { method: z.ZodLiteral<"notifications/cancelled">; params: z.ZodObject<z.objectUtil.extendShape<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, { /** * The ID of the request to cancel. * * This MUST correspond to the ID of a request previously issued in the same direction. */ requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; /** * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. */ reason: z.ZodOptional<z.ZodString>; }>, "passthrough", z.ZodTypeAny, z.objectOutputType<z.objectUtil.extendShape<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, { /** * The ID of the request to cancel. * * This MUST correspond to the ID of a request previously issued in the same direction. */ requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; /** * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. */ reason: z.ZodOptional<z.ZodString>; }>, z.ZodTypeAny, "passthrough">, z.objectInputType<z.objectUtil.extendShape<{ /** * This parameter name is reserved by MCP to allow clients and servers to attach additional metadata to their notifications. */ _meta: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; }, { /** * The ID of the request to cancel. * * This MUST correspond to the ID of a request previously issued in the same direction. */ requestId: z.ZodUnion<[z.ZodString, z.ZodNumber]>; /** * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. */ reason: z.ZodOptional<z.ZodString>; }>, z.ZodTypeAny, "passthrough">>; }>, "strip", z.ZodTypeAny, { params: { requestId: string | number; _meta?: z.objectOutputType<{}, z.ZodTypeAny, "passthrough"> | undefined; reason?: string | undefined; } & { [k: string]: unknown; }; method: "notifications/cancelled"; }, { params: { requestId: string | number; _meta?: z.objectInputType<{}, z.ZodTypeAny, "passthrough"> | undefined; reason?: string | undefined; } & { [k: string]: unknown; }; method: "notifications/cancelled"; }>; /** * Describes the name and version of an MCP implementation. */ export declare const ImplementationSchema: z.ZodObject<{ name: z.ZodString; version: z.ZodString; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ name: z.ZodString; version: z.ZodString; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ name: z.ZodString; version: z.ZodString; }, z.ZodTypeAny, "passthrough">>; /** * Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities. */ export declare const ClientCapabilitiesSchema: z.ZodObject<{ /** * Experimental, non-standard capabilities that the client supports. */ experimental: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; /** * Present if the client supports sampling from an LLM. */ sampling: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; /** * Present if the client supports listing roots. */ roots: z.ZodOptional<z.ZodObject<{ /** * Whether the client supports issuing notifications for changes to the roots list. */ listChanged: z.ZodOptional<z.ZodBoolean>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * Whether the client supports issuing notifications for changes to the roots list. */ listChanged: z.ZodOptional<z.ZodBoolean>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * Whether the client supports issuing notifications for changes to the roots list. */ listChanged: z.ZodOptional<z.ZodBoolean>; }, z.ZodTypeAny, "passthrough">>>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * Experimental, non-standard capabilities that the client supports. */ experimental: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; /** * Present if the client supports sampling from an LLM. */ sampling: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; /** * Present if the client supports listing roots. */ roots: z.ZodOptional<z.ZodObject<{ /** * Whether the client supports issuing notifications for changes to the roots list. */ listChanged: z.ZodOptional<z.ZodBoolean>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * Whether the client supports issuing notifications for changes to the roots list. */ listChanged: z.ZodOptional<z.ZodBoolean>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * Whether the client supports issuing notifications for changes to the roots list. */ listChanged: z.ZodOptional<z.ZodBoolean>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * Experimental, non-standard capabilities that the client supports. */ experimental: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; /** * Present if the client supports sampling from an LLM. */ sampling: z.ZodOptional<z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>>; /** * Present if the client supports listing roots. */ roots: z.ZodOptional<z.ZodObject<{ /** * Whether the client supports issuing notifications for changes to the roots list. */ listChanged: z.ZodOptional<z.ZodBoolean>; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ /** * Whether the client supports issuing notifications for changes to the roots list. */ listChanged: z.ZodOptional<z.ZodBoolean>; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ /** * Whether the client supports issuing notifications for changes to the roots list. */ listChanged: z.ZodOptional<z.ZodBoolean>; }, z.ZodTypeAny, "passthrough">>>; }, z.ZodTypeAny, "passthrough">>; /** * This request is sent from the client to the server when it first connects, asking it to begin initialization. */ export declare const InitializeRequestSchema: z.ZodObject<z.objectUtil.extendShape<{ method: z.ZodString; params: z.ZodOptional<z.ZodObject<{ _meta: z.ZodOptional<z.ZodObject<{ /** * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached t