import * as z3 from "zod/v3"; import * as z from "zod/v4"; import * as z4 from "zod/v4/core"; import { InputSchema, ModelContextCore, ModelContextRegisterToolOptions, ModelContextTestingExecuteToolOptions, ModelContextToolInfo, ModelContextToolReference, ResourceContents as ResourceContents$1, ToolDescriptor, ToolListItem, ToolResponse } from "@mcp-b/webmcp-types"; //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.d.ts type AnySchema = z3.ZodTypeAny | z4.$ZodType; type AnyObjectSchema = z3.AnyZodObject | z4.$ZodObject | AnySchema; type ZodRawShapeCompat = Record; type SchemaOutput = S extends z3.ZodTypeAny ? z3.infer : S extends z4.$ZodType ? z4.output : never; /** * Infers the output type from a ZodRawShapeCompat (raw shape object). * Maps over each key in the shape and infers the output type from each schema. */ type ShapeOutput = { [K in keyof Shape]: SchemaOutput }; //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/auth/types.d.ts /** * Information about a validated access token, provided to request handlers. */ interface AuthInfo { /** * The access token. */ token: string; /** * The client ID associated with this token. */ clientId: string; /** * Scopes associated with this token. */ scopes: string[]; /** * When the token expires (in seconds since epoch). */ expiresAt?: number; /** * The RFC 8707 resource server identifier for which this token is valid. * If set, this MUST match the MCP server's resource identifier (minus hash fragment). */ resource?: URL; /** * Additional data associated with the token. * This field should be used for any additional data that needs to be attached to the auth info. */ extra?: Record; } //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/types.d.ts declare const LATEST_PROTOCOL_VERSION = "2025-11-25"; declare const SUPPORTED_PROTOCOL_VERSIONS: string[]; /** * Task creation parameters, used to ask that the server create a task to represent a request. */ declare const TaskCreationParamsSchema: z.ZodObject<{ /** * Time in milliseconds to keep task results available after completion. * If null, the task has unlimited lifetime until manually cleaned up. */ ttl: z.ZodOptional>; /** * Time in milliseconds to wait between task status requests. */ pollInterval: z.ZodOptional; }, z.core.$loose>; /** * Metadata for associating messages with a task. * Include this in the `_meta` field under the key `io.modelcontextprotocol/related-task`. */ declare const RelatedTaskMetadataSchema: z.ZodObject<{ taskId: z.ZodString; }, z.core.$strip>; declare const RequestMetaSchema: 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>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>; /** * Common params for any request. */ declare const RequestSchema: z.ZodObject<{ method: z.ZodString; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$strip>; declare const NotificationSchema: z.ZodObject<{ method: z.ZodString; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$strip>; declare const ResultSchema: z.ZodObject<{ /** * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) * for notes on _meta usage. */ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>; /** * A uniquely identifying ID for a request in JSON-RPC. */ declare const RequestIdSchema: z.ZodUnion; /** * A request that expects a response. */ declare const JSONRPCRequestSchema: z.ZodObject<{ method: z.ZodString; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>>; jsonrpc: z.ZodLiteral<"2.0">; id: z.ZodUnion; }, z.core.$strict>; /** * A notification which does not expect a response. */ declare const JSONRPCNotificationSchema: z.ZodObject<{ method: z.ZodString; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>>; jsonrpc: z.ZodLiteral<"2.0">; }, z.core.$strict>; /** * A successful (non-error) response to a request. */ declare const JSONRPCResultResponseSchema: z.ZodObject<{ jsonrpc: z.ZodLiteral<"2.0">; id: z.ZodUnion; result: z.ZodObject<{ /** * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) * for notes on _meta usage. */ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>; }, z.core.$strict>; /** * Error codes defined by the JSON-RPC specification. */ declare enum ErrorCode { ConnectionClosed = -32000, RequestTimeout = -32001, ParseError = -32700, InvalidRequest = -32600, MethodNotFound = -32601, InvalidParams = -32602, InternalError = -32603, UrlElicitationRequired = -32042 } /** * A response to a request that indicates an error occurred. */ declare const JSONRPCErrorResponseSchema: z.ZodObject<{ jsonrpc: z.ZodLiteral<"2.0">; id: z.ZodOptional>; error: z.ZodObject<{ code: z.ZodNumber; message: z.ZodString; data: z.ZodOptional; }, z.core.$strip>; }, z.core.$strict>; declare const JSONRPCMessageSchema: z.ZodUnion>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>>; jsonrpc: z.ZodLiteral<"2.0">; id: z.ZodUnion; }, z.core.$strict>, z.ZodObject<{ method: z.ZodString; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>>; jsonrpc: z.ZodLiteral<"2.0">; }, z.core.$strict>, z.ZodObject<{ jsonrpc: z.ZodLiteral<"2.0">; id: z.ZodUnion; result: z.ZodObject<{ /** * See [MCP specification](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/47339c03c143bb4ec01a26e721a1b8fe66634ebe/docs/specification/draft/basic/index.mdx#general-fields) * for notes on _meta usage. */ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>; }, z.core.$strict>, z.ZodObject<{ jsonrpc: z.ZodLiteral<"2.0">; id: z.ZodOptional>; error: z.ZodObject<{ code: z.ZodNumber; message: z.ZodString; data: z.ZodOptional; }, z.core.$strip>; }, z.core.$strict>]>; /** * Describes the name and version of an MCP implementation. */ declare const ImplementationSchema: z.ZodObject<{ version: z.ZodString; websiteUrl: z.ZodOptional; description: z.ZodOptional; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>; /** * 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. */ declare const ClientCapabilitiesSchema: z.ZodObject<{ experimental: z.ZodOptional>>; sampling: z.ZodOptional>; tools: z.ZodOptional>; }, z.core.$strip>>; elicitation: z.ZodOptional, z.ZodIntersection; }, z.core.$strip>, z.ZodRecord>>; url: z.ZodOptional>; }, z.core.$strip>, z.ZodOptional>>>>; roots: z.ZodOptional; }, z.core.$strip>>; tasks: z.ZodOptional>; /** * Present if the client supports cancelling tasks. */ cancel: z.ZodOptional>; /** * Capabilities for task creation on specific request types. */ requests: z.ZodOptional>; }, z.core.$loose>>; /** * Task support for elicitation requests. */ elicitation: z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$strip>; /** * This request is sent from the client to the server when it first connects, asking it to begin initialization. */ declare const InitializeRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"initialize">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; protocolVersion: z.ZodString; capabilities: z.ZodObject<{ experimental: z.ZodOptional>>; sampling: z.ZodOptional>; tools: z.ZodOptional>; }, z.core.$strip>>; elicitation: z.ZodOptional, z.ZodIntersection; }, z.core.$strip>, z.ZodRecord>>; url: z.ZodOptional>; }, z.core.$strip>, z.ZodOptional>>>>; roots: z.ZodOptional; }, z.core.$strip>>; tasks: z.ZodOptional>; /** * Present if the client supports cancelling tasks. */ cancel: z.ZodOptional>; /** * Capabilities for task creation on specific request types. */ requests: z.ZodOptional>; }, z.core.$loose>>; /** * Task support for elicitation requests. */ elicitation: z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$strip>; clientInfo: z.ZodObject<{ version: z.ZodString; websiteUrl: z.ZodOptional; description: z.ZodOptional; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>; }, z.core.$strip>; /** * Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities. */ declare const ServerCapabilitiesSchema: z.ZodObject<{ experimental: z.ZodOptional>>; logging: z.ZodOptional>; completions: z.ZodOptional>; prompts: z.ZodOptional; }, z.core.$strip>>; resources: z.ZodOptional; listChanged: z.ZodOptional; }, z.core.$strip>>; tools: z.ZodOptional; }, z.core.$strip>>; tasks: z.ZodOptional>; /** * Present if the server supports cancelling tasks. */ cancel: z.ZodOptional>; /** * Capabilities for task creation on specific request types. */ requests: z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$strip>; /** * After receiving an initialize request from the client, the server sends this response. */ declare const InitializeResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; protocolVersion: z.ZodString; capabilities: z.ZodObject<{ experimental: z.ZodOptional>>; logging: z.ZodOptional>; completions: z.ZodOptional>; prompts: z.ZodOptional; }, z.core.$strip>>; resources: z.ZodOptional; listChanged: z.ZodOptional; }, z.core.$strip>>; tools: z.ZodOptional; }, z.core.$strip>>; tasks: z.ZodOptional>; /** * Present if the server supports cancelling tasks. */ cancel: z.ZodOptional>; /** * Capabilities for task creation on specific request types. */ requests: z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$strip>; serverInfo: z.ZodObject<{ version: z.ZodString; websiteUrl: z.ZodOptional; description: z.ZodOptional; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>; instructions: z.ZodOptional; }, z.core.$loose>; declare const ProgressSchema: z.ZodObject<{ progress: z.ZodNumber; total: z.ZodOptional; message: z.ZodOptional; }, z.core.$strip>; /** * A pollable state object associated with a request. */ declare const TaskSchema: z.ZodObject<{ taskId: z.ZodString; status: z.ZodEnum<{ working: "working"; input_required: "input_required"; completed: "completed"; failed: "failed"; cancelled: "cancelled"; }>; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>; /** * Result returned when a task is created, containing the task data wrapped in a task field. */ declare const CreateTaskResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodObject<{ taskId: z.ZodString; status: z.ZodEnum<{ working: "working"; input_required: "input_required"; completed: "completed"; failed: "failed"; cancelled: "cancelled"; }>; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>; }, z.core.$loose>; /** * A request to get the state of a specific task. */ declare const GetTaskRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"tasks/get">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; }, z.core.$strip>; }, z.core.$strip>; /** * The response to a tasks/get request. */ declare const GetTaskResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; status: z.ZodEnum<{ working: "working"; input_required: "input_required"; completed: "completed"; failed: "failed"; cancelled: "cancelled"; }>; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>; /** * A request to get the result of a specific task. */ declare const GetTaskPayloadRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"tasks/result">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; }, z.core.$strip>; }, z.core.$strip>; /** * The response to a tasks/list request. */ declare const ListTasksResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; nextCursor: z.ZodOptional; tasks: z.ZodArray; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>>; }, z.core.$loose>; /** * The response to a tasks/cancel request. */ declare const CancelTaskResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; status: z.ZodEnum<{ working: "working"; input_required: "input_required"; completed: "completed"; failed: "failed"; cancelled: "cancelled"; }>; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>; /** * The contents of a specific resource or sub-resource. */ declare const ResourceContentsSchema: z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; }, z.core.$strip>; /** * A known resource that the server is capable of reading. */ declare const ResourceSchema: z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>; /** * A template description for resources available on the server. */ declare const ResourceTemplateSchema: z.ZodObject<{ uriTemplate: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>; /** * Sent from the client to request a list of resources the server has. */ declare const ListResourcesRequestSchema: z.ZodObject<{ params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; cursor: z.ZodOptional; }, z.core.$strip>>; method: z.ZodLiteral<"resources/list">; }, z.core.$strip>; /** * The server's response to a resources/list request from the client. */ declare const ListResourcesResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; nextCursor: z.ZodOptional; resources: z.ZodArray; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>>; }, z.core.$loose>; /** * Sent from the client to request a list of resource templates the server has. */ declare const ListResourceTemplatesRequestSchema: z.ZodObject<{ params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; cursor: z.ZodOptional; }, z.core.$strip>>; method: z.ZodLiteral<"resources/templates/list">; }, z.core.$strip>; /** * Sent from the client to the server, to read a specific resource URI. */ declare const ReadResourceRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"resources/read">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; uri: z.ZodString; }, z.core.$strip>; }, z.core.$strip>; /** * The server's response to a resources/read request from the client. */ declare const ReadResourceResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; contents: z.ZodArray; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>>; }, z.core.$loose>; /** * An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client. */ declare const ResourceListChangedNotificationSchema: z.ZodObject<{ method: z.ZodLiteral<"notifications/resources/list_changed">; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>; /** * Sent from the client to request resources/updated notifications from the server whenever a particular resource changes. */ declare const SubscribeRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"resources/subscribe">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; uri: z.ZodString; }, z.core.$strip>; }, z.core.$strip>; /** * Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request. */ declare const UnsubscribeRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"resources/unsubscribe">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; uri: z.ZodString; }, z.core.$strip>; }, z.core.$strip>; /** * A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request. */ declare const ResourceUpdatedNotificationSchema: z.ZodObject<{ method: z.ZodLiteral<"notifications/resources/updated">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; uri: z.ZodString; }, z.core.$strip>; }, z.core.$strip>; /** * A prompt or prompt template that the server offers. */ declare const PromptSchema: z.ZodObject<{ description: z.ZodOptional; arguments: z.ZodOptional; required: z.ZodOptional; }, z.core.$strip>>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>; /** * Sent from the client to request a list of prompts and prompt templates the server has. */ declare const ListPromptsRequestSchema: z.ZodObject<{ params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; cursor: z.ZodOptional; }, z.core.$strip>>; method: z.ZodLiteral<"prompts/list">; }, z.core.$strip>; /** * The server's response to a prompts/list request from the client. */ declare const ListPromptsResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; nextCursor: z.ZodOptional; prompts: z.ZodArray; arguments: z.ZodOptional; required: z.ZodOptional; }, z.core.$strip>>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>>; }, z.core.$loose>; /** * Used by the client to get a prompt provided by the server. */ declare const GetPromptRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"prompts/get">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; name: z.ZodString; arguments: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>; /** * Describes a message returned as part of a prompt. */ declare const PromptMessageSchema: z.ZodObject<{ role: z.ZodEnum<{ user: "user"; assistant: "assistant"; }>; content: z.ZodUnion; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>; }, z.core.$strip>; /** * The server's response to a prompts/get request from the client. */ declare const GetPromptResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; description: z.ZodOptional; messages: z.ZodArray; content: z.ZodUnion; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>; }, z.core.$strip>>; }, z.core.$loose>; /** * Additional properties describing a Tool to clients. * * NOTE: all properties in ToolAnnotations are **hints**. * They are not guaranteed to provide a faithful description of * tool behavior (including descriptive properties like `title`). * * Clients should never make tool use decisions based on ToolAnnotations * received from untrusted servers. */ declare const ToolAnnotationsSchema: z.ZodObject<{ title: z.ZodOptional; readOnlyHint: z.ZodOptional; destructiveHint: z.ZodOptional; idempotentHint: z.ZodOptional; openWorldHint: z.ZodOptional; }, z.core.$strip>; /** * Execution-related properties for a tool. */ declare const ToolExecutionSchema: z.ZodObject<{ taskSupport: z.ZodOptional>; }, z.core.$strip>; /** * Definition for a tool the client can call. */ declare const ToolSchema: z.ZodObject<{ description: z.ZodOptional; inputSchema: z.ZodObject<{ type: z.ZodLiteral<"object">; properties: z.ZodOptional>>; required: z.ZodOptional>; }, z.core.$catchall>; outputSchema: z.ZodOptional; properties: z.ZodOptional>>; required: z.ZodOptional>; }, z.core.$catchall>>; annotations: z.ZodOptional; readOnlyHint: z.ZodOptional; destructiveHint: z.ZodOptional; idempotentHint: z.ZodOptional; openWorldHint: z.ZodOptional; }, z.core.$strip>>; execution: z.ZodOptional>; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>; /** * Sent from the client to request a list of tools the server has. */ declare const ListToolsRequestSchema: z.ZodObject<{ params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; cursor: z.ZodOptional; }, z.core.$strip>>; method: z.ZodLiteral<"tools/list">; }, z.core.$strip>; /** * The server's response to a tools/list request from the client. */ declare const ListToolsResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; nextCursor: z.ZodOptional; tools: z.ZodArray; inputSchema: z.ZodObject<{ type: z.ZodLiteral<"object">; properties: z.ZodOptional>>; required: z.ZodOptional>; }, z.core.$catchall>; outputSchema: z.ZodOptional; properties: z.ZodOptional>>; required: z.ZodOptional>; }, z.core.$catchall>>; annotations: z.ZodOptional; readOnlyHint: z.ZodOptional; destructiveHint: z.ZodOptional; idempotentHint: z.ZodOptional; openWorldHint: z.ZodOptional; }, z.core.$strip>>; execution: z.ZodOptional>; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>>; }, z.core.$loose>; /** * The server's response to a tool call. */ declare const CallToolResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; }, z.core.$loose>; /** * CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07. */ declare const CompatibilityCallToolResultSchema: z.ZodUnion<[z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; toolResult: z.ZodUnknown; }, z.core.$loose>]>; /** * Used by the client to invoke a tool provided by the server. */ declare const CallToolRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"tools/call">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodOptional; }, z.core.$strip>>; name: z.ZodString; arguments: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>; /** * An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client. */ declare const ToolListChangedNotificationSchema: z.ZodObject<{ method: z.ZodLiteral<"notifications/tools/list_changed">; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>; /** * Callback type for list changed notifications. */ type ListChangedCallback = (error: Error | null, items: T[] | null) => void; /** * Options for subscribing to list changed notifications. * * @typeParam T - The type of items in the list (Tool, Prompt, or Resource) */ type ListChangedOptions = { /** * If true, the list will be refreshed automatically when a list changed notification is received. * @default true */ autoRefresh?: boolean; /** * Debounce time in milliseconds. Set to 0 to disable. * @default 300 */ debounceMs?: number; /** * Callback invoked when the list changes. * * If autoRefresh is true, items contains the updated list. * If autoRefresh is false, items is null (caller should refresh manually). */ onChanged: ListChangedCallback; }; /** * Configuration for list changed notification handlers. * * Use this to configure handlers for tools, prompts, and resources list changes * when creating a client. * * Note: Handlers are only activated if the server advertises the corresponding * `listChanged` capability (e.g., `tools.listChanged: true`). If the server * doesn't advertise this capability, the handler will not be set up. */ type ListChangedHandlers = { /** * Handler for tool list changes. */ tools?: ListChangedOptions; /** * Handler for prompt list changes. */ prompts?: ListChangedOptions; /** * Handler for resource list changes. */ resources?: ListChangedOptions; }; /** * The severity of a log message. */ declare const LoggingLevelSchema: z.ZodEnum<{ error: "error"; debug: "debug"; info: "info"; notice: "notice"; warning: "warning"; critical: "critical"; alert: "alert"; emergency: "emergency"; }>; /** * Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically. */ declare const LoggingMessageNotificationSchema: z.ZodObject<{ method: z.ZodLiteral<"notifications/message">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; level: z.ZodEnum<{ error: "error"; debug: "debug"; info: "info"; notice: "notice"; warning: "warning"; critical: "critical"; alert: "alert"; emergency: "emergency"; }>; logger: z.ZodOptional; data: z.ZodUnknown; }, z.core.$strip>; }, z.core.$strip>; /** * Parameters for a `sampling/createMessage` request. */ declare const CreateMessageRequestParamsSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodOptional; }, z.core.$strip>>; messages: z.ZodArray; content: z.ZodUnion; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_use">; name: z.ZodString; id: z.ZodString; input: z.ZodRecord; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; toolUseId: z.ZodString; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; _meta: z.ZodOptional>; }, z.core.$strip>]>, z.ZodArray; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_use">; name: z.ZodString; id: z.ZodString; input: z.ZodRecord; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; toolUseId: z.ZodString; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; _meta: z.ZodOptional>; }, z.core.$strip>]>>]>; _meta: z.ZodOptional>; }, z.core.$strip>>; modelPreferences: z.ZodOptional; }, z.core.$strip>>>; costPriority: z.ZodOptional; speedPriority: z.ZodOptional; intelligencePriority: z.ZodOptional; }, z.core.$strip>>; systemPrompt: z.ZodOptional; includeContext: z.ZodOptional>; temperature: z.ZodOptional; maxTokens: z.ZodNumber; stopSequences: z.ZodOptional>; metadata: z.ZodOptional>; tools: z.ZodOptional; inputSchema: z.ZodObject<{ type: z.ZodLiteral<"object">; properties: z.ZodOptional>>; required: z.ZodOptional>; }, z.core.$catchall>; outputSchema: z.ZodOptional; properties: z.ZodOptional>>; required: z.ZodOptional>; }, z.core.$catchall>>; annotations: z.ZodOptional; readOnlyHint: z.ZodOptional; destructiveHint: z.ZodOptional; idempotentHint: z.ZodOptional; openWorldHint: z.ZodOptional; }, z.core.$strip>>; execution: z.ZodOptional>; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>>>; toolChoice: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>; /** * A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it. */ declare const CreateMessageRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"sampling/createMessage">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodOptional; }, z.core.$strip>>; messages: z.ZodArray; content: z.ZodUnion; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_use">; name: z.ZodString; id: z.ZodString; input: z.ZodRecord; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; toolUseId: z.ZodString; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; _meta: z.ZodOptional>; }, z.core.$strip>]>, z.ZodArray; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_use">; name: z.ZodString; id: z.ZodString; input: z.ZodRecord; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; toolUseId: z.ZodString; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; _meta: z.ZodOptional>; }, z.core.$strip>]>>]>; _meta: z.ZodOptional>; }, z.core.$strip>>; modelPreferences: z.ZodOptional; }, z.core.$strip>>>; costPriority: z.ZodOptional; speedPriority: z.ZodOptional; intelligencePriority: z.ZodOptional; }, z.core.$strip>>; systemPrompt: z.ZodOptional; includeContext: z.ZodOptional>; temperature: z.ZodOptional; maxTokens: z.ZodNumber; stopSequences: z.ZodOptional>; metadata: z.ZodOptional>; tools: z.ZodOptional; inputSchema: z.ZodObject<{ type: z.ZodLiteral<"object">; properties: z.ZodOptional>>; required: z.ZodOptional>; }, z.core.$catchall>; outputSchema: z.ZodOptional; properties: z.ZodOptional>>; required: z.ZodOptional>; }, z.core.$catchall>>; annotations: z.ZodOptional; readOnlyHint: z.ZodOptional; destructiveHint: z.ZodOptional; idempotentHint: z.ZodOptional; openWorldHint: z.ZodOptional; }, z.core.$strip>>; execution: z.ZodOptional>; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>>>; toolChoice: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>; }, z.core.$strip>; /** * The client's response to a sampling/create_message request from the server. * This is the backwards-compatible version that returns single content (no arrays). * Used when the request does not include tools. */ declare const CreateMessageResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; model: z.ZodString; stopReason: z.ZodOptional, z.ZodString]>>; role: z.ZodEnum<{ user: "user"; assistant: "assistant"; }>; content: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>; }, z.core.$loose>; /** * The client's response to a sampling/create_message request when tools were provided. * This version supports array content for tool use flows. */ declare const CreateMessageResultWithToolsSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; model: z.ZodString; stopReason: z.ZodOptional, z.ZodString]>>; role: z.ZodEnum<{ user: "user"; assistant: "assistant"; }>; content: z.ZodUnion; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_use">; name: z.ZodString; id: z.ZodString; input: z.ZodRecord; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; toolUseId: z.ZodString; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; _meta: z.ZodOptional>; }, z.core.$strip>]>, z.ZodArray; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_use">; name: z.ZodString; id: z.ZodString; input: z.ZodRecord; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; toolUseId: z.ZodString; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; _meta: z.ZodOptional>; }, z.core.$strip>]>>]>; }, z.core.$loose>; /** * Parameters for an `elicitation/create` request for form-based elicitation. */ declare const ElicitRequestFormParamsSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodOptional; }, z.core.$strip>>; mode: z.ZodOptional>; message: z.ZodString; requestedSchema: z.ZodObject<{ type: z.ZodLiteral<"object">; properties: z.ZodRecord; title: z.ZodOptional; description: z.ZodOptional; enum: z.ZodArray; enumNames: z.ZodOptional>; default: z.ZodOptional; }, z.core.$strip>, z.ZodUnion; title: z.ZodOptional; description: z.ZodOptional; enum: z.ZodArray; default: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"string">; title: z.ZodOptional; description: z.ZodOptional; oneOf: z.ZodArray>; default: z.ZodOptional; }, z.core.$strip>]>, z.ZodUnion; title: z.ZodOptional; description: z.ZodOptional; minItems: z.ZodOptional; maxItems: z.ZodOptional; items: z.ZodObject<{ type: z.ZodLiteral<"string">; enum: z.ZodArray; }, z.core.$strip>; default: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"array">; title: z.ZodOptional; description: z.ZodOptional; minItems: z.ZodOptional; maxItems: z.ZodOptional; items: z.ZodObject<{ anyOf: z.ZodArray>; }, z.core.$strip>; default: z.ZodOptional>; }, z.core.$strip>]>]>, z.ZodObject<{ type: z.ZodLiteral<"boolean">; title: z.ZodOptional; description: z.ZodOptional; default: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"string">; title: z.ZodOptional; description: z.ZodOptional; minLength: z.ZodOptional; maxLength: z.ZodOptional; format: z.ZodOptional>; default: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodEnum<{ number: "number"; integer: "integer"; }>; title: z.ZodOptional; description: z.ZodOptional; minimum: z.ZodOptional; maximum: z.ZodOptional; default: z.ZodOptional; }, z.core.$strip>]>>; required: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>; /** * Parameters for an `elicitation/create` request for URL-based elicitation. */ declare const ElicitRequestURLParamsSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodOptional; }, z.core.$strip>>; mode: z.ZodLiteral<"url">; message: z.ZodString; elicitationId: z.ZodString; url: z.ZodString; }, z.core.$strip>; /** * A request from the server to elicit user input via the client. * The client should present the message and form fields to the user (form mode) * or navigate to a URL (URL mode). */ declare const ElicitRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"elicitation/create">; params: z.ZodUnion>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodOptional; }, z.core.$strip>>; mode: z.ZodOptional>; message: z.ZodString; requestedSchema: z.ZodObject<{ type: z.ZodLiteral<"object">; properties: z.ZodRecord; title: z.ZodOptional; description: z.ZodOptional; enum: z.ZodArray; enumNames: z.ZodOptional>; default: z.ZodOptional; }, z.core.$strip>, z.ZodUnion; title: z.ZodOptional; description: z.ZodOptional; enum: z.ZodArray; default: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"string">; title: z.ZodOptional; description: z.ZodOptional; oneOf: z.ZodArray>; default: z.ZodOptional; }, z.core.$strip>]>, z.ZodUnion; title: z.ZodOptional; description: z.ZodOptional; minItems: z.ZodOptional; maxItems: z.ZodOptional; items: z.ZodObject<{ type: z.ZodLiteral<"string">; enum: z.ZodArray; }, z.core.$strip>; default: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"array">; title: z.ZodOptional; description: z.ZodOptional; minItems: z.ZodOptional; maxItems: z.ZodOptional; items: z.ZodObject<{ anyOf: z.ZodArray>; }, z.core.$strip>; default: z.ZodOptional>; }, z.core.$strip>]>]>, z.ZodObject<{ type: z.ZodLiteral<"boolean">; title: z.ZodOptional; description: z.ZodOptional; default: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"string">; title: z.ZodOptional; description: z.ZodOptional; minLength: z.ZodOptional; maxLength: z.ZodOptional; format: z.ZodOptional>; default: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodEnum<{ number: "number"; integer: "integer"; }>; title: z.ZodOptional; description: z.ZodOptional; minimum: z.ZodOptional; maximum: z.ZodOptional; default: z.ZodOptional; }, z.core.$strip>]>>; required: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodOptional; }, z.core.$strip>>; mode: z.ZodLiteral<"url">; message: z.ZodString; elicitationId: z.ZodString; url: z.ZodString; }, z.core.$strip>]>; }, z.core.$strip>; /** * The client's response to an elicitation/create request from the server. */ declare const ElicitResultSchema: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; action: z.ZodEnum<{ cancel: "cancel"; accept: "accept"; decline: "decline"; }>; content: z.ZodPipe, z.ZodOptional]>>>>; }, z.core.$loose>; /** * A request from the client to the server, to ask for completion options. */ declare const CompleteRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"completion/complete">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; ref: z.ZodUnion; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"ref/resource">; uri: z.ZodString; }, z.core.$strip>]>; argument: z.ZodObject<{ name: z.ZodString; value: z.ZodString; }, z.core.$strip>; context: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>; }, z.core.$strip>; /** * Sent from the server to request a list of root URIs from the client. */ declare const ListRootsRequestSchema: z.ZodObject<{ method: z.ZodLiteral<"roots/list">; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>; declare const ClientRequestSchema: z.ZodUnion; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"initialize">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; protocolVersion: z.ZodString; capabilities: z.ZodObject<{ experimental: z.ZodOptional>>; sampling: z.ZodOptional>; tools: z.ZodOptional>; }, z.core.$strip>>; elicitation: z.ZodOptional, z.ZodIntersection; }, z.core.$strip>, z.ZodRecord>>; url: z.ZodOptional>; }, z.core.$strip>, z.ZodOptional>>>>; roots: z.ZodOptional; }, z.core.$strip>>; tasks: z.ZodOptional>; /** * Present if the client supports cancelling tasks. */ cancel: z.ZodOptional>; /** * Capabilities for task creation on specific request types. */ requests: z.ZodOptional>; }, z.core.$loose>>; /** * Task support for elicitation requests. */ elicitation: z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$strip>; clientInfo: z.ZodObject<{ version: z.ZodString; websiteUrl: z.ZodOptional; description: z.ZodOptional; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"completion/complete">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; ref: z.ZodUnion; name: z.ZodString; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"ref/resource">; uri: z.ZodString; }, z.core.$strip>]>; argument: z.ZodObject<{ name: z.ZodString; value: z.ZodString; }, z.core.$strip>; context: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"logging/setLevel">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; level: z.ZodEnum<{ error: "error"; debug: "debug"; info: "info"; notice: "notice"; warning: "warning"; critical: "critical"; alert: "alert"; emergency: "emergency"; }>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"prompts/get">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; name: z.ZodString; arguments: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; cursor: z.ZodOptional; }, z.core.$strip>>; method: z.ZodLiteral<"prompts/list">; }, z.core.$strip>, z.ZodObject<{ params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; cursor: z.ZodOptional; }, z.core.$strip>>; method: z.ZodLiteral<"resources/list">; }, z.core.$strip>, z.ZodObject<{ params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; cursor: z.ZodOptional; }, z.core.$strip>>; method: z.ZodLiteral<"resources/templates/list">; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"resources/read">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; uri: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"resources/subscribe">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; uri: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"resources/unsubscribe">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; uri: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"tools/call">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodOptional; }, z.core.$strip>>; name: z.ZodString; arguments: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; cursor: z.ZodOptional; }, z.core.$strip>>; method: z.ZodLiteral<"tools/list">; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"tasks/get">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"tasks/result">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; cursor: z.ZodOptional; }, z.core.$strip>>; method: z.ZodLiteral<"tasks/list">; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"tasks/cancel">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; }, z.core.$strip>; }, z.core.$strip>]>; declare const ClientNotificationSchema: z.ZodUnion; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; requestId: z.ZodOptional>; reason: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"notifications/progress">; params: z.ZodObject<{ progressToken: z.ZodUnion; progress: z.ZodNumber; total: z.ZodOptional; message: z.ZodOptional; _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"notifications/initialized">; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"notifications/roots/list_changed">; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"notifications/tasks/status">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; status: z.ZodEnum<{ working: "working"; input_required: "input_required"; completed: "completed"; failed: "failed"; cancelled: "cancelled"; }>; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>]>; declare const ClientResultSchema: z.ZodUnion>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strict>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; model: z.ZodString; stopReason: z.ZodOptional, z.ZodString]>>; role: z.ZodEnum<{ user: "user"; assistant: "assistant"; }>; content: z.ZodDiscriminatedUnion<[z.ZodObject<{ type: z.ZodLiteral<"text">; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; model: z.ZodString; stopReason: z.ZodOptional, z.ZodString]>>; role: z.ZodEnum<{ user: "user"; assistant: "assistant"; }>; content: z.ZodUnion; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_use">; name: z.ZodString; id: z.ZodString; input: z.ZodRecord; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; toolUseId: z.ZodString; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; _meta: z.ZodOptional>; }, z.core.$strip>]>, z.ZodArray; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_use">; name: z.ZodString; id: z.ZodString; input: z.ZodRecord; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; toolUseId: z.ZodString; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; _meta: z.ZodOptional>; }, z.core.$strip>]>>]>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; action: z.ZodEnum<{ cancel: "cancel"; accept: "accept"; decline: "decline"; }>; content: z.ZodPipe, z.ZodOptional]>>>>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; roots: z.ZodArray; _meta: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; status: z.ZodEnum<{ working: "working"; input_required: "input_required"; completed: "completed"; failed: "failed"; cancelled: "cancelled"; }>; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; nextCursor: z.ZodOptional; tasks: z.ZodArray; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodObject<{ taskId: z.ZodString; status: z.ZodEnum<{ working: "working"; input_required: "input_required"; completed: "completed"; failed: "failed"; cancelled: "cancelled"; }>; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>; }, z.core.$loose>]>; declare const ServerRequestSchema: z.ZodUnion; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"sampling/createMessage">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodOptional; }, z.core.$strip>>; messages: z.ZodArray; content: z.ZodUnion; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_use">; name: z.ZodString; id: z.ZodString; input: z.ZodRecord; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; toolUseId: z.ZodString; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; _meta: z.ZodOptional>; }, z.core.$strip>]>, z.ZodArray; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_use">; name: z.ZodString; id: z.ZodString; input: z.ZodRecord; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"tool_result">; toolUseId: z.ZodString; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; _meta: z.ZodOptional>; }, z.core.$strip>]>>]>; _meta: z.ZodOptional>; }, z.core.$strip>>; modelPreferences: z.ZodOptional; }, z.core.$strip>>>; costPriority: z.ZodOptional; speedPriority: z.ZodOptional; intelligencePriority: z.ZodOptional; }, z.core.$strip>>; systemPrompt: z.ZodOptional; includeContext: z.ZodOptional>; temperature: z.ZodOptional; maxTokens: z.ZodNumber; stopSequences: z.ZodOptional>; metadata: z.ZodOptional>; tools: z.ZodOptional; inputSchema: z.ZodObject<{ type: z.ZodLiteral<"object">; properties: z.ZodOptional>>; required: z.ZodOptional>; }, z.core.$catchall>; outputSchema: z.ZodOptional; properties: z.ZodOptional>>; required: z.ZodOptional>; }, z.core.$catchall>>; annotations: z.ZodOptional; readOnlyHint: z.ZodOptional; destructiveHint: z.ZodOptional; idempotentHint: z.ZodOptional; openWorldHint: z.ZodOptional; }, z.core.$strip>>; execution: z.ZodOptional>; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>>>; toolChoice: z.ZodOptional>; }, z.core.$strip>>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"elicitation/create">; params: z.ZodUnion>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodOptional; }, z.core.$strip>>; mode: z.ZodOptional>; message: z.ZodString; requestedSchema: z.ZodObject<{ type: z.ZodLiteral<"object">; properties: z.ZodRecord; title: z.ZodOptional; description: z.ZodOptional; enum: z.ZodArray; enumNames: z.ZodOptional>; default: z.ZodOptional; }, z.core.$strip>, z.ZodUnion; title: z.ZodOptional; description: z.ZodOptional; enum: z.ZodArray; default: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"string">; title: z.ZodOptional; description: z.ZodOptional; oneOf: z.ZodArray>; default: z.ZodOptional; }, z.core.$strip>]>, z.ZodUnion; title: z.ZodOptional; description: z.ZodOptional; minItems: z.ZodOptional; maxItems: z.ZodOptional; items: z.ZodObject<{ type: z.ZodLiteral<"string">; enum: z.ZodArray; }, z.core.$strip>; default: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"array">; title: z.ZodOptional; description: z.ZodOptional; minItems: z.ZodOptional; maxItems: z.ZodOptional; items: z.ZodObject<{ anyOf: z.ZodArray>; }, z.core.$strip>; default: z.ZodOptional>; }, z.core.$strip>]>]>, z.ZodObject<{ type: z.ZodLiteral<"boolean">; title: z.ZodOptional; description: z.ZodOptional; default: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"string">; title: z.ZodOptional; description: z.ZodOptional; minLength: z.ZodOptional; maxLength: z.ZodOptional; format: z.ZodOptional>; default: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ type: z.ZodEnum<{ number: "number"; integer: "integer"; }>; title: z.ZodOptional; description: z.ZodOptional; minimum: z.ZodOptional; maximum: z.ZodOptional; default: z.ZodOptional; }, z.core.$strip>]>>; required: z.ZodOptional>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodOptional; }, z.core.$strip>>; mode: z.ZodLiteral<"url">; message: z.ZodString; elicitationId: z.ZodString; url: z.ZodString; }, z.core.$strip>]>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"roots/list">; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"tasks/get">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"tasks/result">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; cursor: z.ZodOptional; }, z.core.$strip>>; method: z.ZodLiteral<"tasks/list">; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"tasks/cancel">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; }, z.core.$strip>; }, z.core.$strip>]>; declare const ServerNotificationSchema: z.ZodUnion; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; requestId: z.ZodOptional>; reason: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"notifications/progress">; params: z.ZodObject<{ progressToken: z.ZodUnion; progress: z.ZodNumber; total: z.ZodOptional; message: z.ZodOptional; _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"notifications/message">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; level: z.ZodEnum<{ error: "error"; debug: "debug"; info: "info"; notice: "notice"; warning: "warning"; critical: "critical"; alert: "alert"; emergency: "emergency"; }>; logger: z.ZodOptional; data: z.ZodUnknown; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"notifications/resources/updated">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; uri: z.ZodString; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"notifications/resources/list_changed">; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"notifications/tools/list_changed">; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"notifications/prompts/list_changed">; params: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strip>>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"notifications/tasks/status">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; status: z.ZodEnum<{ working: "working"; input_required: "input_required"; completed: "completed"; failed: "failed"; cancelled: "cancelled"; }>; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>; }, z.core.$strip>, z.ZodObject<{ method: z.ZodLiteral<"notifications/elicitation/complete">; params: z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; elicitationId: z.ZodString; }, z.core.$strip>; }, z.core.$strip>]>; declare const ServerResultSchema: z.ZodUnion>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; }, z.core.$strict>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; protocolVersion: z.ZodString; capabilities: z.ZodObject<{ experimental: z.ZodOptional>>; logging: z.ZodOptional>; completions: z.ZodOptional>; prompts: z.ZodOptional; }, z.core.$strip>>; resources: z.ZodOptional; listChanged: z.ZodOptional; }, z.core.$strip>>; tools: z.ZodOptional; }, z.core.$strip>>; tasks: z.ZodOptional>; /** * Present if the server supports cancelling tasks. */ cancel: z.ZodOptional>; /** * Capabilities for task creation on specific request types. */ requests: z.ZodOptional>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$loose>>; }, z.core.$strip>; serverInfo: z.ZodObject<{ version: z.ZodString; websiteUrl: z.ZodOptional; description: z.ZodOptional; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>; instructions: z.ZodOptional; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; completion: z.ZodObject<{ /** * An array of completion values. Must not exceed 100 items. */ values: z.ZodArray; /** * The total number of completion options available. This can exceed the number of values actually sent in the response. */ total: z.ZodOptional; /** * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. */ hasMore: z.ZodOptional; }, z.core.$loose>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; description: z.ZodOptional; messages: z.ZodArray; content: z.ZodUnion; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>; }, z.core.$strip>>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; nextCursor: z.ZodOptional; prompts: z.ZodArray; arguments: z.ZodOptional; required: z.ZodOptional; }, z.core.$strip>>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; nextCursor: z.ZodOptional; resources: z.ZodArray; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; nextCursor: z.ZodOptional; resourceTemplates: z.ZodArray; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; contents: z.ZodArray; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; content: z.ZodDefault; text: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"image">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"audio">; data: z.ZodString; mimeType: z.ZodString; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; description: z.ZodOptional; mimeType: z.ZodOptional; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; type: z.ZodLiteral<"resource_link">; }, z.core.$strip>, z.ZodObject<{ type: z.ZodLiteral<"resource">; resource: z.ZodUnion; _meta: z.ZodOptional>; text: z.ZodString; }, z.core.$strip>, z.ZodObject<{ uri: z.ZodString; mimeType: z.ZodOptional; _meta: z.ZodOptional>; blob: z.ZodString; }, z.core.$strip>]>; annotations: z.ZodOptional>>; priority: z.ZodOptional; lastModified: z.ZodOptional; }, z.core.$strip>>; _meta: z.ZodOptional>; }, z.core.$strip>]>>>; structuredContent: z.ZodOptional>; isError: z.ZodOptional; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; nextCursor: z.ZodOptional; tools: z.ZodArray; inputSchema: z.ZodObject<{ type: z.ZodLiteral<"object">; properties: z.ZodOptional>>; required: z.ZodOptional>; }, z.core.$catchall>; outputSchema: z.ZodOptional; properties: z.ZodOptional>>; required: z.ZodOptional>; }, z.core.$catchall>>; annotations: z.ZodOptional; readOnlyHint: z.ZodOptional; destructiveHint: z.ZodOptional; idempotentHint: z.ZodOptional; openWorldHint: z.ZodOptional; }, z.core.$strip>>; execution: z.ZodOptional>; }, z.core.$strip>>; _meta: z.ZodOptional>; icons: z.ZodOptional; sizes: z.ZodOptional>; theme: z.ZodOptional>; }, z.core.$strip>>>; name: z.ZodString; title: z.ZodOptional; }, z.core.$strip>>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; taskId: z.ZodString; status: z.ZodEnum<{ working: "working"; input_required: "input_required"; completed: "completed"; failed: "failed"; cancelled: "cancelled"; }>; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; nextCursor: z.ZodOptional; tasks: z.ZodArray; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>>; }, z.core.$loose>, z.ZodObject<{ _meta: z.ZodOptional>; /** * If specified, this request is related to the provided task. */ "io.modelcontextprotocol/related-task": z.ZodOptional>; }, z.core.$loose>>; task: z.ZodObject<{ taskId: z.ZodString; status: z.ZodEnum<{ working: "working"; input_required: "input_required"; completed: "completed"; failed: "failed"; cancelled: "cancelled"; }>; ttl: z.ZodUnion; createdAt: z.ZodString; lastUpdatedAt: z.ZodString; pollInterval: z.ZodOptional; statusMessage: z.ZodOptional; }, z.core.$strip>; }, z.core.$loose>]>; declare class McpError extends Error { readonly code: number; readonly data?: unknown; constructor(code: number, message: string, data?: unknown); /** * Factory method to create the appropriate error type based on the error code and data */ static fromError(code: number, message: string, data?: unknown): McpError; } type Primitive = string | number | boolean | bigint | null | undefined; type Flatten = T extends Primitive ? T : T extends Array ? Array> : T extends Set ? Set> : T extends Map ? Map, Flatten> : T extends object ? { [K in keyof T]: Flatten } : T; type Infer = Flatten>; /** * Headers that are compatible with both Node.js and the browser. */ type IsomorphicHeaders = Record; /** * Information about the incoming request. */ interface RequestInfo { /** * The headers of the request. */ headers: IsomorphicHeaders; } /** * Extra information about a message. */ interface MessageExtraInfo { /** * The request information. */ requestInfo?: RequestInfo; /** * The authentication information. */ authInfo?: AuthInfo; /** * Callback to close the SSE stream for this request, triggering client reconnection. * Only available when using StreamableHTTPServerTransport with eventStore configured. */ closeSSEStream?: () => void; /** * Callback to close the standalone GET SSE stream, triggering client reconnection. * Only available when using StreamableHTTPServerTransport with eventStore configured. */ closeStandaloneSSEStream?: () => void; } type Request = Infer; type RequestMeta = Infer; type Notification = Infer; type Result = Infer; type RequestId = Infer; type JSONRPCRequest = Infer; type JSONRPCNotification = Infer; type JSONRPCErrorResponse = Infer; type JSONRPCResultResponse = Infer; type JSONRPCMessage = Infer; type Implementation = Infer; type ClientCapabilities = Infer; type InitializeRequest = Infer; type ServerCapabilities = Infer; type InitializeResult = Infer; type Progress = Infer; type Task = Infer; type TaskCreationParams = Infer; type RelatedTaskMetadata = Infer; type CreateTaskResult = Infer; type GetTaskRequest = Infer; type GetTaskResult = Infer; type GetTaskPayloadRequest = Infer; type ListTasksResult = Infer; type CancelTaskResult = Infer; type ResourceContents = Infer; type Resource = Infer; type ResourceTemplate = Infer; type ListResourcesRequest = Infer; type ListResourcesResult = Infer; type ListResourceTemplatesRequest = Infer; type ReadResourceRequest = Infer; type ReadResourceResult = Infer; type SubscribeRequest = Infer; type UnsubscribeRequest = Infer; type ResourceUpdatedNotification = Infer; type Prompt = Infer; type ListPromptsRequest = Infer; type ListPromptsResult = Infer; type GetPromptRequest = Infer; type PromptMessage = Infer; type GetPromptResult = Infer; type ToolAnnotations = Infer; type ToolExecution = Infer; type Tool = Infer; type ListToolsRequest = Infer; type ListToolsResult = Infer; type CallToolResult = Infer; type CallToolRequest = Infer; type LoggingLevel = Infer; type LoggingMessageNotification = Infer; type CreateMessageRequestParams = Infer; type CreateMessageRequest = Infer; type CreateMessageResult = Infer; type CreateMessageResultWithTools = Infer; /** * CreateMessageRequestParams without tools - for backwards-compatible overload. * Excludes tools/toolChoice to indicate they should not be provided. */ type CreateMessageRequestParamsBase = Omit; /** * CreateMessageRequestParams with required tools - for tool-enabled overload. */ interface CreateMessageRequestParamsWithTools extends CreateMessageRequestParams { tools: Tool[]; } type ElicitRequestFormParams = Infer; type ElicitRequestURLParams = Infer; type ElicitRequest = Infer; type ElicitResult = Infer; type CompleteRequest = Infer; type ListRootsRequest = Infer; type ClientRequest = Infer; type ClientNotification = Infer; type ClientResult = Infer; type ServerRequest = Infer; type ServerNotification = Infer; type ServerResult = Infer; //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/transport.d.ts /** * Options for sending a JSON-RPC message. */ type TransportSendOptions = { /** * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with. */ relatedRequestId?: RequestId; /** * The resumption token used to continue long-running requests that were interrupted. * * This allows clients to reconnect and continue from where they left off, if supported by the transport. */ resumptionToken?: string; /** * A callback that is invoked when the resumption token changes, if supported by the transport. * * This allows clients to persist the latest token for potential reconnection. */ onresumptiontoken?: (token: string) => void; }; /** * Describes the minimal contract for an MCP transport that a client or server can communicate over. */ interface Transport { /** * Starts processing messages on the transport, including any connection steps that might need to be taken. * * This method should only be called after callbacks are installed, or else messages may be lost. * * NOTE: This method should not be called explicitly when using Client, Server, or Protocol classes, as they will implicitly call start(). */ start(): Promise; /** * Sends a JSON-RPC message (request or response). * * If present, `relatedRequestId` is used to indicate to the transport which incoming request to associate this outgoing message with. */ send(message: JSONRPCMessage, options?: TransportSendOptions): Promise; /** * Closes the connection. */ close(): Promise; /** * Callback for when the connection is closed for any reason. * * This should be invoked when close() is called as well. */ onclose?: () => void; /** * Callback for when an error occurs. * * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. */ onerror?: (error: Error) => void; /** * Callback for when a message (request or response) is received over the connection. * * Includes the requestInfo and authInfo if the transport is authenticated. * * The requestInfo can be used to get the original request information (headers, etc.) */ onmessage?: (message: T, extra?: MessageExtraInfo) => void; /** * The session ID generated for this connection. */ sessionId?: string; /** * Sets the protocol version used for the connection (called when the initialize response is received). */ setProtocolVersion?: (version: string) => void; } //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.d.ts /** * Extended handler extra with task store for task creation. * @experimental */ interface CreateTaskRequestHandlerExtra extends RequestHandlerExtra { taskStore: RequestTaskStore; } /** * Extended handler extra with task ID and store for task operations. * @experimental */ interface TaskRequestHandlerExtra extends RequestHandlerExtra { taskId: string; taskStore: RequestTaskStore; } /** * Base callback type for tool handlers. * @experimental */ type BaseToolCallback$1, Args extends undefined | ZodRawShapeCompat | AnySchema = undefined> = Args extends ZodRawShapeCompat ? (args: ShapeOutput, extra: ExtraT) => SendResultT | Promise : Args extends AnySchema ? (args: unknown, extra: ExtraT) => SendResultT | Promise : (extra: ExtraT) => SendResultT | Promise; /** * Handler for creating a task. * @experimental */ type CreateTaskRequestHandler = BaseToolCallback$1; /** * Handler for task operations (get, getResult). * @experimental */ type TaskRequestHandler = BaseToolCallback$1; /** * Interface for task-based tool handlers. * @experimental */ interface ToolTaskHandler { createTask: CreateTaskRequestHandler; getTask: TaskRequestHandler; getTaskResult: TaskRequestHandler; } /** * Task-specific execution configuration. * taskSupport cannot be 'forbidden' for task-based tools. * @experimental */ type TaskToolExecution = Omit & { taskSupport: TaskSupport extends 'forbidden' | undefined ? never : TaskSupport; }; /** * Represents a message queued for side-channel delivery via tasks/result. * * This is a serializable data structure that can be stored in external systems. * All fields are JSON-serializable. */ type QueuedMessage = QueuedRequest | QueuedNotification | QueuedResponse | QueuedError; interface BaseQueuedMessage { /** Type of message */ type: string; /** When the message was queued (milliseconds since epoch) */ timestamp: number; } interface QueuedRequest extends BaseQueuedMessage { type: 'request'; /** The actual JSONRPC request */ message: JSONRPCRequest; } interface QueuedNotification extends BaseQueuedMessage { type: 'notification'; /** The actual JSONRPC notification */ message: JSONRPCNotification; } interface QueuedResponse extends BaseQueuedMessage { type: 'response'; /** The actual JSONRPC response */ message: JSONRPCResultResponse; } interface QueuedError extends BaseQueuedMessage { type: 'error'; /** The actual JSONRPC error */ message: JSONRPCErrorResponse; } /** * Interface for managing per-task FIFO message queues. * * Similar to TaskStore, this allows pluggable queue implementations * (in-memory, Redis, other distributed queues, etc.). * * Each method accepts taskId and optional sessionId parameters to enable * a single queue instance to manage messages for multiple tasks, with * isolation based on task ID and session ID. * * All methods are async to support external storage implementations. * All data in QueuedMessage must be JSON-serializable. * * @experimental */ interface TaskMessageQueue { /** * Adds a message to the end of the queue for a specific task. * Atomically checks queue size and throws if maxSize would be exceeded. * @param taskId The task identifier * @param message The message to enqueue * @param sessionId Optional session ID for binding the operation to a specific session * @param maxSize Optional maximum queue size - if specified and queue is full, throws an error * @throws Error if maxSize is specified and would be exceeded */ enqueue(taskId: string, message: QueuedMessage, sessionId?: string, maxSize?: number): Promise; /** * Removes and returns the first message from the queue for a specific task. * @param taskId The task identifier * @param sessionId Optional session ID for binding the query to a specific session * @returns The first message, or undefined if the queue is empty */ dequeue(taskId: string, sessionId?: string): Promise; /** * Removes and returns all messages from the queue for a specific task. * Used when tasks are cancelled or failed to clean up pending messages. * @param taskId The task identifier * @param sessionId Optional session ID for binding the query to a specific session * @returns Array of all messages that were in the queue */ dequeueAll(taskId: string, sessionId?: string): Promise; } /** * Task creation options. * @experimental */ interface CreateTaskOptions { /** * Time in milliseconds to keep task results available after completion. * If null, the task has unlimited lifetime until manually cleaned up. */ ttl?: number | null; /** * Time in milliseconds to wait between task status requests. */ pollInterval?: number; /** * Additional context to pass to the task store. */ context?: Record; } /** * Interface for storing and retrieving task state and results. * * Similar to Transport, this allows pluggable task storage implementations * (in-memory, database, distributed cache, etc.). * * @experimental */ interface TaskStore { /** * Creates a new task with the given creation parameters and original request. * The implementation must generate a unique taskId and createdAt timestamp. * * TTL Management: * - The implementation receives the TTL suggested by the requestor via taskParams.ttl * - The implementation MAY override the requested TTL (e.g., to enforce limits) * - The actual TTL used MUST be returned in the Task object * - Null TTL indicates unlimited task lifetime (no automatic cleanup) * - Cleanup SHOULD occur automatically after TTL expires, regardless of task status * * @param taskParams - The task creation parameters from the request (ttl, pollInterval) * @param requestId - The JSON-RPC request ID * @param request - The original request that triggered task creation * @param sessionId - Optional session ID for binding the task to a specific session * @returns The created task object */ createTask(taskParams: CreateTaskOptions, requestId: RequestId, request: Request, sessionId?: string): Promise; /** * Gets the current status of a task. * * @param taskId - The task identifier * @param sessionId - Optional session ID for binding the query to a specific session * @returns The task object, or null if it does not exist */ getTask(taskId: string, sessionId?: string): Promise; /** * Stores the result of a task and sets its final status. * * @param taskId - The task identifier * @param status - The final status: 'completed' for success, 'failed' for errors * @param result - The result to store * @param sessionId - Optional session ID for binding the operation to a specific session */ storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result, sessionId?: string): Promise; /** * Retrieves the stored result of a task. * * @param taskId - The task identifier * @param sessionId - Optional session ID for binding the query to a specific session * @returns The stored result */ getTaskResult(taskId: string, sessionId?: string): Promise; /** * Updates a task's status (e.g., to 'cancelled', 'failed', 'completed'). * * @param taskId - The task identifier * @param status - The new status * @param statusMessage - Optional diagnostic message for failed tasks or other status information * @param sessionId - Optional session ID for binding the operation to a specific session */ updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string, sessionId?: string): Promise; /** * Lists tasks, optionally starting from a pagination cursor. * * @param cursor - Optional cursor for pagination * @param sessionId - Optional session ID for binding the query to a specific session * @returns An object containing the tasks array and an optional nextCursor */ listTasks(cursor?: string, sessionId?: string): Promise<{ tasks: Task[]; nextCursor?: string; }>; } //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/responseMessage.d.ts /** * Base message type */ interface BaseResponseMessage { type: string; } /** * Task status update message */ interface TaskStatusMessage extends BaseResponseMessage { type: 'taskStatus'; task: Task; } /** * Task created message (first message for task-augmented requests) */ interface TaskCreatedMessage extends BaseResponseMessage { type: 'taskCreated'; task: Task; } /** * Final result message (terminal) */ interface ResultMessage extends BaseResponseMessage { type: 'result'; result: T; } /** * Error message (terminal) */ interface ErrorMessage extends BaseResponseMessage { type: 'error'; error: McpError; } /** * Union type representing all possible messages that can be yielded during request processing. * Note: Progress notifications are handled through the existing onprogress callback mechanism. * Side-channeled messages (server requests/notifications) are handled through registered handlers. */ type ResponseMessage = TaskStatusMessage | TaskCreatedMessage | ResultMessage | ErrorMessage; //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.d.ts /** * Callback for progress notifications. */ type ProgressCallback = (progress: Progress) => void; /** * Additional initialization options. */ type ProtocolOptions = { /** * Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities. * * Note that this DOES NOT affect checking of _local_ side capabilities, as it is considered a logic error to mis-specify those. * * Currently this defaults to false, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to true. */ enforceStrictCapabilities?: boolean; /** * An array of notification method names that should be automatically debounced. * Any notifications with a method in this list will be coalesced if they * occur in the same tick of the event loop. * e.g., ['notifications/tools/list_changed'] */ debouncedNotificationMethods?: string[]; /** * Optional task storage implementation. If provided, enables task-related request handlers * and provides task storage capabilities to request handlers. */ taskStore?: TaskStore; /** * Optional task message queue implementation for managing server-initiated messages * that will be delivered through the tasks/result response stream. */ taskMessageQueue?: TaskMessageQueue; /** * Default polling interval (in milliseconds) for task status checks when no pollInterval * is provided by the server. Defaults to 5000ms if not specified. */ defaultTaskPollInterval?: number; /** * Maximum number of messages that can be queued per task for side-channel delivery. * If undefined, the queue size is unbounded. * When the limit is exceeded, the TaskMessageQueue implementation's enqueue() method * will throw an error. It's the implementation's responsibility to handle overflow * appropriately (e.g., by failing the task, dropping messages, etc.). */ maxTaskQueueSize?: number; }; /** * Options that can be given per request. */ type RequestOptions = { /** * If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked. * * For task-augmented requests: progress notifications continue after CreateTaskResult is returned and stop automatically when the task reaches a terminal status. */ onprogress?: ProgressCallback; /** * Can be used to cancel an in-flight request. This will cause an AbortError to be raised from request(). */ signal?: AbortSignal; /** * A timeout (in milliseconds) for this request. If exceeded, an McpError with code `RequestTimeout` will be raised from request(). * * If not specified, `DEFAULT_REQUEST_TIMEOUT_MSEC` will be used as the timeout. */ timeout?: number; /** * If true, receiving a progress notification will reset the request timeout. * This is useful for long-running operations that send periodic progress updates. * Default: false */ resetTimeoutOnProgress?: boolean; /** * Maximum total time (in milliseconds) to wait for a response. * If exceeded, an McpError with code `RequestTimeout` will be raised, regardless of progress notifications. * If not specified, there is no maximum total timeout. */ maxTotalTimeout?: number; /** * If provided, augments the request with task creation parameters to enable call-now, fetch-later execution patterns. */ task?: TaskCreationParams; /** * If provided, associates this request with a related task. */ relatedTask?: RelatedTaskMetadata; } & TransportSendOptions; /** * Options that can be given per notification. */ type NotificationOptions = { /** * May be used to indicate to the transport which incoming request to associate this outgoing notification with. */ relatedRequestId?: RequestId; /** * If provided, associates this notification with a related task. */ relatedTask?: RelatedTaskMetadata; }; /** * Options that can be given per request. */ type TaskRequestOptions = Omit; /** * Request-scoped TaskStore interface. */ interface RequestTaskStore { /** * Creates a new task with the given creation parameters. * The implementation generates a unique taskId and createdAt timestamp. * * @param taskParams - The task creation parameters from the request * @returns The created task object */ createTask(taskParams: CreateTaskOptions): Promise; /** * Gets the current status of a task. * * @param taskId - The task identifier * @returns The task object * @throws If the task does not exist */ getTask(taskId: string): Promise; /** * Stores the result of a task and sets its final status. * * @param taskId - The task identifier * @param status - The final status: 'completed' for success, 'failed' for errors * @param result - The result to store */ storeTaskResult(taskId: string, status: 'completed' | 'failed', result: Result): Promise; /** * Retrieves the stored result of a task. * * @param taskId - The task identifier * @returns The stored result */ getTaskResult(taskId: string): Promise; /** * Updates a task's status (e.g., to 'cancelled', 'failed', 'completed'). * * @param taskId - The task identifier * @param status - The new status * @param statusMessage - Optional diagnostic message for failed tasks or other status information */ updateTaskStatus(taskId: string, status: Task['status'], statusMessage?: string): Promise; /** * Lists tasks, optionally starting from a pagination cursor. * * @param cursor - Optional cursor for pagination * @returns An object containing the tasks array and an optional nextCursor */ listTasks(cursor?: string): Promise<{ tasks: Task[]; nextCursor?: string; }>; } /** * Extra data given to request handlers. */ type RequestHandlerExtra = { /** * An abort signal used to communicate if the request was cancelled from the sender's side. */ signal: AbortSignal; /** * Information about a validated access token, provided to request handlers. */ authInfo?: AuthInfo; /** * The session ID from the transport, if available. */ sessionId?: string; /** * Metadata from the original request. */ _meta?: RequestMeta; /** * The JSON-RPC ID of the request being handled. * This can be useful for tracking or logging purposes. */ requestId: RequestId; taskId?: string; taskStore?: RequestTaskStore; taskRequestedTtl?: number | null; /** * The original HTTP request. */ requestInfo?: RequestInfo; /** * Sends a notification that relates to the current request being handled. * * This is used by certain transports to correctly associate related messages. */ sendNotification: (notification: SendNotificationT) => Promise; /** * Sends a request that relates to the current request being handled. * * This is used by certain transports to correctly associate related messages. */ sendRequest: (request: SendRequestT, resultSchema: U, options?: TaskRequestOptions) => Promise>; /** * Closes the SSE stream for this request, triggering client reconnection. * Only available when using StreamableHTTPServerTransport with eventStore configured. * Use this to implement polling behavior during long-running operations. */ closeSSEStream?: () => void; /** * Closes the standalone GET SSE stream, triggering client reconnection. * Only available when using StreamableHTTPServerTransport with eventStore configured. * Use this to implement polling behavior for server-initiated notifications. */ closeStandaloneSSEStream?: () => void; }; /** * Implements MCP protocol framing on top of a pluggable transport, including * features like request/response linking, notifications, and progress. */ declare abstract class Protocol { private _options?; private _transport?; private _requestMessageId; private _requestHandlers; private _requestHandlerAbortControllers; private _notificationHandlers; private _responseHandlers; private _progressHandlers; private _timeoutInfo; private _pendingDebouncedNotifications; private _taskProgressTokens; private _taskStore?; private _taskMessageQueue?; private _requestResolvers; /** * Callback for when the connection is closed for any reason. * * This is invoked when close() is called as well. */ onclose?: () => void; /** * Callback for when an error occurs. * * Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band. */ onerror?: (error: Error) => void; /** * A handler to invoke for any request types that do not have their own handler installed. */ fallbackRequestHandler?: (request: JSONRPCRequest, extra: RequestHandlerExtra) => Promise; /** * A handler to invoke for any notification types that do not have their own handler installed. */ fallbackNotificationHandler?: (notification: Notification) => Promise; constructor(_options?: ProtocolOptions | undefined); private _oncancel; private _setupTimeout; private _resetTimeout; private _cleanupTimeout; /** * Attaches to the given transport, starts it, and starts listening for messages. * * The Protocol object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. */ connect(transport: Transport): Promise; private _onclose; private _onerror; private _onnotification; private _onrequest; private _onprogress; private _onresponse; get transport(): Transport | undefined; /** * Closes the connection. */ close(): Promise; /** * A method to check if a capability is supported by the remote side, for the given method to be called. * * This should be implemented by subclasses. */ protected abstract assertCapabilityForMethod(method: SendRequestT['method']): void; /** * A method to check if a notification is supported by the local side, for the given method to be sent. * * This should be implemented by subclasses. */ protected abstract assertNotificationCapability(method: SendNotificationT['method']): void; /** * A method to check if a request handler is supported by the local side, for the given method to be handled. * * This should be implemented by subclasses. */ protected abstract assertRequestHandlerCapability(method: string): void; /** * A method to check if task creation is supported for the given request method. * * This should be implemented by subclasses. */ protected abstract assertTaskCapability(method: string): void; /** * A method to check if task handler is supported by the local side, for the given method to be handled. * * This should be implemented by subclasses. */ protected abstract assertTaskHandlerCapability(method: string): void; /** * Sends a request and returns an AsyncGenerator that yields response messages. * The generator is guaranteed to end with either a 'result' or 'error' message. * * @example * ```typescript * const stream = protocol.requestStream(request, resultSchema, options); * for await (const message of stream) { * switch (message.type) { * case 'taskCreated': * console.log('Task created:', message.task.taskId); * break; * case 'taskStatus': * console.log('Task status:', message.task.status); * break; * case 'result': * console.log('Final result:', message.result); * break; * case 'error': * console.error('Error:', message.error); * break; * } * } * ``` * * @experimental Use `client.experimental.tasks.requestStream()` to access this method. */ protected requestStream(request: SendRequestT, resultSchema: T, options?: RequestOptions): AsyncGenerator>, void, void>; /** * Sends a request and waits for a response. * * Do not use this method to emit notifications! Use notification() instead. */ request(request: SendRequestT, resultSchema: T, options?: RequestOptions): Promise>; /** * Gets the current status of a task. * * @experimental Use `client.experimental.tasks.getTask()` to access this method. */ protected getTask(params: GetTaskRequest['params'], options?: RequestOptions): Promise; /** * Retrieves the result of a completed task. * * @experimental Use `client.experimental.tasks.getTaskResult()` to access this method. */ protected getTaskResult(params: GetTaskPayloadRequest['params'], resultSchema: T, options?: RequestOptions): Promise>; /** * Lists tasks, optionally starting from a pagination cursor. * * @experimental Use `client.experimental.tasks.listTasks()` to access this method. */ protected listTasks(params?: { cursor?: string; }, options?: RequestOptions): Promise>; /** * Cancels a specific task. * * @experimental Use `client.experimental.tasks.cancelTask()` to access this method. */ protected cancelTask(params: { taskId: string; }, options?: RequestOptions): Promise>; /** * Emits a notification, which is a one-way message that does not expect a response. */ notification(notification: SendNotificationT, options?: NotificationOptions): Promise; /** * Registers a handler to invoke when this protocol object receives a request with the given method. * * Note that this will replace any previous request handler for the same method. */ setRequestHandler(requestSchema: T, handler: (request: SchemaOutput, extra: RequestHandlerExtra) => SendResultT | Promise): void; /** * Removes the request handler for the given method. */ removeRequestHandler(method: string): void; /** * Asserts that a request handler has not already been set for the given method, in preparation for a new one being automatically installed. */ assertCanSetRequestHandler(method: string): void; /** * Registers a handler to invoke when this protocol object receives a notification with the given method. * * Note that this will replace any previous notification handler for the same method. */ setNotificationHandler(notificationSchema: T, handler: (notification: SchemaOutput) => void | Promise): void; /** * Removes the notification handler for the given method. */ removeNotificationHandler(method: string): void; /** * Cleans up the progress handler associated with a task. * This should be called when a task reaches a terminal status. */ private _cleanupTaskProgressHandler; /** * Enqueues a task-related message for side-channel delivery via tasks/result. * @param taskId The task ID to associate the message with * @param message The message to enqueue * @param sessionId Optional session ID for binding the operation to a specific session * @throws Error if taskStore is not configured or if enqueue fails (e.g., queue overflow) * * Note: If enqueue fails, it's the TaskMessageQueue implementation's responsibility to handle * the error appropriately (e.g., by failing the task, logging, etc.). The Protocol layer * simply propagates the error. */ private _enqueueTaskMessage; /** * Clears the message queue for a task and rejects any pending request resolvers. * @param taskId The task ID whose queue should be cleared * @param sessionId Optional session ID for binding the operation to a specific session */ private _clearTaskQueue; /** * Waits for a task update (new messages or status change) with abort signal support. * Uses polling to check for updates at the task's configured poll interval. * @param taskId The task ID to wait for * @param signal Abort signal to cancel the wait * @returns Promise that resolves when an update occurs or rejects if aborted */ private _waitForTaskUpdate; private requestTaskStore; } declare function mergeCapabilities(base: ServerCapabilities, additional: Partial): ServerCapabilities; declare function mergeCapabilities(base: ClientCapabilities, additional: Partial): ClientCapabilities; //#endregion //#region ../../node_modules/.pnpm/json-schema-typed@8.0.2/node_modules/json-schema-typed/draft_2020_12.d.ts type MaybeReadonlyArray = Array | ReadonlyArray; type ValueOf = T[keyof T]; /** * JSON Schema [Draft 2020-12](https://json-schema.org/draft/2020-12/json-schema-validation.html) */ type JSONSchema ? "object" : JSONSchema.TypeValue)> = boolean | { /** * Using JSON Pointer fragments requires knowledge of the structure of the * schema. When writing schema documents with the intention to provide * re-usable schemas, it may be preferable to use a plain name fragment * that is not tied to any particular structural location. This allows a * subschema to be relocated without requiring JSON Pointer references to * be updated. * * The `$anchor` keyword is used to specify such a fragment. It is an * identifier keyword that can only be used to create plain name fragments. * * If present, the value of this keyword MUST be a string, which MUST start * with a letter `[A-Za-z]`, followed by any number of letters, digits * `[0-9]`, hyphens `-`, underscores `_`, colons `:`, * or periods `.`. * * Note that the anchor string does not include the `#` character, * as it is not a URI-reference. An `{"$anchor": "foo"}` becomes the * fragment `#foo` when used in a URI. * * The base URI to which the resulting fragment is appended is determined * by the `$id` keyword as explained in the previous section. * Two `$anchor` keywords in the same schema document MAY have the same * value if they apply to different base URIs, as the resulting full URIs * will be distinct. However, the effect of two `$anchor` keywords * with the same value and the same base URI is undefined. Implementations * MAY raise an error if such usage is detected. */ $anchor?: string; /** * This keyword reserves a location for comments from schema authors to * readers or maintainers of the schema. * * The value of this keyword MUST be a string. Implementations MUST NOT * present this string to end users. Tools for editing schemas SHOULD * support displaying and editing this keyword. The value of this keyword * MAY be used in debug or error output which is intended for developers * making use of schemas. * * Schema vocabularies SHOULD allow `$comment` within any object * containing vocabulary keywords. Implementations MAY assume `$comment` * is allowed unless the vocabulary specifically forbids it. Vocabularies * MUST NOT specify any effect of `$comment` beyond what is described in * this specification. * * Tools that translate other media types or programming languages * to and from `application/schema+json` MAY choose to convert that media * type or programming language's native comments to or from `$comment` * values. The behavior of such translation when both native comments and * `$comment` properties are present is implementation-dependent. * * Implementations MAY strip `$comment` values at any point during * processing. In particular, this allows for shortening schemas when the * size of deployed schemas is a concern. * * Implementations MUST NOT take any other action based on the presence, * absence, or contents of `$comment` properties. In particular, the * value of `$comment` MUST NOT be collected as an annotation result. */ $comment?: string; /** * The `$defs` keyword reserves a location for schema authors to inline * re-usable JSON Schemas into a more general schema. The keyword does not * directly affect the validation result. * * This keyword's value MUST be an object. Each member value of this object * MUST be a valid JSON Schema. */ $defs?: Record; /** * "The `$dynamicAnchor` indicates that the fragment is an extension * point when used with the `$dynamicRef` keyword. This low-level, * advanced feature makes it easier to extend recursive schemas such as the * meta-schemas, without imposing any particular semantics on that * extension. See `$dynamicRef` for more details. */ $dynamicAnchor?: string; /** * The `$dynamicRef` keyword is an applicator that allows for deferring * the full resolution until runtime, at which point it is resolved each * time it is encountered while evaluating an instance. * * Together with `$dynamicAnchor`, `$dynamicRef` implements a * cooperative extension mechanism that is primarily useful with recursive * schemas (schemas that reference themselves). Both the extension point * and the runtime-determined extension target are defined with * `$dynamicAnchor`, and only exhibit runtime dynamic behavior when * referenced with `$dynamicRef`. * * The value of the `$dynamicRef` property MUST be a string which is * a URI-Reference. Resolved against the current URI base, it produces * the URI used as the starting point for runtime resolution. This initial * resolution is safe to perform on schema load. * * If the initially resolved starting point URI includes a fragment that * was created by the `$dynamicAnchor` keyword, the initial URI MUST be * replaced by the URI (including the fragment) for the outermost schema * resource in the [dynamic scope][scopes] that defines * an identically named fragment with `$dynamicAnchor`. * * Otherwise, its behavior is identical to `$ref`, and no runtime * resolution is needed. * * [scopes]: https://json-schema.org/draft/2020-12/json-schema-core.html#scopes * * @format "uri-reference" */ $dynamicRef?: string; /** * The `$id` keyword identifies a schema resource with its * [canonical][[RFC6596]] URI. * * Note that this URI is an identifier and not necessarily a network * locator. In the case of a network-addressable URL, a schema need not be * downloadable from its canonical URI. * * If present, the value for this keyword MUST be a string, and MUST * represent a valid [URI-reference][RFC3986]. This URI-reference SHOULD * be normalized, and MUST resolve to an [absolute-URI][RFC3986] (without a * fragment). Therefore, `$id` MUST NOT contain a non-empty fragment, * and SHOULD NOT contain an empty fragment. * * Since an empty fragment in the context of the * `application/schema+json` media type refers to the same resource as * the base URI without a fragment, an implementation MAY normalize a URI * ending with an empty fragment by removing the fragment. However, schema * authors SHOULD NOT rely on this behavior across implementations. * * This URI also serves as the base URI for relative URI-references in * keywords within the schema resource, in accordance with * [RFC 3986][RFC3986] section 5.1.1 regarding base URIs embedded in * content. * * The presence of `$id` in a subschema indicates that the subschema * constitutes a distinct schema resource within a single schema document. * Furthermore, in accordance with [RFC 3986][RFC3986] section 5.1.2 * regarding encapsulating entities, if an `$id` in a subschema is a * relative URI-reference, the base URI for resolving that reference is the * URI of the parent schema resource. * * If no parent schema object explicitly identifies itself as a resource * with `$id`, the base URI is that of the entire document. * * The root schema of a JSON Schema document SHOULD contain an `$id` * keyword with an [absolute-URI][RFC3986] (containing a scheme, but no * fragment). * * [RFC6596]: https://datatracker.ietf.org/doc/html/rfc6596 * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 * * @format "uri-reference" */ $id?: string; /** * The `$ref` keyword is an applicator that is used to reference a * statically identified schema. Its results are the results of the * referenced schema. Other keywords can appear alongside of `$ref` in * the same schema object. * * The value of the `$ref` property MUST be a string which is a * URI-Reference. Resolved against the current URI base, it produces the * URI of the schema to apply. * * @format "uri-reference" */ $ref?: string; /** * The `$schema` keyword is both used as a JSON Schema dialect identifier * and as the identifier of a resource which is itself a JSON Schema, which * describes the set of valid schemas written for this particular dialect. * * The value of this keyword MUST be a [URI][RFC3986] (containing a scheme) * and this URI MUST be normalized. The current schema MUST be valid * against the meta-schema identified by this URI. * * If this URI identifies a retrievable resource, that resource SHOULD be * of media type `application/schema+json`. * * The `$schema` keyword SHOULD be used in the document root schema * object, and MAY be used in the root schema objects of embedded schema * resources. It MUST NOT appear in non-resource root schema objects. If * absent from the document root schema, the resulting behavior is * implementation-defined. * * Values for this property are defined elsewhere in this and other * documents, and by other parties. * * [RFC3986]: https://datatracker.ietf.org/doc/html/rfc3986 * * @format "uri" */ $schema?: string; /** * The `$vocabulary` keyword is used in meta-schemas to identify the * vocabularies available for use in schemas described by that meta-schema. * It is also used to indicate whether each vocabulary is required or * optional, in the sense that an implementation MUST understand the * required vocabularies in order to successfully process the schema. * Together, this information forms a dialect. Any vocabulary that is * understood by the implementation MUST be processed in a manner * consistent with the semantic definitions contained within the * vocabulary. * * The value of this keyword MUST be an object. The property names in the * object MUST be URIs (containing a scheme) and this URI MUST be * normalized. Each URI that appears as a property name identifies a * specific set of keywords and their semantics. * * The URI MAY be a URL, but the nature of the retrievable resource is * currently undefined, and reserved for future use. Vocabulary authors * MAY use the URL of the vocabulary specification, in a human-readable * media type such as `text/html` or `text/plain`, as the vocabulary * URI. * * The values of the object properties MUST be booleans. If the value is * `true`, then implementations that do not recognize the vocabulary MUST * refuse to process any schemas that declare this meta-schema with * `$schema`. If the value is `false`, implementations that do not * recognize the vocabulary SHOULD proceed with processing such schemas. * The value has no impact if the implementation understands the * vocabulary. * * Unrecognized keywords SHOULD be ignored. This remains the case for * keywords defined by unrecognized vocabularies. It is not currently * possible to distinguish between unrecognized keywords that are defined * in vocabularies from those that are not part of any vocabulary. * * The `$vocabulary` keyword SHOULD be used in the root schema of any * schema document intended for use as a meta-schema. It MUST NOT appear * in subschemas. * * The `$vocabulary` keyword MUST be ignored in schema documents that are * not being processed as a meta-schema. */ $vocabulary?: Record; /** * @deprecated `additionalItems` has been deprecated in favor of `prefixItems` * paired with `items`. */ additionalItems?: JSONSchema; /** * The value of `additionalProperties` MUST be a valid JSON Schema. * * The behavior of this keyword depends on the presence and annotation * results of `properties` and `patternProperties` within the same * schema object. Validation with `additionalProperties` applies only to * the child values of instance names that do not appear in the annotation * results of either `properties` or `patternProperties`. * * For all such properties, validation succeeds if the child instance * validates against the `additionalProperties` schema. * * The annotation result of this keyword is the set of instance property * names validated by this keyword's subschema. Annotation results for * `additionalProperties` keywords from multiple schemas applied to the * same instance location are combined by taking the union of the sets. * * Omitting this keyword has the same assertion behavior as an empty * schema. * * Implementations MAY choose to implement or optimize this keyword in * another way that produces the same effect, such as by directly checking * the names in `properties` and the patterns in `patternProperties` * against the instance property set. */ additionalProperties?: JSONSchema; /** * This keyword's value MUST be a non-empty array. Each item of the array * MUST be a valid JSON Schema. * * An instance validates successfully against this keyword if it validates * successfully against all schemas defined by this keyword's value. */ allOf?: MaybeReadonlyArray>; /** * This keyword's value MUST be a non-empty array. Each item of the array * MUST be a valid JSON Schema. * * An instance validates successfully against this keyword if it validates * successfully against at least one schema defined by this keyword's * value. */ anyOf?: MaybeReadonlyArray>; /** * An instance validates successfully against this keyword if its value is * equal to the value of the keyword. * * Use of this keyword is functionally equivalent to the `enum` keyword * with a single value. */ const?: Value; /** * The value of this keyword MUST be a valid JSON Schema. * * An array instance is valid against `contains` if at least one of its * elements is valid against the given schema. The subschema MUST be * applied to every array element even after the first match has been * found, in order to collect annotations for use by other keywords. * This is to ensure that all possible annotations are collected. * * Logically, the validation result of applying the value subschema to each * item in the array MUST be OR'ed with `false`, resulting in an overall * validation result. * * This keyword produces an annotation value which is an array of the * indexes to which this keyword validates successfully when applying its * subschema, in ascending order. The value MAY be a boolean `true` if * the subschema validates successfully when applied to every index of the * instance. The annotation MUST be present if the instance array to which * this keyword's schema applies is empty. */ contains?: JSONSchema; /** * If the instance value is a string, this property defines that the * string SHOULD be interpreted as binary data and decoded using the * encoding named by this property. [RFC 2045, Sec 6.1][RFC2045] lists the * possible values for this property. * * The value of this property SHOULD be ignored if the instance described * is not a string. * * If this keyword is absent, but `contentMediaType` is present, this * indicates that the media type could be encoded into `UTF-8` like any * other JSON string value, and does not require additional decoding. * * The value of this property MUST be a string. * * [RFC2045]: https://datatracker.ietf.org/doc/html/rfc2045#section-6.1 */ contentEncoding?: "7bit" | "8bit" | "base64" | "binary" | "ietf-token" | "quoted-printable" | "x-token"; /** * If the instance is a string, this property indicates the media type * of the contents of the string. If `contentEncoding` is present, * this property describes the decoded string. * * The value of this property must be a media type, as defined by * [RFC 2046][RFC2046]. This property defines the media type of instances * which this schema defines. * * The value of this property SHOULD be ignored if the instance described * is not a string. * * If the `contentEncoding` property is not present, but the instance * value is a string, then the value of this property SHOULD specify a text * document type, and the character set SHOULD be the character set into * which the JSON string value was decoded (for which the default is * Unicode). * * [RFC2046]: https://datatracker.ietf.org/doc/html/rfc2046 */ contentMediaType?: string; /** * If the instance is a string, and if `contentMediaType` is present, * this property contains a schema which describes the structure of the * string. * * This keyword MAY be used with any media type that can be mapped into * JSON Schema's data model. * * The value of this property MUST be a valid JSON schema. It SHOULD be * ignored if `contentMediaType` is not present. */ contentSchema?: JSONSchema; /** * This keyword can be used to supply a default JSON value associated with * a particular schema. It is RECOMMENDED that a `default` value be valid * against the associated schema. */ default?: Value; /** * @deprecated `definitions` has been renamed to `$defs`. */ definitions?: Record; /** * @deprecated `dependencies` has been split into two keywords: * `dependentSchemas` and `dependentRequired`. */ dependencies?: Record | JSONSchema>; /** * The value of this keyword MUST be an object. Properties in * this object, if any, MUST be arrays. Elements in each array, * if any, MUST be strings, and MUST be unique. * * This keyword specifies properties that are required if a specific * other property is present. Their requirement is dependent on the * presence of the other property. * * Validation succeeds if, for each name that appears in both * the instance and as a name within this keyword's value, every * item in the corresponding array is also the name of a property * in the instance. * * Omitting this keyword has the same behavior as an empty object. */ dependentRequired?: Record>; /** * This keyword specifies subschemas that are evaluated if the instance is * an object and contains a certain property. * * This keyword's value MUST be an object. Each value in the object MUST be * a valid JSON Schema. * * If the object key is a property in the instance, the entire instance * must validate against the subschema. Its use is dependent on the * presence of the property. * * Omitting this keyword has the same behavior as an empty object. */ dependentSchemas?: Record; /** * The value of this keyword MUST be a boolean. When multiple occurrences * of this keyword are applicable to a single sub-instance, applications * SHOULD consider the instance location to be deprecated if any occurrence * specifies a `true` value. * * If `deprecated` has a value of boolean `true`, it indicates that * applications SHOULD refrain from usage of the declared property. It MAY * mean the property is going to be removed in the future. * * A root schema containing `deprecated` with a value of `true` * indicates that the entire resource being described MAY be removed in the * future. * * The `deprecated` keyword applies to each instance location to which * the schema object containing the keyword successfully applies. This can * result in scenarios where every array item or object property is * deprecated even though the containing array or object is not. * * Omitting this keyword has the same behavior as a value of `false`. */ deprecated?: boolean; /** * Can be used to decorate a user interface with explanation or information * about the data produced. */ description?: string; /** * This keyword's value MUST be a valid JSON Schema. * * When `if` is present, and the instance fails to validate against its * subschema, then validation succeeds against this keyword if the instance * successfully validates against this keyword's subschema. * * This keyword has no effect when `if` is absent, or when the instance * successfully validates against its subschema. Implementations MUST NOT * evaluate the instance against this keyword, for either validation or * annotation collection purposes, in such cases. */ else?: JSONSchema; /** * The value of this keyword MUST be an array. This array SHOULD have at * least one element. Elements in the array SHOULD be unique. * * An instance validates successfully against this keyword if its value is * equal to one of the elements in this keyword's array value. * * Elements in the array might be of any type, including `null`. */ enum?: MaybeReadonlyArray; /** * The value of this keyword MUST be an array. When multiple occurrences of * this keyword are applicable to a single sub-instance, implementations * MUST provide a flat array of all values rather than an array of arrays. * * This keyword can be used to provide sample JSON values associated with a * particular schema, for the purpose of illustrating usage. It is * RECOMMENDED that these values be valid against the associated schema. * * Implementations MAY use the value(s) of `default`, if present, as an * additional example. If `examples` is absent, `default` MAY still be * used in this manner. */ examples?: MaybeReadonlyArray; /** * The value of `exclusiveMaximum` MUST be a number, representing an * exclusive upper limit for a numeric instance. * * If the instance is a number, then the instance is valid only if it has a * value strictly less than (not equal to) `exclusiveMaximum`. */ exclusiveMaximum?: number; /** * The value of `exclusiveMinimum` MUST be a number, representing an * exclusive lower limit for a numeric instance. * * If the instance is a number, then the instance is valid only if it has a * value strictly greater than (not equal to) `exclusiveMinimum`. */ exclusiveMinimum?: number; /** * Implementations MAY treat `format` as an assertion in addition to an * annotation, and attempt to validate the value's conformance to the * specified semantics. * * The value of this keyword is called a format attribute. It MUST be a * string. A format attribute can generally only validate a given set * of instance types. If the type of the instance to validate is not in * this set, validation for this format attribute and instance SHOULD * succeed. Format attributes are most often applied to strings, but can * be specified to apply to any type. * * Implementations MAY support custom format attributes. Save for agreement * between parties, schema authors SHALL NOT expect a peer implementation * to support such custom format attributes. An implementation MUST NOT * fail validation or cease processing due to an unknown format attribute. * When treating `format` as an annotation, implementations SHOULD * collect both known and unknown format attribute values. */ format?: string; /** * This keyword's value MUST be a valid JSON Schema. * * This validation outcome of this keyword's subschema has no direct effect * on the overall validation result. Rather, it controls which of the * `then` or `else` keywords are evaluated. * * Instances that successfully validate against this keyword's subschema * MUST also be valid against the subschema value of the `then` keyword, * if present. * * Instances that fail to validate against this keyword's subschema MUST * also be valid against the subschema value of the `else` keyword, if * present. * * If annotations are being collected, they are collected * from this keyword's subschema in the usual way, including when the * keyword is present without either `then` or `else`. */ if?: JSONSchema; /** * The value of `items` MUST be a valid JSON Schema. * * This keyword applies its subschema to all instance elements at indexes * greater than the length of the `prefixItems` array in the same schema * object, as reported by the annotation result of that `prefixItems` * keyword. If no such annotation result exists, `items` applies its * subschema to all instance array elements. * * Note that the behavior of `items` without `prefixItems` is identical * to that of the schema form of `items` in prior drafts. * * When `prefixItems` is present, the behavior of `items` is identical * to the former `additionalItems` keyword. * * If the `items` subschema is applied to any positions within the * instance array, it produces an annotation result of boolean `true`, * indicating that all remaining array elements have been evaluated against * this keyword's subschema. * * Omitting this keyword has the same assertion behavior as an empty * schema. * * Implementations MAY choose to implement or optimize this keyword * in another way that produces the same effect, such as by directly * checking for the presence and size of a `prefixItems` array. */ items?: JSONSchema; /** * The value of this keyword MUST be a non-negative integer. * * If `contains` is not present within the same schema object, then this * keyword has no effect. * * An instance array is valid against `maxContains` in two ways, * depending on the form of the annotation result of an adjacent * `contains` keyword. The first way is if the annotation result is an * array and the length of that array is less than or equal to the * `maxContains` value. The second way is if the annotation result is a * boolean `true` and the instance array length is less than or equal to * the `maxContains` value. */ maxContains?: number; /** * The value of `maximum` MUST be a number, representing an inclusive * upper limit for a numeric instance. * * If the instance is a number, then this keyword validates only if the * instance is less than or exactly equal to `maximum`. */ maximum?: number; /** * The value of this keyword MUST be a non-negative integer. * * An array instance is valid against `maxItems` if its size is less * than, or equal to, the value of this keyword. * * @minimum 0 */ maxItems?: number; /** * The value of this keyword MUST be a non-negative integer. * * A string instance is valid against this keyword if its length is less * than, or equal to, the value of this keyword. * * The length of a string instance is defined as the number of its * characters as defined by [RFC 8259][RFC8259]. * * [RFC8259]: https://datatracker.ietf.org/doc/html/rfc8259 * * @minimum 0 */ maxLength?: number; /** * The value of this keyword MUST be a non-negative integer. * * An object instance is valid against `maxProperties` if its number of * `properties` is less than, or equal to, the value of this keyword. * * @minimum 0 */ maxProperties?: number; /** * The value of this keyword MUST be a non-negative integer. * * If `contains` is not present within the same schema object, then this * keyword has no effect. * * An instance array is valid against `minContains` in two ways, * depending on the form of the annotation result of an adjacent * `contains` keyword. The first way is if the annotation result is an * array and the length of that array is greater than or equal to the * `minContains` value. The second way is if the annotation result is a * boolean `true` and the instance array length is greater than or equal * to the `minContains` value. * * A value of `0` is allowed, but is only useful for setting a range * of occurrences from `0` to the value of `maxContains`. A value of * `0` with no `maxContains` causes `contains` to always pass * validation. * * Omitting this keyword has the same behavior as a value of `1`. * * @default 1 */ minContains?: number; /** * The value of `minimum` MUST be a number, representing an inclusive * lower limit for a numeric instance. * * If the instance is a number, then this keyword validates only if the * instance is greater than or exactly equal to `minimum`. */ minimum?: number; /** * The value of this keyword MUST be a non-negative integer. * * An array instance is valid against `minItems` if its size is greater * than, or equal to, the value of this keyword. * * Omitting this keyword has the same behavior as a value of `0`. * * @default 0 * @minimum 0 */ minItems?: number; /** * The value of this keyword MUST be a non-negative integer. * * A string instance is valid against this keyword if its length is greater * than, or equal to, the value of this keyword. * * The length of a string instance is defined as the number of its * characters as defined by [RFC 8259][RFC8259]. * * Omitting this keyword has the same behavior as a value of `0`. * * [RFC8259]: https://datatracker.ietf.org/doc/html/rfc8259 * * @default 0 * @minimum 0 */ minLength?: number; /** * The value of this keyword MUST be a non-negative integer. * * An object instance is valid against `minProperties` if its number of * `properties` is greater than, or equal to, the value of this keyword. * * Omitting this keyword has the same behavior as a value of `0`. * * @default 0 * @minimum 0 */ minProperties?: number; /** * The value of `multipleOf` MUST be a number, strictly greater than * `0`. * * A numeric instance is valid only if division by this keyword's value * results in an integer. * * @exclusiveMinimum 0 */ multipleOf?: number; /** * This keyword's value MUST be a valid JSON Schema. * * An instance is valid against this keyword if it fails to validate * successfully against the schema defined by this keyword. */ not?: JSONSchema; /** * This keyword's value MUST be a non-empty array. Each item of the array * MUST be a valid JSON Schema. * * An instance validates successfully against this keyword if it validates * successfully against exactly one schema defined by this keyword's value. */ oneOf?: MaybeReadonlyArray>; /** * The value of this keyword MUST be a string. This string SHOULD be a * valid regular expression, according to the [ECMA-262][ecma262] regular * expression dialect. * * A string instance is considered valid if the regular expression matches * the instance successfully. Recall: regular expressions are not * implicitly anchored. * * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ * * @format "regex" */ pattern?: string; /** * The value of `patternProperties` MUST be an object. Each property name * of this object SHOULD be a valid regular expression, according to the * [ECMA-262][ecma262] regular expression dialect. Each property value of * this object MUST be a valid JSON Schema. * * Validation succeeds if, for each instance name that matches any regular * expressions that appear as a property name in this keyword's value, * the child instance for that name successfully validates against each * schema that corresponds to a matching regular expression. * * The annotation result of this keyword is the set of instance property * names matched by this keyword. Omitting this keyword has the same * assertion behavior as an empty object. * * [ecma262]: https://www.ecma-international.org/publications-and-standards/standards/ecma-262/ */ patternProperties?: Record; /** * The value of `prefixItems` MUST be a non-empty array of valid JSON * Schemas. * * Validation succeeds if each element of the instance validates against * the schema at the same position, if any. This keyword does not * constrain the length of the array. If the array is longer than this * keyword's value, this keyword validates only the prefix of matching * length. * * This keyword produces an annotation value which is the largest index to * which this keyword applied a subschema. The value MAY be a boolean * `true` if a subschema was applied to every index of the instance, such * as is produced by the `items` keyword. * This annotation affects the behavior of `items` and * `unevaluatedItems`. * * Omitting this keyword has the same assertion behavior as an empty array. */ prefixItems?: MaybeReadonlyArray | JSONSchema; /** * The value of `properties` MUST be an object. Each value of this object * MUST be a valid JSON Schema. * * Validation succeeds if, for each name that appears in both the instance * and as a name within this keyword's value, the child instance for that * name successfully validates against the corresponding schema. * * The annotation result of this keyword is the set of instance property * names matched by this keyword. * * Omitting this keyword has the same assertion behavior as an empty * object. */ properties?: Record; /** * The value of `propertyNames` MUST be a valid JSON Schema. * * If the instance is an object, this keyword validates if every property * name in the instance validates against the provided schema. * Note the property name that the schema is testing will always be a * string. * * Omitting this keyword has the same behavior as an empty schema. */ propertyNames?: JSONSchema; /** * The value of this keyword MUST be a boolean. When multiple occurrences * of this keyword are applicable to a single sub-instance, the resulting * value MUST be `true` if any occurrence specifies a `true` value, and * MUST be `false` otherwise. * * If `readOnly` has a value of boolean `true`, it indicates that the * value of the instance is managed exclusively by the owning authority, * and attempts by an application to modify the value of this property are * expected to be ignored or rejected by that owning authority. * * An instance document that is marked as `readOnly` for the entire * document MAY be ignored if sent to the owning authority, or MAY result * in an error, at the authority's discretion. * * For example, `readOnly` would be used to mark a database-generated * serial number as read-only. * * This keyword can be used to assist in user interface instance * generation. * * @default false */ readOnly?: boolean; /** * The value of this keyword MUST be an array. Elements of this array, if * any, MUST be strings, and MUST be unique. * * An object instance is valid against this keyword if every item in the * array is the name of a property in the instance. * * Omitting this keyword has the same behavior as an empty array. */ required?: MaybeReadonlyArray; /** * This keyword's value MUST be a valid JSON Schema. * * When `if` is present, and the instance successfully validates against * its subschema, then validation succeeds against this keyword if the * instance also successfully validates against this keyword's subschema. * * This keyword has no effect when `if` is absent, or when the instance * fails to validate against its subschema. Implementations MUST NOT * evaluate the instance against this keyword, for either validation or * annotation collection purposes, in such cases. */ then?: JSONSchema; /** * Can be used to decorate a user interface with a short label about the * data produced. */ title?: string; /** * The value of this keyword MUST be either a string or an array. If it is * an array, elements of the array MUST be strings and MUST be unique. * * String values MUST be one of the six primitive types (`"null"`, * `"boolean"`, `"object"`, `"array"`, `"number"`, or * `"string"`), or `"integer"` which matches any number with a zero * fractional part. * * An instance validates if and only if the instance is in any of the sets * listed for this keyword. */ type?: SchemaType; /** * The value of `unevaluatedItems` MUST be a valid JSON Schema. * * The behavior of this keyword depends on the annotation results of * adjacent keywords that apply to the instance location being validated. * Specifically, the annotations from `prefixItems`, `items`, and * `contains`, which can come from those keywords when they are adjacent * to the `unevaluatedItems` keyword. Those three annotations, as well as * `unevaluatedItems`, can also result from any and all adjacent * [in-place applicator][in-place-applicator] keywords. * * If no relevant annotations are present, the `unevaluatedItems` * subschema MUST be applied to all locations in the array. * If a boolean `true` value is present from any of the relevant * annotations, `unevaluatedItems` MUST be ignored. Otherwise, the * subschema MUST be applied to any index greater than the largest * annotation value for `prefixItems`, which does not appear in any * annotation value for `contains`. * * This means that `prefixItems`, `items`, `contains`, and all * in-place applicators MUST be evaluated before this keyword can be * evaluated. Authors of extension keywords MUST NOT define an in-place * applicator that would need to be evaluated after this keyword. * * If the `unevaluatedItems` subschema is applied to any positions within * the instance array, it produces an annotation result of boolean * `true`, analogous to the behavior of `items`. * * Omitting this keyword has the same assertion behavior as an empty * schema. * * [in-place-applicator]: https://json-schema.org/draft/2020-12/json-schema-core.html#in-place */ unevaluatedItems?: JSONSchema; /** * The value of `unevaluatedProperties` MUST be a valid JSON Schema. * * The behavior of this keyword depends on the annotation results of * adjacent keywords that apply to the instance location being validated. * Specifically, the annotations from `properties`, * `patternProperties`, and `additionalProperties`, which can come from * those keywords when they are adjacent to the `unevaluatedProperties` * keyword. Those three annotations, as well as `unevaluatedProperties`, * can also result from any and all adjacent * [in-place applicator][in-place-applicator] keywords. * * Validation with `unevaluatedProperties` applies only to the child * values of instance names that do not appear in the `properties`, * `patternProperties`, `additionalProperties`, or * `unevaluatedProperties` annotation results that apply to the * instance location being validated. * * For all such properties, validation succeeds if the child instance * validates against the "unevaluatedProperties" schema. * * This means that `properties`, `patternProperties`, * `additionalProperties`, and all in-place applicators MUST be evaluated * before this keyword can be evaluated. Authors of extension keywords * MUST NOT define an in-place applicator that would need to be evaluated * after this keyword. * * The annotation result of this keyword is the set of instance property * names validated by this keyword's subschema. * * Omitting this keyword has the same assertion behavior as an empty * schema. * * [in-place-applicator]: https://json-schema.org/draft/2020-12/json-schema-core.html#in-place */ unevaluatedProperties?: JSONSchema; /** * The value of this keyword MUST be a boolean. * * If this keyword has boolean value `false`, the instance validates * successfully. If it has boolean value `true`, the instance validates * successfully if all of its elements are unique. * * Omitting this keyword has the same behavior as a value of `false`. * * @default false */ uniqueItems?: boolean; /** * The value of this keyword MUST be a boolean. When multiple occurrences * of this keyword is applicable to a single sub-instance, the resulting * value MUST be `true` if any occurrence specifies a `true` value, and * MUST be `false` otherwise. * * If `writeOnly` has a value of boolean `true`, it indicates that the * value is never present when the instance is retrieved from the owning * authority. It can be present when sent to the owning authority to update * or create the document (or the resource it represents), but it will not * be included in any updated or newly created version of the instance. * * An instance document that is marked as `writeOnly` for the entire * document MAY be returned as a blank document of some sort, or MAY * produce an error upon retrieval, or have the retrieval request ignored, * at the authority's discretion. * * For example, `writeOnly` would be used to mark a password input field. * * These keywords can be used to assist in user interface instance * generation. In particular, an application MAY choose to use a widget * that hides input values as they are typed for write-only fields. * * @default false */ writeOnly?: boolean; }; declare namespace JSONSchema { type TypeValue = ValueOf | TypeName | Array | TypeName> | ReadonlyArray | TypeName>; /** * JSON Schema interface */ type Interface = Exclude, boolean>; type Array = Pick, KeywordByType.Any | KeywordByType.Array>; type Boolean = Pick, KeywordByType.Any>; type Integer = Pick, KeywordByType.Any | KeywordByType.Number>; type Number = Pick, KeywordByType.Any | KeywordByType.Number>; type Null = Pick, KeywordByType.Any>; type Object = Pick, KeywordByType.Any | KeywordByType.Object>; type String = Pick, KeywordByType.Any | KeywordByType.String>; } declare namespace KeywordByType { type Any = "$anchor" | "$comment" | "$defs" | "$dynamicAnchor" | "$dynamicRef" | "$id" | "$ref" | "$schema" | "$vocabulary" | "allOf" | "anyOf" | "const" | "default" | "definitions" | "deprecated" | "description" | "else" | "enum" | "examples" | "format" | "if" | "not" | "oneOf" | "readOnly" | "then" | "title" | "type" | "writeOnly"; type Array = "additionalItems" | "contains" | "items" | "maxContains" | "maxItems" | "minContains" | "minItems" | "prefixItems" | "unevaluatedItems" | "uniqueItems"; type Number = "exclusiveMaximum" | "exclusiveMinimum" | "maximum" | "minimum" | "multipleOf"; type Object = "additionalProperties" | "dependencies" | "dependentRequired" | "dependentSchemas" | "maxProperties" | "minProperties" | "patternProperties" | "properties" | "propertyNames" | "required" | "unevaluatedProperties"; type String = "contentEncoding" | "contentMediaType" | "contentSchema" | "maxLength" | "minLength" | "pattern"; } /** * Content encoding strategy enum. * * - [Content-Transfer-Encoding Syntax](https://datatracker.ietf.org/doc/html/rfc2045#section-6.1) * - [7bit vs 8bit encoding](https://stackoverflow.com/questions/25710599/content-transfer-encoding-7bit-or-8-bit/28531705#28531705) */ /** * Enum consisting of simple type names for the `type` keyword */ declare enum TypeName { /** * Value MUST be an array. */ Array = "array", /** * Value MUST be a boolean. */ Boolean = "boolean", /** * Value MUST be an integer, no floating point numbers are allowed. This is a * subset of the number type. */ Integer = "integer", /** * Value MUST be null. Note this is mainly for purpose of being able use union * types to define nullability. If this type is not included in a union, null * values are not allowed (the primitives listed above do not allow nulls on * their own). */ Null = "null", /** * Value MUST be a number, floating point numbers are allowed. */ Number = "number", /** * Value MUST be an object. */ Object = "object", /** * Value MUST be a string. */ String = "string" } //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/types.d.ts /** * JSON Schema type definition (JSON Schema Draft 2020-12) * * This uses the object form of JSON Schema (excluding boolean schemas). * While `true` and `false` are valid JSON Schemas, this SDK uses the * object form for practical type safety. * * Re-exported from json-schema-typed for convenience. * @see https://json-schema.org/draft/2020-12/json-schema-core.html */ type JsonSchemaType = JSONSchema.Interface; /** * Result of a JSON Schema validation operation */ type JsonSchemaValidatorResult$2 = { valid: true; data: T; errorMessage: undefined; } | { valid: false; data: undefined; errorMessage: string; }; /** * A validator function that validates data against a JSON Schema */ type JsonSchemaValidator$2 = (input: unknown) => JsonSchemaValidatorResult$2; /** * Provider interface for creating validators from JSON Schemas * * This is the main extension point for custom validator implementations. * Implementations should: * - Support JSON Schema Draft 2020-12 (or be compatible with it) * - Return validator functions that can be called multiple times * - Handle schema compilation/caching internally * - Provide clear error messages on validation failure * * @example * ```typescript * class MyValidatorProvider implements jsonSchemaValidator { * getValidator(schema: JsonSchemaType): JsonSchemaValidator { * // Compile/cache validator from schema * return (input: unknown) => { * // Validate input against schema * if (valid) { * return { valid: true, data: input as T, errorMessage: undefined }; * } else { * return { valid: false, data: undefined, errorMessage: 'Error details' }; * } * }; * } * } * ``` */ interface jsonSchemaValidator { /** * Create a validator for the given JSON Schema * * @param schema - Standard JSON Schema object * @returns A validator function that can be called multiple times */ getValidator(schema: JsonSchemaType): JsonSchemaValidator$2; } //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.d.ts /** * Experimental task features for MCP clients. * * Access via `client.experimental.tasks`: * ```typescript * const stream = client.experimental.tasks.callToolStream({ name: 'tool', arguments: {} }); * const task = await client.experimental.tasks.getTask(taskId); * ``` * * @experimental */ declare class ExperimentalClientTasks { private readonly _client; constructor(_client: Client); /** * Calls a tool and returns an AsyncGenerator that yields response messages. * The generator is guaranteed to end with either a 'result' or 'error' message. * * This method provides streaming access to tool execution, allowing you to * observe intermediate task status updates for long-running tool calls. * Automatically validates structured output if the tool has an outputSchema. * * @example * ```typescript * const stream = client.experimental.tasks.callToolStream({ name: 'myTool', arguments: {} }); * for await (const message of stream) { * switch (message.type) { * case 'taskCreated': * console.log('Tool execution started:', message.task.taskId); * break; * case 'taskStatus': * console.log('Tool status:', message.task.status); * break; * case 'result': * console.log('Tool result:', message.result); * break; * case 'error': * console.error('Tool error:', message.error); * break; * } * } * ``` * * @param params - Tool call parameters (name and arguments) * @param resultSchema - Zod schema for validating the result (defaults to CallToolResultSchema) * @param options - Optional request options (timeout, signal, task creation params, etc.) * @returns AsyncGenerator that yields ResponseMessage objects * * @experimental */ callToolStream(params: CallToolRequest['params'], resultSchema?: T, options?: RequestOptions): AsyncGenerator>, void, void>; /** * Gets the current status of a task. * * @param taskId - The task identifier * @param options - Optional request options * @returns The task status * * @experimental */ getTask(taskId: string, options?: RequestOptions): Promise; /** * Retrieves the result of a completed task. * * @param taskId - The task identifier * @param resultSchema - Zod schema for validating the result * @param options - Optional request options * @returns The task result * * @experimental */ getTaskResult(taskId: string, resultSchema?: T, options?: RequestOptions): Promise>; /** * Lists tasks with optional pagination. * * @param cursor - Optional pagination cursor * @param options - Optional request options * @returns List of tasks with optional next cursor * * @experimental */ listTasks(cursor?: string, options?: RequestOptions): Promise; /** * Cancels a running task. * * @param taskId - The task identifier * @param options - Optional request options * * @experimental */ cancelTask(taskId: string, options?: RequestOptions): Promise; /** * Sends a request and returns an AsyncGenerator that yields response messages. * The generator is guaranteed to end with either a 'result' or 'error' message. * * This method provides streaming access to request processing, allowing you to * observe intermediate task status updates for task-augmented requests. * * @param request - The request to send * @param resultSchema - Zod schema for validating the result * @param options - Optional request options (timeout, signal, task creation params, etc.) * @returns AsyncGenerator that yields ResponseMessage objects * * @experimental */ requestStream(request: ClientRequest | RequestT, resultSchema: T, options?: RequestOptions): AsyncGenerator>, void, void>; } //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.d.ts type ClientOptions = ProtocolOptions & { /** * Capabilities to advertise as being supported by this client. */ capabilities?: ClientCapabilities; /** * JSON Schema validator for tool output validation. * * The validator is used to validate structured content returned by tools * against their declared output schemas. * * @default AjvJsonSchemaValidator * * @example * ```typescript * // ajv * const client = new Client( * { name: 'my-client', version: '1.0.0' }, * { * capabilities: {}, * jsonSchemaValidator: new AjvJsonSchemaValidator() * } * ); * * // @cfworker/json-schema * const client = new Client( * { name: 'my-client', version: '1.0.0' }, * { * capabilities: {}, * jsonSchemaValidator: new CfWorkerJsonSchemaValidator() * } * ); * ``` */ jsonSchemaValidator?: jsonSchemaValidator; /** * Configure handlers for list changed notifications (tools, prompts, resources). * * @example * ```typescript * const client = new Client( * { name: 'my-client', version: '1.0.0' }, * { * listChanged: { * tools: { * onChanged: (error, tools) => { * if (error) { * console.error('Failed to refresh tools:', error); * return; * } * console.log('Tools updated:', tools); * } * }, * prompts: { * onChanged: (error, prompts) => console.log('Prompts updated:', prompts) * } * } * } * ); * ``` */ listChanged?: ListChangedHandlers; }; /** * An MCP client on top of a pluggable transport. * * The client will automatically begin the initialization flow with the server when connect() is called. * * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: * * ```typescript * // Custom schemas * const CustomRequestSchema = RequestSchema.extend({...}) * const CustomNotificationSchema = NotificationSchema.extend({...}) * const CustomResultSchema = ResultSchema.extend({...}) * * // Type aliases * type CustomRequest = z.infer * type CustomNotification = z.infer * type CustomResult = z.infer * * // Create typed client * const client = new Client({ * name: "CustomClient", * version: "1.0.0" * }) * ``` */ declare class Client extends Protocol { private _clientInfo; private _serverCapabilities?; private _serverVersion?; private _capabilities; private _instructions?; private _jsonSchemaValidator; private _cachedToolOutputValidators; private _cachedKnownTaskTools; private _cachedRequiredTaskTools; private _experimental?; private _listChangedDebounceTimers; private _pendingListChangedConfig?; /** * Initializes this client with the given name and version information. */ constructor(_clientInfo: Implementation, options?: ClientOptions); /** * Set up handlers for list changed notifications based on config and server capabilities. * This should only be called after initialization when server capabilities are known. * Handlers are silently skipped if the server doesn't advertise the corresponding listChanged capability. * @internal */ private _setupListChangedHandlers; /** * Access experimental features. * * WARNING: These APIs are experimental and may change without notice. * * @experimental */ get experimental(): { tasks: ExperimentalClientTasks; }; /** * Registers new capabilities. This can only be called before connecting to a transport. * * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). */ registerCapabilities(capabilities: ClientCapabilities): void; /** * Override request handler registration to enforce client-side validation for elicitation. */ setRequestHandler(requestSchema: T, handler: (request: SchemaOutput, extra: RequestHandlerExtra) => ClientResult | ResultT | Promise): void; protected assertCapability(capability: keyof ServerCapabilities, method: string): void; connect(transport: Transport, options?: RequestOptions): Promise; /** * After initialization has completed, this will be populated with the server's reported capabilities. */ getServerCapabilities(): ServerCapabilities | undefined; /** * After initialization has completed, this will be populated with information about the server's name and version. */ getServerVersion(): Implementation | undefined; /** * After initialization has completed, this may be populated with information about the server's instructions. */ getInstructions(): string | undefined; protected assertCapabilityForMethod(method: RequestT['method']): void; protected assertNotificationCapability(method: NotificationT['method']): void; protected assertRequestHandlerCapability(method: string): void; protected assertTaskCapability(method: string): void; protected assertTaskHandlerCapability(method: string): void; ping(options?: RequestOptions): Promise<{ _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; }>; complete(params: CompleteRequest['params'], options?: RequestOptions): Promise<{ [x: string]: unknown; completion: { [x: string]: unknown; values: string[]; total?: number | undefined; hasMore?: boolean | undefined; }; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; }>; setLoggingLevel(level: LoggingLevel, options?: RequestOptions): Promise<{ _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; }>; getPrompt(params: GetPromptRequest['params'], options?: RequestOptions): Promise<{ [x: string]: unknown; messages: { role: "user" | "assistant"; content: { type: "text"; text: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "image"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "audio"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "resource"; resource: { uri: string; text: string; mimeType?: string | undefined; _meta?: Record | undefined; } | { uri: string; blob: string; mimeType?: string | undefined; _meta?: Record | undefined; }; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { uri: string; name: string; type: "resource_link"; description?: string | undefined; mimeType?: string | undefined; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: { [x: string]: unknown; } | undefined; icons?: { src: string; mimeType?: string | undefined; sizes?: string[] | undefined; theme?: "light" | "dark" | undefined; }[] | undefined; title?: string | undefined; }; }[]; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; description?: string | undefined; }>; listPrompts(params?: ListPromptsRequest['params'], options?: RequestOptions): Promise<{ [x: string]: unknown; prompts: { name: string; description?: string | undefined; arguments?: { name: string; description?: string | undefined; required?: boolean | undefined; }[] | undefined; _meta?: { [x: string]: unknown; } | undefined; icons?: { src: string; mimeType?: string | undefined; sizes?: string[] | undefined; theme?: "light" | "dark" | undefined; }[] | undefined; title?: string | undefined; }[]; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; nextCursor?: string | undefined; }>; listResources(params?: ListResourcesRequest['params'], options?: RequestOptions): Promise<{ [x: string]: unknown; resources: { uri: string; name: string; description?: string | undefined; mimeType?: string | undefined; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: { [x: string]: unknown; } | undefined; icons?: { src: string; mimeType?: string | undefined; sizes?: string[] | undefined; theme?: "light" | "dark" | undefined; }[] | undefined; title?: string | undefined; }[]; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; nextCursor?: string | undefined; }>; listResourceTemplates(params?: ListResourceTemplatesRequest['params'], options?: RequestOptions): Promise<{ [x: string]: unknown; resourceTemplates: { uriTemplate: string; name: string; description?: string | undefined; mimeType?: string | undefined; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: { [x: string]: unknown; } | undefined; icons?: { src: string; mimeType?: string | undefined; sizes?: string[] | undefined; theme?: "light" | "dark" | undefined; }[] | undefined; title?: string | undefined; }[]; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; nextCursor?: string | undefined; }>; readResource(params: ReadResourceRequest['params'], options?: RequestOptions): Promise<{ [x: string]: unknown; contents: ({ uri: string; text: string; mimeType?: string | undefined; _meta?: Record | undefined; } | { uri: string; blob: string; mimeType?: string | undefined; _meta?: Record | undefined; })[]; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; }>; subscribeResource(params: SubscribeRequest['params'], options?: RequestOptions): Promise<{ _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; }>; unsubscribeResource(params: UnsubscribeRequest['params'], options?: RequestOptions): Promise<{ _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; }>; /** * Calls a tool and waits for the result. Automatically validates structured output if the tool has an outputSchema. * * For task-based execution with streaming behavior, use client.experimental.tasks.callToolStream() instead. */ callTool(params: CallToolRequest['params'], resultSchema?: typeof CallToolResultSchema | typeof CompatibilityCallToolResultSchema, options?: RequestOptions): Promise<{ [x: string]: unknown; content: ({ type: "text"; text: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "image"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "audio"; data: string; mimeType: string; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { type: "resource"; resource: { uri: string; text: string; mimeType?: string | undefined; _meta?: Record | undefined; } | { uri: string; blob: string; mimeType?: string | undefined; _meta?: Record | undefined; }; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: Record | undefined; } | { uri: string; name: string; type: "resource_link"; description?: string | undefined; mimeType?: string | undefined; annotations?: { audience?: ("user" | "assistant")[] | undefined; priority?: number | undefined; lastModified?: string | undefined; } | undefined; _meta?: { [x: string]: unknown; } | undefined; icons?: { src: string; mimeType?: string | undefined; sizes?: string[] | undefined; theme?: "light" | "dark" | undefined; }[] | undefined; title?: string | undefined; })[]; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; structuredContent?: Record | undefined; isError?: boolean | undefined; } | { [x: string]: unknown; toolResult: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; }>; private isToolTask; /** * Check if a tool requires task-based execution. * Unlike isToolTask which includes 'optional' tools, this only checks for 'required'. */ private isToolTaskRequired; /** * Cache validators for tool output schemas. * Called after listTools() to pre-compile validators for better performance. */ private cacheToolMetadata; /** * Get cached validator for a tool */ private getToolOutputValidator; listTools(params?: ListToolsRequest['params'], options?: RequestOptions): Promise<{ [x: string]: unknown; tools: { inputSchema: { [x: string]: unknown; type: "object"; properties?: Record | undefined; required?: string[] | undefined; }; name: string; description?: string | undefined; outputSchema?: { [x: string]: unknown; type: "object"; properties?: Record | undefined; required?: string[] | undefined; } | undefined; annotations?: { title?: string | undefined; readOnlyHint?: boolean | undefined; destructiveHint?: boolean | undefined; idempotentHint?: boolean | undefined; openWorldHint?: boolean | undefined; } | undefined; execution?: { taskSupport?: "optional" | "required" | "forbidden" | undefined; } | undefined; _meta?: Record | undefined; icons?: { src: string; mimeType?: string | undefined; sizes?: string[] | undefined; theme?: "light" | "dark" | undefined; }[] | undefined; title?: string | undefined; }[]; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; nextCursor?: string | undefined; }>; /** * Set up a single list changed handler. * @internal */ private _setupListChangedHandler; sendRootsListChanged(): Promise; } //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.d.ts /** * Buffers a continuous stdio stream into discrete JSON-RPC messages. */ declare class ReadBuffer { private _buffer?; append(chunk: Buffer): void; readMessage(): JSONRPCMessage | null; clear(): void; } declare function serializeMessage(message: JSONRPCMessage): string; //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.d.ts /** * Experimental task features for low-level MCP servers. * * Access via `server.experimental.tasks`: * ```typescript * const stream = server.experimental.tasks.requestStream(request, schema, options); * ``` * * For high-level server usage with task-based tools, use `McpServer.experimental.tasks` instead. * * @experimental */ declare class ExperimentalServerTasks { private readonly _server; constructor(_server: Server); /** * Sends a request and returns an AsyncGenerator that yields response messages. * The generator is guaranteed to end with either a 'result' or 'error' message. * * This method provides streaming access to request processing, allowing you to * observe intermediate task status updates for task-augmented requests. * * @param request - The request to send * @param resultSchema - Zod schema for validating the result * @param options - Optional request options (timeout, signal, task creation params, etc.) * @returns AsyncGenerator that yields ResponseMessage objects * * @experimental */ requestStream(request: ServerRequest | RequestT, resultSchema: T, options?: RequestOptions): AsyncGenerator>, void, void>; /** * Gets the current status of a task. * * @param taskId - The task identifier * @param options - Optional request options * @returns The task status * * @experimental */ getTask(taskId: string, options?: RequestOptions): Promise; /** * Retrieves the result of a completed task. * * @param taskId - The task identifier * @param resultSchema - Zod schema for validating the result * @param options - Optional request options * @returns The task result * * @experimental */ getTaskResult(taskId: string, resultSchema?: T, options?: RequestOptions): Promise>; /** * Lists tasks with optional pagination. * * @param cursor - Optional pagination cursor * @param options - Optional request options * @returns List of tasks with optional next cursor * * @experimental */ listTasks(cursor?: string, options?: RequestOptions): Promise; /** * Cancels a running task. * * @param taskId - The task identifier * @param options - Optional request options * * @experimental */ cancelTask(taskId: string, options?: RequestOptions): Promise; } //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.d.ts type ServerOptions = ProtocolOptions & { /** * Capabilities to advertise as being supported by this server. */ capabilities?: ServerCapabilities; /** * Optional instructions describing how to use the server and its features. */ instructions?: string; /** * JSON Schema validator for elicitation response validation. * * The validator is used to validate user input returned from elicitation * requests against the requested schema. * * @default AjvJsonSchemaValidator * * @example * ```typescript * // ajv (default) * const server = new Server( * { name: 'my-server', version: '1.0.0' }, * { * capabilities: {} * jsonSchemaValidator: new AjvJsonSchemaValidator() * } * ); * * // @cfworker/json-schema * const server = new Server( * { name: 'my-server', version: '1.0.0' }, * { * capabilities: {}, * jsonSchemaValidator: new CfWorkerJsonSchemaValidator() * } * ); * ``` */ jsonSchemaValidator?: jsonSchemaValidator; }; /** * An MCP server on top of a pluggable transport. * * This server will automatically respond to the initialization flow as initiated from the client. * * To use with custom types, extend the base Request/Notification/Result types and pass them as type parameters: * * ```typescript * // Custom schemas * const CustomRequestSchema = RequestSchema.extend({...}) * const CustomNotificationSchema = NotificationSchema.extend({...}) * const CustomResultSchema = ResultSchema.extend({...}) * * // Type aliases * type CustomRequest = z.infer * type CustomNotification = z.infer * type CustomResult = z.infer * * // Create typed server * const server = new Server({ * name: "CustomServer", * version: "1.0.0" * }) * ``` * @deprecated Use `McpServer` instead for the high-level API. Only use `Server` for advanced use cases. */ declare class Server extends Protocol { private _serverInfo; private _clientCapabilities?; private _clientVersion?; private _capabilities; private _instructions?; private _jsonSchemaValidator; private _experimental?; /** * Callback for when initialization has fully completed (i.e., the client has sent an `initialized` notification). */ oninitialized?: () => void; /** * Initializes this server with the given name and version information. */ constructor(_serverInfo: Implementation, options?: ServerOptions); /** * Access experimental features. * * WARNING: These APIs are experimental and may change without notice. * * @experimental */ get experimental(): { tasks: ExperimentalServerTasks; }; private _loggingLevels; private readonly LOG_LEVEL_SEVERITY; private isMessageIgnored; /** * Registers new capabilities. This can only be called before connecting to a transport. * * The new capabilities will be merged with any existing capabilities previously given (e.g., at initialization). */ registerCapabilities(capabilities: ServerCapabilities): void; /** * Override request handler registration to enforce server-side validation for tools/call. */ setRequestHandler(requestSchema: T, handler: (request: SchemaOutput, extra: RequestHandlerExtra) => ServerResult | ResultT | Promise): void; protected assertCapabilityForMethod(method: RequestT['method']): void; protected assertNotificationCapability(method: (ServerNotification | NotificationT)['method']): void; protected assertRequestHandlerCapability(method: string): void; protected assertTaskCapability(method: string): void; protected assertTaskHandlerCapability(method: string): void; private _oninitialize; /** * After initialization has completed, this will be populated with the client's reported capabilities. */ getClientCapabilities(): ClientCapabilities | undefined; /** * After initialization has completed, this will be populated with information about the client's name and version. */ getClientVersion(): Implementation | undefined; private getCapabilities; ping(): Promise<{ _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; }>; /** * Request LLM sampling from the client (without tools). * Returns single content block for backwards compatibility. */ createMessage(params: CreateMessageRequestParamsBase, options?: RequestOptions): Promise; /** * Request LLM sampling from the client with tool support. * Returns content that may be a single block or array (for parallel tool calls). */ createMessage(params: CreateMessageRequestParamsWithTools, options?: RequestOptions): Promise; /** * Request LLM sampling from the client. * When tools may or may not be present, returns the union type. */ createMessage(params: CreateMessageRequest['params'], options?: RequestOptions): Promise; /** * Creates an elicitation request for the given parameters. * For backwards compatibility, `mode` may be omitted for form requests and will default to `'form'`. * @param params The parameters for the elicitation request. * @param options Optional request options. * @returns The result of the elicitation request. */ elicitInput(params: ElicitRequestFormParams | ElicitRequestURLParams, options?: RequestOptions): Promise; /** * Creates a reusable callback that, when invoked, will send a `notifications/elicitation/complete` * notification for the specified elicitation ID. * * @param elicitationId The ID of the elicitation to mark as complete. * @param options Optional notification options. Useful when the completion notification should be related to a prior request. * @returns A function that emits the completion notification when awaited. */ createElicitationCompletionNotifier(elicitationId: string, options?: NotificationOptions): () => Promise; listRoots(params?: ListRootsRequest['params'], options?: RequestOptions): Promise<{ [x: string]: unknown; roots: { uri: string; name?: string | undefined; _meta?: Record | undefined; }[]; _meta?: { [x: string]: unknown; progressToken?: string | number | undefined; "io.modelcontextprotocol/related-task"?: { taskId: string; } | undefined; } | undefined; }>; /** * Sends a logging message to the client, if connected. * Note: You only need to send the parameters object, not the entire JSON RPC message * @see LoggingMessageNotification * @param params * @param sessionId optional for stateless and backward compatibility */ sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise; sendResourceUpdated(params: ResourceUpdatedNotification['params']): Promise; sendResourceListChanged(): Promise; sendToolListChanged(): Promise; sendPromptListChanged(): Promise; } //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/uriTemplate.d.ts type Variables = Record; declare class UriTemplate { /** * Returns true if the given string contains any URI template expressions. * A template expression is a sequence of characters enclosed in curly braces, * like {foo} or {?bar}. */ static isTemplate(str: string): boolean; private static validateLength; private readonly template; private readonly parts; get variableNames(): string[]; constructor(template: string); toString(): string; private parse; private getOperator; private getNames; private encodeValue; private expandPart; expand(variables: Variables): string; private escapeRegExp; private partToRegExp; match(uri: string): Variables | null; } //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.d.ts /** * Experimental task features for McpServer. * * Access via `server.experimental.tasks`: * ```typescript * server.experimental.tasks.registerToolTask('long-running', config, handler); * ``` * * @experimental */ declare class ExperimentalMcpServerTasks { private readonly _mcpServer; constructor(_mcpServer: McpServer); /** * Registers a task-based tool with a config object and handler. * * Task-based tools support long-running operations that can be polled for status * and results. The handler must implement `createTask`, `getTask`, and `getTaskResult` * methods. * * @example * ```typescript * server.experimental.tasks.registerToolTask('long-computation', { * description: 'Performs a long computation', * inputSchema: { input: z.string() }, * execution: { taskSupport: 'required' } * }, { * createTask: async (args, extra) => { * const task = await extra.taskStore.createTask({ ttl: 300000 }); * startBackgroundWork(task.taskId, args); * return { task }; * }, * getTask: async (args, extra) => { * return extra.taskStore.getTask(extra.taskId); * }, * getTaskResult: async (args, extra) => { * return extra.taskStore.getTaskResult(extra.taskId); * } * }); * ``` * * @param name - The tool name * @param config - Tool configuration (description, schemas, etc.) * @param handler - Task handler with createTask, getTask, getTaskResult methods * @returns RegisteredTool for managing the tool's lifecycle * * @experimental */ registerToolTask(name: string, config: { title?: string; description?: string; outputSchema?: OutputArgs; annotations?: ToolAnnotations; execution?: TaskToolExecution; _meta?: Record; }, handler: ToolTaskHandler): RegisteredTool; registerToolTask(name: string, config: { title?: string; description?: string; inputSchema: InputArgs; outputSchema?: OutputArgs; annotations?: ToolAnnotations; execution?: TaskToolExecution; _meta?: Record; }, handler: ToolTaskHandler): RegisteredTool; } //#endregion //#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.26.0_@cfworker+json-schema@4.1.1_zod@4.4.3/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.d.ts /** * High-level MCP server that provides a simpler API for working with resources, tools, and prompts. * For advanced usage (like sending notifications or setting custom request handlers), use the underlying * Server instance available via the `server` property. */ declare class McpServer { /** * The underlying Server instance, useful for advanced operations like sending notifications. */ readonly server: Server; private _registeredResources; private _registeredResourceTemplates; private _registeredTools; private _registeredPrompts; private _experimental?; constructor(serverInfo: Implementation, options?: ServerOptions); /** * Access experimental features. * * WARNING: These APIs are experimental and may change without notice. * * @experimental */ get experimental(): { tasks: ExperimentalMcpServerTasks; }; /** * Attaches to the given transport, starts it, and starts listening for messages. * * The `server` object assumes ownership of the Transport, replacing any callbacks that have already been set, and expects that it is the only user of the Transport instance going forward. */ connect(transport: Transport): Promise; /** * Closes the connection. */ close(): Promise; private _toolHandlersInitialized; private setToolRequestHandlers; /** * Creates a tool error result. * * @param errorMessage - The error message. * @returns The tool error result. */ private createToolError; /** * Validates tool input arguments against the tool's input schema. */ private validateToolInput; /** * Validates tool output against the tool's output schema. */ private validateToolOutput; /** * Executes a tool handler (either regular or task-based). */ private executeToolHandler; /** * Handles automatic task polling for tools with taskSupport 'optional'. */ private handleAutomaticTaskPolling; private _completionHandlerInitialized; private setCompletionRequestHandler; private handlePromptCompletion; private handleResourceCompletion; private _resourceHandlersInitialized; private setResourceRequestHandlers; private _promptHandlersInitialized; private setPromptRequestHandlers; /** * Registers a resource `name` at a fixed URI, which will use the given callback to respond to read requests. * @deprecated Use `registerResource` instead. */ resource(name: string, uri: string, readCallback: ReadResourceCallback): RegisteredResource; /** * Registers a resource `name` at a fixed URI with metadata, which will use the given callback to respond to read requests. * @deprecated Use `registerResource` instead. */ resource(name: string, uri: string, metadata: ResourceMetadata, readCallback: ReadResourceCallback): RegisteredResource; /** * Registers a resource `name` with a template pattern, which will use the given callback to respond to read requests. * @deprecated Use `registerResource` instead. */ resource(name: string, template: ResourceTemplate$1, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; /** * Registers a resource `name` with a template pattern and metadata, which will use the given callback to respond to read requests. * @deprecated Use `registerResource` instead. */ resource(name: string, template: ResourceTemplate$1, metadata: ResourceMetadata, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; /** * Registers a resource with a config object and callback. * For static resources, use a URI string. For dynamic resources, use a ResourceTemplate. */ registerResource(name: string, uriOrTemplate: string, config: ResourceMetadata, readCallback: ReadResourceCallback): RegisteredResource; registerResource(name: string, uriOrTemplate: ResourceTemplate$1, config: ResourceMetadata, readCallback: ReadResourceTemplateCallback): RegisteredResourceTemplate; private _createRegisteredResource; private _createRegisteredResourceTemplate; private _createRegisteredPrompt; private _createRegisteredTool; /** * Registers a zero-argument tool `name`, which will run the given function when the client calls it. * @deprecated Use `registerTool` instead. */ tool(name: string, cb: ToolCallback): RegisteredTool; /** * Registers a zero-argument tool `name` (with a description) which will run the given function when the client calls it. * @deprecated Use `registerTool` instead. */ tool(name: string, description: string, cb: ToolCallback): RegisteredTool; /** * Registers a tool taking either a parameter schema for validation or annotations for additional metadata. * This unified overload handles both `tool(name, paramsSchema, cb)` and `tool(name, annotations, cb)` cases. * * Note: We use a union type for the second parameter because TypeScript cannot reliably disambiguate * between ToolAnnotations and ZodRawShapeCompat during overload resolution, as both are plain object types. * @deprecated Use `registerTool` instead. */ tool(name: string, paramsSchemaOrAnnotations: Args | ToolAnnotations, cb: ToolCallback): RegisteredTool; /** * Registers a tool `name` (with a description) taking either parameter schema or annotations. * This unified overload handles both `tool(name, description, paramsSchema, cb)` and * `tool(name, description, annotations, cb)` cases. * * Note: We use a union type for the third parameter because TypeScript cannot reliably disambiguate * between ToolAnnotations and ZodRawShapeCompat during overload resolution, as both are plain object types. * @deprecated Use `registerTool` instead. */ tool(name: string, description: string, paramsSchemaOrAnnotations: Args | ToolAnnotations, cb: ToolCallback): RegisteredTool; /** * Registers a tool with both parameter schema and annotations. * @deprecated Use `registerTool` instead. */ tool(name: string, paramsSchema: Args, annotations: ToolAnnotations, cb: ToolCallback): RegisteredTool; /** * Registers a tool with description, parameter schema, and annotations. * @deprecated Use `registerTool` instead. */ tool(name: string, description: string, paramsSchema: Args, annotations: ToolAnnotations, cb: ToolCallback): RegisteredTool; /** * Registers a tool with a config object and callback. */ registerTool(name: string, config: { title?: string; description?: string; inputSchema?: InputArgs; outputSchema?: OutputArgs; annotations?: ToolAnnotations; _meta?: Record; }, cb: ToolCallback): RegisteredTool; /** * Registers a zero-argument prompt `name`, which will run the given function when the client calls it. * @deprecated Use `registerPrompt` instead. */ prompt(name: string, cb: PromptCallback): RegisteredPrompt; /** * Registers a zero-argument prompt `name` (with a description) which will run the given function when the client calls it. * @deprecated Use `registerPrompt` instead. */ prompt(name: string, description: string, cb: PromptCallback): RegisteredPrompt; /** * Registers a prompt `name` accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments. * @deprecated Use `registerPrompt` instead. */ prompt(name: string, argsSchema: Args, cb: PromptCallback): RegisteredPrompt; /** * Registers a prompt `name` (with a description) accepting the given arguments, which must be an object containing named properties associated with Zod schemas. When the client calls it, the function will be run with the parsed and validated arguments. * @deprecated Use `registerPrompt` instead. */ prompt(name: string, description: string, argsSchema: Args, cb: PromptCallback): RegisteredPrompt; /** * Registers a prompt with a config object and callback. */ registerPrompt(name: string, config: { title?: string; description?: string; argsSchema?: Args; }, cb: PromptCallback): RegisteredPrompt; /** * Checks if the server is connected to a transport. * @returns True if the server is connected */ isConnected(): boolean; /** * Sends a logging message to the client, if connected. * Note: You only need to send the parameters object, not the entire JSON RPC message * @see LoggingMessageNotification * @param params * @param sessionId optional for stateless and backward compatibility */ sendLoggingMessage(params: LoggingMessageNotification['params'], sessionId?: string): Promise; /** * Sends a resource list changed event to the client, if connected. */ sendResourceListChanged(): void; /** * Sends a tool list changed event to the client, if connected. */ sendToolListChanged(): void; /** * Sends a prompt list changed event to the client, if connected. */ sendPromptListChanged(): void; } /** * A callback to complete one variable within a resource template's URI template. */ type CompleteResourceTemplateCallback = (value: string, context?: { arguments?: Record; }) => string[] | Promise; /** * A resource template combines a URI pattern with optional functionality to enumerate * all resources matching that pattern. */ declare class ResourceTemplate$1 { private _callbacks; private _uriTemplate; constructor(uriTemplate: string | UriTemplate, _callbacks: { /** * A callback to list all resources matching this template. This is required to specified, even if `undefined`, to avoid accidentally forgetting resource listing. */ list: ListResourcesCallback | undefined; /** * An optional callback to autocomplete variables within the URI template. Useful for clients and users to discover possible values. */ complete?: { [variable: string]: CompleteResourceTemplateCallback; }; }); /** * Gets the URI template pattern. */ get uriTemplate(): UriTemplate; /** * Gets the list callback, if one was provided. */ get listCallback(): ListResourcesCallback | undefined; /** * Gets the callback for completing a specific URI template variable, if one was provided. */ completeCallback(variable: string): CompleteResourceTemplateCallback | undefined; } type BaseToolCallback, Args extends undefined | ZodRawShapeCompat | AnySchema> = Args extends ZodRawShapeCompat ? (args: ShapeOutput, extra: Extra) => SendResultT | Promise : Args extends AnySchema ? (args: SchemaOutput, extra: Extra) => SendResultT | Promise : (extra: Extra) => SendResultT | Promise; /** * Callback for a tool handler registered with Server.tool(). * * Parameters will include tool arguments, if applicable, as well as other request handler context. * * The callback should return: * - `structuredContent` if the tool has an outputSchema defined * - `content` if the tool does not have an outputSchema * - Both fields are optional but typically one should be provided */ type ToolCallback = BaseToolCallback, Args>; /** * Supertype that can handle both regular tools (simple callback) and task-based tools (task handler object). */ type AnyToolHandler = ToolCallback | ToolTaskHandler; type RegisteredTool = { title?: string; description?: string; inputSchema?: AnySchema; outputSchema?: AnySchema; annotations?: ToolAnnotations; execution?: ToolExecution; _meta?: Record; handler: AnyToolHandler; enabled: boolean; enable(): void; disable(): void; update(updates: { name?: string | null; title?: string; description?: string; paramsSchema?: InputArgs; outputSchema?: OutputArgs; annotations?: ToolAnnotations; _meta?: Record; callback?: ToolCallback; enabled?: boolean; }): void; remove(): void; }; /** * Additional, optional information for annotating a resource. */ type ResourceMetadata = Omit; /** * Callback to list all resources matching a given template. */ type ListResourcesCallback = (extra: RequestHandlerExtra) => ListResourcesResult | Promise; /** * Callback to read a resource at a given URI. */ type ReadResourceCallback = (uri: URL, extra: RequestHandlerExtra) => ReadResourceResult | Promise; type RegisteredResource = { name: string; title?: string; metadata?: ResourceMetadata; readCallback: ReadResourceCallback; enabled: boolean; enable(): void; disable(): void; update(updates: { name?: string; title?: string; uri?: string | null; metadata?: ResourceMetadata; callback?: ReadResourceCallback; enabled?: boolean; }): void; remove(): void; }; /** * Callback to read a resource at a given URI, following a filled-in URI template. */ type ReadResourceTemplateCallback = (uri: URL, variables: Variables, extra: RequestHandlerExtra) => ReadResourceResult | Promise; type RegisteredResourceTemplate = { resourceTemplate: ResourceTemplate$1; title?: string; metadata?: ResourceMetadata; readCallback: ReadResourceTemplateCallback; enabled: boolean; enable(): void; disable(): void; update(updates: { name?: string | null; title?: string; template?: ResourceTemplate$1; metadata?: ResourceMetadata; callback?: ReadResourceTemplateCallback; enabled?: boolean; }): void; remove(): void; }; type PromptArgsRawShape = ZodRawShapeCompat; type PromptCallback = Args extends PromptArgsRawShape ? (args: ShapeOutput, extra: RequestHandlerExtra) => GetPromptResult | Promise : (extra: RequestHandlerExtra) => GetPromptResult | Promise; type RegisteredPrompt = { title?: string; description?: string; argsSchema?: AnyObjectSchema; callback: PromptCallback; enabled: boolean; enable(): void; disable(): void; update(updates: { name?: string | null; title?: string; description?: string; argsSchema?: Args; callback?: PromptCallback; enabled?: boolean; }): void; remove(): void; }; //#endregion //#region src/browser-server.d.ts declare const SERVER_MARKER_PROPERTY: "__isBrowserMcpServer"; interface BrowserMcpServerOptions extends ServerOptions { native?: ModelContextCore; } type RegisteredToolHandle = { unregister: () => void; }; /** * Browser-optimized MCP Server that speaks WebMCP natively. * * Implements `registerTool(tool, options?)` while retaining MCP capabilities * (resources, prompts, elicitation, sampling) via BaseMcpServer. * * Deprecated compatibility (kept for Chrome Beta 147 and existing wrappers, * removed in the next major): `unregisterTool(name)` and the `{ unregister }` * handle returned from `registerTool`. * * When `native` is provided, tool operations are mirrored so that * navigator.modelContextTesting stays in sync. */ declare class BrowserMcpServer extends McpServer { readonly [SERVER_MARKER_PROPERTY]: true; private native; private _promptSchemas; private _jsonValidator; private _publicMethodsBound; private _unregisterToolDeprecationWarned; private _nativeToolCleanups; private _producerEventTarget; private _ontoolchange; constructor(serverInfo: Implementation, options?: BrowserMcpServerOptions); /** * navigator.modelContext consumers may destructure methods (e.g. const { registerTool } = ...). * Bind methods once so they remain callable outside instance-method invocation syntax. */ private bindPublicApiMethods; private get _parentTools(); private get _parentResources(); private get _parentPrompts(); /** * Converts a schema (Zod or plain JSON Schema) to a transport-ready JSON Schema. * When `requireObjectType` is true (the default, for inputSchema), empty `{}` schemas * are normalized to `{ type: "object", properties: {} }` and schemas missing a root * `type` get `type: "object"` prepended — per MCP spec requirements. * When false (for outputSchema), no object-type normalization is applied. */ private toTransportSchema; private isZodSchema; private getNativeToolsApi; private getNativeUnregisterTool; private createNativeToolCleanup; private registerNativeToolMirror; private unregisterNativeToolMirror; private registerToolInServer; get ontoolchange(): ((this: ModelContextCore, ev: Event) => unknown) | null; set ontoolchange(handler: ((this: ModelContextCore, ev: Event) => unknown) | null); addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void; removeEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void; dispatchEvent(event: Event): boolean; private notifyProducerToolsChanged; backfillTools(tools: readonly ToolListItem[], execute: (name: string, args: Record) => Promise): number; registerTool(tool: ToolDescriptor, options?: ModelContextRegisterToolOptions): RegisteredToolHandle; /** * Backfill tools that were already registered on the native/polyfill context * before this BrowserMcpServer wrapper was installed. */ syncNativeTools(): number; unregisterTool(nameOrTool: string | ModelContextToolReference): void; registerResource(descriptor: { uri: string; name: string; description?: string; mimeType?: string; read: (uri: URL, params?: Record) => Promise<{ contents: ResourceContents$1[]; }>; }): { unregister: () => void; }; registerPrompt(descriptor: { name: string; description?: string; argsSchema?: InputSchema; get: (args: Record) => Promise<{ messages: PromptMessage[]; }>; }): { unregister: () => void; }; private resolveToolNameForUnregister; private warnUnregisterToolDeprecationOnce; listResources(): Array<{ uri: string; name: string; description?: string; mimeType?: string; }>; readResource(uri: string): Promise<{ contents: ResourceContents$1[]; }>; listPrompts(): Array<{ name: string; description?: string; arguments?: Array<{ name: string; description?: string; required?: boolean; }>; }>; getPrompt(name: string, args?: Record): Promise<{ messages: PromptMessage[]; }>; listTools(): ToolListItem[]; getTools(): Promise; /** * Override SDK's validateToolInput to handle both Zod schemas and plain JSON Schema. * Zod schemas use the SDK's safeParseAsync; plain JSON Schema uses PolyfillJsonSchemaValidator. */ validateToolInput(tool: { inputSchema?: unknown; }, args: Record | undefined, toolName: string): Promise | undefined>; /** * Override SDK's validateToolOutput to handle both Zod schemas and plain JSON Schema. */ validateToolOutput(tool: { outputSchema?: unknown; }, result: unknown, toolName: string): Promise; callTool(params: { name: string; arguments?: Record; }): Promise; executeTool(tool: ModelContextToolInfo, inputArgsJson: string, options?: ModelContextTestingExecuteToolOptions): Promise; executeTool(name: string, args?: Record): Promise; /** * Override connect to initialize request handlers BEFORE the transport connection. * This prevents "Cannot register capabilities after connecting to transport" errors * when tools are registered dynamically after connection. * * After the parent sets up its Zod-based handlers, we replace the ones that break * with plain JSON Schema objects (ListTools, ListPrompts, GetPrompt). */ connect(transport: Transport): Promise; createMessage(params: CreateMessageRequest['params'], options?: RequestOptions): Promise; elicitInput(params: ElicitRequest['params'], options?: RequestOptions): Promise; } interface ResourceDescriptor { uri: string; name: string; description?: string; mimeType?: string; read: (uri: URL, params?: Record) => Promise<{ contents: ResourceContents$1[]; }>; } interface PromptDescriptor { name: string; description?: string; argsSchema?: InputSchema; get: (args: Record) => Promise<{ messages: PromptMessage[]; }>; } //#endregion //#region src/no-op-validator.d.ts /** * No-op JSON Schema validator for browser environments. * * This validator bypasses the MCP SDK's internal ajv-based validation which causes * "Error compiling schema" errors in browser extensions due to ajv's use of * eval/Function constructor. * * Validation is handled externally by Zod in @mcp-b/global, making the SDK's * internal validation redundant. This no-op validator allows the SDK to function * without the ajv dependency issues. */ /** * Interface for JSON Schema validators. * This matches the MCP SDK's jsonSchemaValidator interface. */ interface JsonSchemaValidator$1 { getValidator(schema: unknown): (input: unknown) => JsonSchemaValidatorResult$1; } /** * Result type for JSON Schema validation */ type JsonSchemaValidatorResult$1 = { valid: true; data: T; errorMessage: undefined; } | { valid: false; data: undefined; errorMessage: string; }; /** * A no-op JSON Schema validator that always returns valid. * * Use this in browser environments where: * - ajv causes "Error compiling schema" errors * - Validation is already handled elsewhere (e.g., by Zod) * - You need to avoid eval/Function constructor restrictions * * @example * ```typescript * import { BrowserMcpServer } from '@mcp-b/webmcp-ts-sdk'; * import { NoOpJsonSchemaValidator } from '@mcp-b/webmcp-ts-sdk/no-op-validator'; * * const server = new BrowserMcpServer( * { name: 'my-server', version: '1.0.0' }, * { jsonSchemaValidator: new NoOpJsonSchemaValidator() } * ); * ``` */ declare class NoOpJsonSchemaValidator implements JsonSchemaValidator$1 { /** * Returns a validator function that always passes. * The input data is passed through unchanged. * * @param _schema - The JSON Schema (ignored) * @returns A validator function that always returns valid */ getValidator(_schema: unknown): (input: unknown) => JsonSchemaValidatorResult$1; } //#endregion //#region src/polyfill-validator.d.ts interface JsonSchemaValidator { getValidator(schema: unknown): (input: unknown) => JsonSchemaValidatorResult; } type JsonSchemaValidatorResult = { valid: true; data: T; errorMessage: undefined; } | { valid: false; data: undefined; errorMessage: string; }; declare class PolyfillJsonSchemaValidator implements JsonSchemaValidator { getValidator(schema: unknown): (input: unknown) => JsonSchemaValidatorResult; } //#endregion //#region src/index.d.ts type SamplingRequestParams = CreateMessageRequest['params']; type SamplingResult = CreateMessageResult; //#endregion export { BrowserMcpServer, BrowserMcpServer as McpServer, type BrowserMcpServerOptions, type CallToolRequest, CallToolRequestSchema, type CallToolResult, CallToolResultSchema, Client, type ClientCapabilities, type ClientNotification, type ClientRequest, type ClientResult, type CreateMessageRequest, CreateMessageRequestSchema, type CreateMessageResult, CreateMessageResultSchema, type ElicitRequest, ElicitRequestSchema, type ElicitResult, ElicitResultSchema, ErrorCode, type GetPromptRequest, GetPromptRequestSchema, type GetPromptResult, GetPromptResultSchema, type Implementation, type InitializeRequest, InitializeRequestSchema, type InitializeResult, InitializeResultSchema, type JSONRPCMessage, JSONRPCMessageSchema, LATEST_PROTOCOL_VERSION, type ListPromptsRequest, ListPromptsRequestSchema, type ListPromptsResult, ListPromptsResultSchema, type ListResourcesRequest, ListResourcesRequestSchema, type ListResourcesResult, ListResourcesResultSchema, type ListToolsRequest, ListToolsRequestSchema, type ListToolsResult, ListToolsResultSchema, type LoggingLevel, LoggingLevelSchema, type LoggingMessageNotification, type McpError, NoOpJsonSchemaValidator, type Notification, PolyfillJsonSchemaValidator, type Prompt, type PromptDescriptor, type PromptMessage, ReadBuffer, type ReadResourceRequest, ReadResourceRequestSchema, type ReadResourceResult, ReadResourceResultSchema, type Request, type RequestOptions, type Resource, type ResourceContents, type ResourceDescriptor, ResourceListChangedNotificationSchema, type ResourceTemplate, type Result, SERVER_MARKER_PROPERTY, SUPPORTED_PROTOCOL_VERSIONS, SamplingRequestParams, SamplingResult, type ServerCapabilities, type ServerNotification, type ServerRequest, type ServerResult, type Tool, type ToolAnnotations, ToolListChangedNotificationSchema, type Transport, type TransportSendOptions, mergeCapabilities, serializeMessage }; //# sourceMappingURL=index.d.ts.map