From fcca9c82f4c90d6c182ac8ce7750af5419b11e88 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 25 Mar 2026 11:51:57 +0000 Subject: [PATCH] chore: update spec.types.ts from upstream --- packages/core/src/types/spec.types.ts | 2857 +++++++++++++------------ 1 file changed, 1451 insertions(+), 1406 deletions(-) diff --git a/packages/core/src/types/spec.types.ts b/packages/core/src/types/spec.types.ts index ba849c546..d5d312306 100644 --- a/packages/core/src/types/spec.types.ts +++ b/packages/core/src/types/spec.types.ts @@ -3,16 +3,22 @@ * * Source: https://github.com/modelcontextprotocol/modelcontextprotocol * Pulled from: https://raw.githubusercontent.com/modelcontextprotocol/modelcontextprotocol/main/schema/draft/schema.ts - * Last updated from commit: 838d6f69055f1d14400d67a47eb1d76207c7c34b + * Last updated from commit: 3b875c5349255f8b29f09afee6c7079eb7ec9a0d * * DO NOT EDIT THIS FILE MANUALLY. Changes will be overwritten by automated updates. * To update this file, run: pnpm run fetch:spec-types - */ /* JSON types */ + *//* JSON types */ /** * @category Common Types */ -export type JSONValue = string | number | boolean | null | JSONObject | JSONArray; +export type JSONValue = + | string + | number + | boolean + | null + | JSONObject + | JSONArray; /** * @category Common Types @@ -31,12 +37,15 @@ export type JSONArray = JSONValue[]; * * @category JSON-RPC */ -export type JSONRPCMessage = JSONRPCRequest | JSONRPCNotification | JSONRPCResponse; +export type JSONRPCMessage = + | JSONRPCRequest + | JSONRPCNotification + | JSONRPCResponse; /** @internal */ -export const LATEST_PROTOCOL_VERSION = 'DRAFT-2026-v1'; +export const LATEST_PROTOCOL_VERSION = "DRAFT-2026-v1"; /** @internal */ -export const JSONRPC_VERSION = '2.0'; +export const JSONRPC_VERSION = "2.0"; /** * Represents the contents of a `_meta` field, which clients and servers use to attach additional metadata to their interactions. @@ -67,10 +76,10 @@ export type MetaObject = Record; * @category Common Types */ export interface RequestMetaObject extends MetaObject { - /** - * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by {@link ProgressNotification | 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?: ProgressToken; + /** + * If specified, the caller is requesting out-of-band progress notifications for this request (as represented by {@link ProgressNotification | 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?: ProgressToken; } /** @@ -93,15 +102,15 @@ export type Cursor = string; * @internal */ export interface TaskAugmentedRequestParams extends RequestParams { - /** - * If specified, the caller is requesting task-augmented execution for this request. - * The request will return a {@link CreateTaskResult} immediately, and the actual result can be - * retrieved later via {@link GetTaskPayloadRequest | tasks/result}. - * - * Task augmentation is subject to capability negotiation - receivers MUST declare support - * for task augmentation of specific request types in their capabilities. - */ - task?: TaskMetadata; + /** + * If specified, the caller is requesting task-augmented execution for this request. + * The request will return a {@link CreateTaskResult} immediately, and the actual result can be + * retrieved later via {@link GetTaskPayloadRequest | tasks/result}. + * + * Task augmentation is subject to capability negotiation - receivers MUST declare support + * for task augmentation of specific request types in their capabilities. + */ + task?: TaskMetadata; } /** @@ -110,15 +119,15 @@ export interface TaskAugmentedRequestParams extends RequestParams { * @category Common Types */ export interface RequestParams { - _meta?: RequestMetaObject; + _meta?: RequestMetaObject; } /** @internal */ export interface Request { - method: string; - // Allow unofficial extensions of `Request.params` without impacting `RequestParams`. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - params?: { [key: string]: any }; + method: string; + // Allow unofficial extensions of `Request.params` without impacting `RequestParams`. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + params?: { [key: string]: any }; } /** @@ -127,15 +136,15 @@ export interface Request { * @category Common Types */ export interface NotificationParams { - _meta?: MetaObject; + _meta?: MetaObject; } /** @internal */ export interface Notification { - method: string; - // Allow unofficial extensions of `Notification.params` without impacting `NotificationParams`. - // eslint-disable-next-line @typescript-eslint/no-explicit-any - params?: { [key: string]: any }; + method: string; + // Allow unofficial extensions of `Notification.params` without impacting `NotificationParams`. + // eslint-disable-next-line @typescript-eslint/no-explicit-any + params?: { [key: string]: any }; } /** @@ -144,26 +153,26 @@ export interface Notification { * @category Common Types */ export interface Result { - _meta?: MetaObject; - [key: string]: unknown; + _meta?: MetaObject; + [key: string]: unknown; } /** * @category Errors */ export interface Error { - /** - * The error type that occurred. - */ - code: number; - /** - * A short description of the error. The message SHOULD be limited to a concise single sentence. - */ - message: string; - /** - * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). - */ - data?: unknown; + /** + * The error type that occurred. + */ + code: number; + /** + * A short description of the error. The message SHOULD be limited to a concise single sentence. + */ + message: string; + /** + * Additional information about the error. The value of this member is defined by the sender (e.g. detailed error information, nested errors etc.). + */ + data?: unknown; } /** @@ -179,8 +188,8 @@ export type RequestId = string | number; * @category JSON-RPC */ export interface JSONRPCRequest extends Request { - jsonrpc: typeof JSONRPC_VERSION; - id: RequestId; + jsonrpc: typeof JSONRPC_VERSION; + id: RequestId; } /** @@ -189,7 +198,7 @@ export interface JSONRPCRequest extends Request { * @category JSON-RPC */ export interface JSONRPCNotification extends Notification { - jsonrpc: typeof JSONRPC_VERSION; + jsonrpc: typeof JSONRPC_VERSION; } /** @@ -198,9 +207,9 @@ export interface JSONRPCNotification extends Notification { * @category JSON-RPC */ export interface JSONRPCResultResponse { - jsonrpc: typeof JSONRPC_VERSION; - id: RequestId; - result: Result; + jsonrpc: typeof JSONRPC_VERSION; + id: RequestId; + result: Result; } /** @@ -209,9 +218,9 @@ export interface JSONRPCResultResponse { * @category JSON-RPC */ export interface JSONRPCErrorResponse { - jsonrpc: typeof JSONRPC_VERSION; - id?: RequestId; - error: Error; + jsonrpc: typeof JSONRPC_VERSION; + id?: RequestId; + error: Error; } /** @@ -239,7 +248,7 @@ export const INTERNAL_ERROR = -32603; * @category Errors */ export interface ParseError extends Error { - code: typeof PARSE_ERROR; + code: typeof PARSE_ERROR; } /** @@ -250,7 +259,7 @@ export interface ParseError extends Error { * @category Errors */ export interface InvalidRequestError extends Error { - code: typeof INVALID_REQUEST; + code: typeof INVALID_REQUEST; } /** @@ -269,7 +278,7 @@ export interface InvalidRequestError extends Error { * @category Errors */ export interface MethodNotFoundError extends Error { - code: typeof METHOD_NOT_FOUND; + code: typeof METHOD_NOT_FOUND; } /** @@ -302,7 +311,7 @@ export interface MethodNotFoundError extends Error { * @category Errors */ export interface InvalidParamsError extends Error { - code: typeof INVALID_PARAMS; + code: typeof INVALID_PARAMS; } /** @@ -316,7 +325,7 @@ export interface InvalidParamsError extends Error { * @category Errors */ export interface InternalError extends Error { - code: typeof INTERNAL_ERROR; + code: typeof INTERNAL_ERROR; } // Implementation-specific JSON-RPC error codes [-32000, -32099] @@ -331,14 +340,17 @@ export const URL_ELICITATION_REQUIRED = -32042; * * @internal */ -export interface URLElicitationRequiredError extends Omit { - error: Error & { - code: typeof URL_ELICITATION_REQUIRED; - data: { - elicitations: ElicitRequestURLParams[]; - [key: string]: unknown; - }; +export interface URLElicitationRequiredError extends Omit< + JSONRPCErrorResponse, + "error" +> { + error: Error & { + code: typeof URL_ELICITATION_REQUIRED; + data: { + elicitations: ElicitRequestURLParams[]; + [key: string]: unknown; }; + }; } /* Empty result */ @@ -359,19 +371,19 @@ export type EmptyResult = Result; * @category `notifications/cancelled` */ export interface CancelledNotificationParams extends NotificationParams { - /** - * The ID of the request to cancel. - * - * This MUST correspond to the ID of a request previously issued in the same direction. - * This MUST be provided for cancelling non-task requests. - * This MUST NOT be used for cancelling tasks (use the {@link CancelTaskRequest | tasks/cancel} request instead). - */ - requestId?: RequestId; + /** + * The ID of the request to cancel. + * + * This MUST correspond to the ID of a request previously issued in the same direction. + * This MUST be provided for cancelling non-task requests. + * This MUST NOT be used for cancelling tasks (use the {@link CancelTaskRequest | tasks/cancel} request instead). + */ + requestId?: RequestId; - /** - * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. - */ - reason?: string; + /** + * An optional string describing the reason for the cancellation. This MAY be logged or presented to the user. + */ + reason?: string; } /** @@ -391,8 +403,8 @@ export interface CancelledNotificationParams extends NotificationParams { * @category `notifications/cancelled` */ export interface CancelledNotification extends JSONRPCNotification { - method: 'notifications/cancelled'; - params: CancelledNotificationParams; + method: "notifications/cancelled"; + params: CancelledNotificationParams; } /* Initialization */ @@ -405,12 +417,12 @@ export interface CancelledNotification extends JSONRPCNotification { * @category `initialize` */ export interface InitializeRequestParams extends RequestParams { - /** - * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. - */ - protocolVersion: string; - capabilities: ClientCapabilities; - clientInfo: Implementation; + /** + * The latest version of the Model Context Protocol that the client supports. The client MAY decide to support older versions as well. + */ + protocolVersion: string; + capabilities: ClientCapabilities; + clientInfo: Implementation; } /** @@ -422,8 +434,8 @@ export interface InitializeRequestParams extends RequestParams { * @category `initialize` */ export interface InitializeRequest extends JSONRPCRequest { - method: 'initialize'; - params: InitializeRequestParams; + method: "initialize"; + params: InitializeRequestParams; } /** @@ -435,24 +447,24 @@ export interface InitializeRequest extends JSONRPCRequest { * @category `initialize` */ export interface InitializeResult extends Result { - /** - * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. - */ - protocolVersion: string; - capabilities: ServerCapabilities; - serverInfo: Implementation; - - /** - * Instructions describing how to use the server and its features. - * - * Instructions should focus on information that helps the model use the server effectively (e.g., cross-tool relationships, workflow patterns, constraints), but should not duplicate information already in tool descriptions. - * - * Clients MAY add this information to the system prompt. - * - * @example Server with workflow instructions - * {@includeCode ./examples/InitializeResult/with-instructions.json} - */ - instructions?: string; + /** + * The version of the Model Context Protocol that the server wants to use. This may not match the version that the client requested. If the client cannot support this version, it MUST disconnect. + */ + protocolVersion: string; + capabilities: ServerCapabilities; + serverInfo: Implementation; + + /** + * Instructions describing how to use the server and its features. + * + * Instructions should focus on information that helps the model use the server effectively (e.g., cross-tool relationships, workflow patterns, constraints), but should not duplicate information already in tool descriptions. + * + * Clients MAY add this information to the system prompt. + * + * @example Server with workflow instructions + * {@includeCode ./examples/InitializeResult/with-instructions.json} + */ + instructions?: string; } /** @@ -464,7 +476,7 @@ export interface InitializeResult extends Result { * @category `initialize` */ export interface InitializeResultResponse extends JSONRPCResultResponse { - result: InitializeResult; + result: InitializeResult; } /** @@ -476,8 +488,8 @@ export interface InitializeResultResponse extends JSONRPCResultResponse { * @category `notifications/initialized` */ export interface InitializedNotification extends JSONRPCNotification { - method: 'notifications/initialized'; - params?: NotificationParams; + method: "notifications/initialized"; + params?: NotificationParams; } /** @@ -486,107 +498,107 @@ export interface InitializedNotification extends JSONRPCNotification { * @category `initialize` */ export interface ClientCapabilities { - /** - * Experimental, non-standard capabilities that the client supports. - */ - experimental?: { [key: string]: JSONObject }; - /** - * Present if the client supports listing roots. - * - * @example Roots — minimum baseline support - * {@includeCode ./examples/ClientCapabilities/roots-minimum-baseline-support.json} - * - * @example Roots — list changed notifications - * {@includeCode ./examples/ClientCapabilities/roots-list-changed-notifications.json} - */ - roots?: { + /** + * Experimental, non-standard capabilities that the client supports. + */ + experimental?: { [key: string]: JSONObject }; + /** + * Present if the client supports listing roots. + * + * @example Roots — minimum baseline support + * {@includeCode ./examples/ClientCapabilities/roots-minimum-baseline-support.json} + * + * @example Roots — list changed notifications + * {@includeCode ./examples/ClientCapabilities/roots-list-changed-notifications.json} + */ + roots?: { + /** + * Whether the client supports notifications for changes to the roots list. + */ + listChanged?: boolean; + }; + /** + * Present if the client supports sampling from an LLM. + * + * @example Sampling — minimum baseline support + * {@includeCode ./examples/ClientCapabilities/sampling-minimum-baseline-support.json} + * + * @example Sampling — tool use support + * {@includeCode ./examples/ClientCapabilities/sampling-tool-use-support.json} + * + * @example Sampling — context inclusion support (soft-deprecated) + * {@includeCode ./examples/ClientCapabilities/sampling-context-inclusion-support-soft-deprecated.json} + */ + sampling?: { + /** + * Whether the client supports context inclusion via `includeContext` parameter. + * If not declared, servers SHOULD only use `includeContext: "none"` (or omit it). + */ + context?: JSONObject; + /** + * Whether the client supports tool use via `tools` and `toolChoice` parameters. + */ + tools?: JSONObject; + }; + /** + * Present if the client supports elicitation from the server. + * + * @example Elicitation — form and URL mode support + * {@includeCode ./examples/ClientCapabilities/elicitation-form-and-url-mode-support.json} + * + * @example Elicitation — form mode only (implicit) + * {@includeCode ./examples/ClientCapabilities/elicitation-form-only-implicit.json} + */ + elicitation?: { + form?: JSONObject; + url?: JSONObject; + }; + + /** + * Present if the client supports task-augmented requests. + */ + tasks?: { + /** + * Whether this client supports {@link ListTasksRequest | tasks/list}. + */ + list?: JSONObject; + /** + * Whether this client supports {@link CancelTaskRequest | tasks/cancel}. + */ + cancel?: JSONObject; + /** + * Specifies which request types can be augmented with tasks. + */ + requests?: { + /** + * Task support for sampling-related requests. + */ + sampling?: { /** - * Whether the client supports notifications for changes to the roots list. + * Whether the client supports task-augmented `sampling/createMessage` requests. */ - listChanged?: boolean; - }; - /** - * Present if the client supports sampling from an LLM. - * - * @example Sampling — minimum baseline support - * {@includeCode ./examples/ClientCapabilities/sampling-minimum-baseline-support.json} - * - * @example Sampling — tool use support - * {@includeCode ./examples/ClientCapabilities/sampling-tool-use-support.json} - * - * @example Sampling — context inclusion support (soft-deprecated) - * {@includeCode ./examples/ClientCapabilities/sampling-context-inclusion-support-soft-deprecated.json} - */ - sampling?: { - /** - * Whether the client supports context inclusion via `includeContext` parameter. - * If not declared, servers SHOULD only use `includeContext: "none"` (or omit it). - */ - context?: JSONObject; - /** - * Whether the client supports tool use via `tools` and `toolChoice` parameters. - */ - tools?: JSONObject; - }; - /** - * Present if the client supports elicitation from the server. - * - * @example Elicitation — form and URL mode support - * {@includeCode ./examples/ClientCapabilities/elicitation-form-and-url-mode-support.json} - * - * @example Elicitation — form mode only (implicit) - * {@includeCode ./examples/ClientCapabilities/elicitation-form-only-implicit.json} - */ - elicitation?: { - form?: JSONObject; - url?: JSONObject; - }; - - /** - * Present if the client supports task-augmented requests. - */ - tasks?: { - /** - * Whether this client supports {@link ListTasksRequest | tasks/list}. - */ - list?: JSONObject; - /** - * Whether this client supports {@link CancelTaskRequest | tasks/cancel}. - */ - cancel?: JSONObject; + createMessage?: JSONObject; + }; + /** + * Task support for elicitation-related requests. + */ + elicitation?: { /** - * Specifies which request types can be augmented with tasks. + * Whether the client supports task-augmented {@link ElicitRequest | elicitation/create} requests. */ - requests?: { - /** - * Task support for sampling-related requests. - */ - sampling?: { - /** - * Whether the client supports task-augmented `sampling/createMessage` requests. - */ - createMessage?: JSONObject; - }; - /** - * Task support for elicitation-related requests. - */ - elicitation?: { - /** - * Whether the client supports task-augmented {@link ElicitRequest | elicitation/create} requests. - */ - create?: JSONObject; - }; - }; + create?: JSONObject; + }; }; - /** - * Optional MCP extensions that the client supports. Keys are extension identifiers - * (e.g., "io.modelcontextprotocol/oauth-client-credentials"), and values are - * per-extension settings objects. An empty object indicates support with no settings. - * - * @example Extensions — UI extension with MIME type support - * {@includeCode ./examples/ClientCapabilities/extensions-ui-mime-types.json} - */ - extensions?: { [key: string]: JSONObject }; + }; + /** + * Optional MCP extensions that the client supports. Keys are extension identifiers + * (e.g., "io.modelcontextprotocol/oauth-client-credentials"), and values are + * per-extension settings objects. An empty object indicates support with no settings. + * + * @example Extensions — UI extension with MIME type support + * {@includeCode ./examples/ClientCapabilities/extensions-ui-mime-types.json} + */ + extensions?: { [key: string]: object }; } /** @@ -595,115 +607,115 @@ export interface ClientCapabilities { * @category `initialize` */ export interface ServerCapabilities { - /** - * Experimental, non-standard capabilities that the server supports. - */ - experimental?: { [key: string]: JSONObject }; - /** - * Present if the server supports sending log messages to the client. - * - * @example Logging — minimum baseline support - * {@includeCode ./examples/ServerCapabilities/logging-minimum-baseline-support.json} - */ - logging?: JSONObject; - /** - * Present if the server supports argument autocompletion suggestions. - * - * @example Completions — minimum baseline support - * {@includeCode ./examples/ServerCapabilities/completions-minimum-baseline-support.json} - */ - completions?: JSONObject; - /** - * Present if the server offers any prompt templates. - * - * @example Prompts — minimum baseline support - * {@includeCode ./examples/ServerCapabilities/prompts-minimum-baseline-support.json} - * - * @example Prompts — list changed notifications - * {@includeCode ./examples/ServerCapabilities/prompts-list-changed-notifications.json} - */ - prompts?: { - /** - * Whether this server supports notifications for changes to the prompt list. - */ - listChanged?: boolean; - }; - /** - * Present if the server offers any resources to read. - * - * @example Resources — minimum baseline support - * {@includeCode ./examples/ServerCapabilities/resources-minimum-baseline-support.json} - * - * @example Resources — subscription to individual resource updates (only) - * {@includeCode ./examples/ServerCapabilities/resources-subscription-to-individual-resource-updates-only.json} - * - * @example Resources — list changed notifications (only) - * {@includeCode ./examples/ServerCapabilities/resources-list-changed-notifications-only.json} - * - * @example Resources — all notifications - * {@includeCode ./examples/ServerCapabilities/resources-all-notifications.json} - */ - resources?: { - /** - * Whether this server supports subscribing to resource updates. - */ - subscribe?: boolean; - /** - * Whether this server supports notifications for changes to the resource list. - */ - listChanged?: boolean; - }; - /** - * Present if the server offers any tools to call. - * - * @example Tools — minimum baseline support - * {@includeCode ./examples/ServerCapabilities/tools-minimum-baseline-support.json} - * - * @example Tools — list changed notifications - * {@includeCode ./examples/ServerCapabilities/tools-list-changed-notifications.json} - */ - tools?: { - /** - * Whether this server supports notifications for changes to the tool list. - */ - listChanged?: boolean; - }; - /** - * Present if the server supports task-augmented requests. - */ - tasks?: { - /** - * Whether this server supports {@link ListTasksRequest | tasks/list}. - */ - list?: JSONObject; - /** - * Whether this server supports {@link CancelTaskRequest | tasks/cancel}. - */ - cancel?: JSONObject; + /** + * Experimental, non-standard capabilities that the server supports. + */ + experimental?: { [key: string]: JSONObject }; + /** + * Present if the server supports sending log messages to the client. + * + * @example Logging — minimum baseline support + * {@includeCode ./examples/ServerCapabilities/logging-minimum-baseline-support.json} + */ + logging?: JSONObject; + /** + * Present if the server supports argument autocompletion suggestions. + * + * @example Completions — minimum baseline support + * {@includeCode ./examples/ServerCapabilities/completions-minimum-baseline-support.json} + */ + completions?: JSONObject; + /** + * Present if the server offers any prompt templates. + * + * @example Prompts — minimum baseline support + * {@includeCode ./examples/ServerCapabilities/prompts-minimum-baseline-support.json} + * + * @example Prompts — list changed notifications + * {@includeCode ./examples/ServerCapabilities/prompts-list-changed-notifications.json} + */ + prompts?: { + /** + * Whether this server supports notifications for changes to the prompt list. + */ + listChanged?: boolean; + }; + /** + * Present if the server offers any resources to read. + * + * @example Resources — minimum baseline support + * {@includeCode ./examples/ServerCapabilities/resources-minimum-baseline-support.json} + * + * @example Resources — subscription to individual resource updates (only) + * {@includeCode ./examples/ServerCapabilities/resources-subscription-to-individual-resource-updates-only.json} + * + * @example Resources — list changed notifications (only) + * {@includeCode ./examples/ServerCapabilities/resources-list-changed-notifications-only.json} + * + * @example Resources — all notifications + * {@includeCode ./examples/ServerCapabilities/resources-all-notifications.json} + */ + resources?: { + /** + * Whether this server supports subscribing to resource updates. + */ + subscribe?: boolean; + /** + * Whether this server supports notifications for changes to the resource list. + */ + listChanged?: boolean; + }; + /** + * Present if the server offers any tools to call. + * + * @example Tools — minimum baseline support + * {@includeCode ./examples/ServerCapabilities/tools-minimum-baseline-support.json} + * + * @example Tools — list changed notifications + * {@includeCode ./examples/ServerCapabilities/tools-list-changed-notifications.json} + */ + tools?: { + /** + * Whether this server supports notifications for changes to the tool list. + */ + listChanged?: boolean; + }; + /** + * Present if the server supports task-augmented requests. + */ + tasks?: { + /** + * Whether this server supports {@link ListTasksRequest | tasks/list}. + */ + list?: JSONObject; + /** + * Whether this server supports {@link CancelTaskRequest | tasks/cancel}. + */ + cancel?: JSONObject; + /** + * Specifies which request types can be augmented with tasks. + */ + requests?: { + /** + * Task support for tool-related requests. + */ + tools?: { /** - * Specifies which request types can be augmented with tasks. + * Whether the server supports task-augmented {@link CallToolRequest | tools/call} requests. */ - requests?: { - /** - * Task support for tool-related requests. - */ - tools?: { - /** - * Whether the server supports task-augmented {@link CallToolRequest | tools/call} requests. - */ - call?: JSONObject; - }; - }; + call?: JSONObject; + }; }; - /** - * Optional MCP extensions that the server supports. Keys are extension identifiers - * (e.g., "io.modelcontextprotocol/apps"), and values are per-extension settings - * objects. An empty object indicates support with no settings. - * - * @example Extensions — UI extension support - * {@includeCode ./examples/ServerCapabilities/extensions-ui.json} - */ - extensions?: { [key: string]: JSONObject }; + }; + /** + * Optional MCP extensions that the server supports. Keys are extension identifiers + * (e.g., "io.modelcontextprotocol/apps"), and values are per-extension settings + * objects. An empty object indicates support with no settings. + * + * @example Extensions — UI extension support + * {@includeCode ./examples/ServerCapabilities/extensions-ui.json} + */ + extensions?: { [key: string]: object }; } /** @@ -712,42 +724,42 @@ export interface ServerCapabilities { * @category Common Types */ export interface Icon { - /** - * A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a - * `data:` URI with Base64-encoded image data. - * - * Consumers SHOULD take steps to ensure URLs serving icons are from the - * same domain as the client/server or a trusted domain. - * - * Consumers SHOULD take appropriate precautions when consuming SVGs as they can contain - * executable JavaScript. - * - * @format uri - */ - src: string; - - /** - * Optional MIME type override if the source MIME type is missing or generic. - * For example: `"image/png"`, `"image/jpeg"`, or `"image/svg+xml"`. - */ - mimeType?: string; - - /** - * Optional array of strings that specify sizes at which the icon can be used. - * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG. - * - * If not provided, the client should assume that the icon can be used at any size. - */ - sizes?: string[]; - - /** - * Optional specifier for the theme this icon is designed for. `"light"` indicates - * the icon is designed to be used with a light background, and `"dark"` indicates - * the icon is designed to be used with a dark background. - * - * If not provided, the client should assume the icon can be used with any theme. - */ - theme?: 'light' | 'dark'; + /** + * A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a + * `data:` URI with Base64-encoded image data. + * + * Consumers SHOULD take steps to ensure URLs serving icons are from the + * same domain as the client/server or a trusted domain. + * + * Consumers SHOULD take appropriate precautions when consuming SVGs as they can contain + * executable JavaScript. + * + * @format uri + */ + src: string; + + /** + * Optional MIME type override if the source MIME type is missing or generic. + * For example: `"image/png"`, `"image/jpeg"`, or `"image/svg+xml"`. + */ + mimeType?: string; + + /** + * Optional array of strings that specify sizes at which the icon can be used. + * Each string should be in WxH format (e.g., `"48x48"`, `"96x96"`) or `"any"` for scalable formats like SVG. + * + * If not provided, the client should assume that the icon can be used at any size. + */ + sizes?: string[]; + + /** + * Optional specifier for the theme this icon is designed for. `"light"` indicates + * the icon is designed to be used with a light background, and `"dark"` indicates + * the icon is designed to be used with a dark background. + * + * If not provided, the client should assume the icon can be used with any theme. + */ + theme?: "light" | "dark"; } /** @@ -756,18 +768,18 @@ export interface Icon { * @internal */ export interface Icons { - /** - * Optional set of sized icons that the client can display in a user interface. - * - * Clients that support rendering icons MUST support at least the following MIME types: - * - `image/png` - PNG images (safe, universal compatibility) - * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility) - * - * Clients that support rendering icons SHOULD also support: - * - `image/svg+xml` - SVG images (scalable but requires security precautions) - * - `image/webp` - WebP images (modern, efficient format) - */ - icons?: Icon[]; + /** + * Optional set of sized icons that the client can display in a user interface. + * + * Clients that support rendering icons MUST support at least the following MIME types: + * - `image/png` - PNG images (safe, universal compatibility) + * - `image/jpeg` (and `image/jpg`) - JPEG images (safe, universal compatibility) + * + * Clients that support rendering icons SHOULD also support: + * - `image/svg+xml` - SVG images (scalable but requires security precautions) + * - `image/webp` - WebP images (modern, efficient format) + */ + icons?: Icon[]; } /** @@ -776,20 +788,20 @@ export interface Icons { * @internal */ export interface BaseMetadata { - /** - * Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present). - */ - name: string; + /** + * Intended for programmatic or logical use, but used as a display name in past specs or fallback (if title isn't present). + */ + name: string; - /** - * Intended for UI and end-user contexts — optimized to be human-readable and easily understood, - * even by those unfamiliar with domain-specific terminology. - * - * If not provided, the name should be used for display (except for {@link Tool}, - * where `annotations.title` should be given precedence over using `name`, - * if present). - */ - title?: string; + /** + * Intended for UI and end-user contexts — optimized to be human-readable and easily understood, + * even by those unfamiliar with domain-specific terminology. + * + * If not provided, the name should be used for display (except for {@link Tool}, + * where `annotations.title` should be given precedence over using `name`, + * if present). + */ + title?: string; } /** @@ -798,26 +810,26 @@ export interface BaseMetadata { * @category `initialize` */ export interface Implementation extends BaseMetadata, Icons { - /** - * The version of this implementation. - */ - version: string; - - /** - * An optional human-readable description of what this implementation does. - * - * This can be used by clients or servers to provide context about their purpose - * and capabilities. For example, a server might describe the types of resources - * or tools it provides, while a client might describe its intended use case. - */ - description?: string; - - /** - * An optional URL of the website for this implementation. - * - * @format uri - */ - websiteUrl?: string; + /** + * The version of this implementation. + */ + version: string; + + /** + * An optional human-readable description of what this implementation does. + * + * This can be used by clients or servers to provide context about their purpose + * and capabilities. For example, a server might describe the types of resources + * or tools it provides, while a client might describe its intended use case. + */ + description?: string; + + /** + * An optional URL of the website for this implementation. + * + * @format uri + */ + websiteUrl?: string; } /* Ping */ @@ -830,8 +842,8 @@ export interface Implementation extends BaseMetadata, Icons { * @category `ping` */ export interface PingRequest extends JSONRPCRequest { - method: 'ping'; - params?: RequestParams; + method: "ping"; + params?: RequestParams; } /** @@ -843,7 +855,7 @@ export interface PingRequest extends JSONRPCRequest { * @category `ping` */ export interface PingResultResponse extends JSONRPCResultResponse { - result: EmptyResult; + result: EmptyResult; } /* Progress notifications */ @@ -857,26 +869,26 @@ export interface PingResultResponse extends JSONRPCResultResponse { * @category `notifications/progress` */ export interface ProgressNotificationParams extends NotificationParams { - /** - * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. - */ - progressToken: ProgressToken; - /** - * The progress thus far. This should increase every time progress is made, even if the total is unknown. - * - * @TJS-type number - */ - progress: number; - /** - * Total number of items to process (or total progress required), if known. - * - * @TJS-type number - */ - total?: number; - /** - * An optional message describing the current progress. - */ - message?: string; + /** + * The progress token which was given in the initial request, used to associate this notification with the request that is proceeding. + */ + progressToken: ProgressToken; + /** + * The progress thus far. This should increase every time progress is made, even if the total is unknown. + * + * @TJS-type number + */ + progress: number; + /** + * Total number of items to process (or total progress required), if known. + * + * @TJS-type number + */ + total?: number; + /** + * An optional message describing the current progress. + */ + message?: string; } /** @@ -888,8 +900,8 @@ export interface ProgressNotificationParams extends NotificationParams { * @category `notifications/progress` */ export interface ProgressNotification extends JSONRPCNotification { - method: 'notifications/progress'; - params: ProgressNotificationParams; + method: "notifications/progress"; + params: ProgressNotificationParams; } /* Pagination */ @@ -902,25 +914,25 @@ export interface ProgressNotification extends JSONRPCNotification { * @category Common Types */ export interface PaginatedRequestParams extends RequestParams { - /** - * An opaque token representing the current pagination position. - * If provided, the server should return results starting after this cursor. - */ - cursor?: Cursor; + /** + * An opaque token representing the current pagination position. + * If provided, the server should return results starting after this cursor. + */ + cursor?: Cursor; } /** @internal */ export interface PaginatedRequest extends JSONRPCRequest { - params?: PaginatedRequestParams; + params?: PaginatedRequestParams; } /** @internal */ export interface PaginatedResult extends Result { - /** - * An opaque token representing the pagination position after the last returned result. - * If present, there may be more results available. - */ - nextCursor?: Cursor; + /** + * An opaque token representing the pagination position after the last returned result. + * If present, there may be more results available. + */ + nextCursor?: Cursor; } /* Resources */ @@ -933,7 +945,7 @@ export interface PaginatedResult extends Result { * @category `resources/list` */ export interface ListResourcesRequest extends PaginatedRequest { - method: 'resources/list'; + method: "resources/list"; } /** @@ -945,7 +957,7 @@ export interface ListResourcesRequest extends PaginatedRequest { * @category `resources/list` */ export interface ListResourcesResult extends PaginatedResult { - resources: Resource[]; + resources: Resource[]; } /** @@ -957,7 +969,7 @@ export interface ListResourcesResult extends PaginatedResult { * @category `resources/list` */ export interface ListResourcesResultResponse extends JSONRPCResultResponse { - result: ListResourcesResult; + result: ListResourcesResult; } /** @@ -969,7 +981,7 @@ export interface ListResourcesResultResponse extends JSONRPCResultResponse { * @category `resources/templates/list` */ export interface ListResourceTemplatesRequest extends PaginatedRequest { - method: 'resources/templates/list'; + method: "resources/templates/list"; } /** @@ -981,7 +993,7 @@ export interface ListResourceTemplatesRequest extends PaginatedRequest { * @category `resources/templates/list` */ export interface ListResourceTemplatesResult extends PaginatedResult { - resourceTemplates: ResourceTemplate[]; + resourceTemplates: ResourceTemplate[]; } /** @@ -993,7 +1005,7 @@ export interface ListResourceTemplatesResult extends PaginatedResult { * @category `resources/templates/list` */ export interface ListResourceTemplatesResultResponse extends JSONRPCResultResponse { - result: ListResourceTemplatesResult; + result: ListResourceTemplatesResult; } /** @@ -1002,12 +1014,12 @@ export interface ListResourceTemplatesResultResponse extends JSONRPCResultRespon * @internal */ export interface ResourceRequestParams extends RequestParams { - /** - * The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it. - * - * @format uri - */ - uri: string; + /** + * The URI of the resource. The URI can use any protocol; it is up to the server how to interpret it. + * + * @format uri + */ + uri: string; } /** @@ -1027,8 +1039,8 @@ export interface ReadResourceRequestParams extends ResourceRequestParams {} * @category `resources/read` */ export interface ReadResourceRequest extends JSONRPCRequest { - method: 'resources/read'; - params: ReadResourceRequestParams; + method: "resources/read"; + params: ReadResourceRequestParams; } /** @@ -1040,7 +1052,7 @@ export interface ReadResourceRequest extends JSONRPCRequest { * @category `resources/read` */ export interface ReadResourceResult extends Result { - contents: (TextResourceContents | BlobResourceContents)[]; + contents: (TextResourceContents | BlobResourceContents)[]; } /** @@ -1052,7 +1064,7 @@ export interface ReadResourceResult extends Result { * @category `resources/read` */ export interface ReadResourceResultResponse extends JSONRPCResultResponse { - result: ReadResourceResult; + result: ReadResourceResult; } /** @@ -1064,8 +1076,8 @@ export interface ReadResourceResultResponse extends JSONRPCResultResponse { * @category `notifications/resources/list_changed` */ export interface ResourceListChangedNotification extends JSONRPCNotification { - method: 'notifications/resources/list_changed'; - params?: NotificationParams; + method: "notifications/resources/list_changed"; + params?: NotificationParams; } /** @@ -1088,8 +1100,8 @@ export interface SubscribeRequestParams extends ResourceRequestParams {} * @category `resources/subscribe` */ export interface SubscribeRequest extends JSONRPCRequest { - method: 'resources/subscribe'; - params: SubscribeRequestParams; + method: "resources/subscribe"; + params: SubscribeRequestParams; } /** @@ -1101,7 +1113,7 @@ export interface SubscribeRequest extends JSONRPCRequest { * @category `resources/subscribe` */ export interface SubscribeResultResponse extends JSONRPCResultResponse { - result: EmptyResult; + result: EmptyResult; } /** @@ -1121,8 +1133,8 @@ export interface UnsubscribeRequestParams extends ResourceRequestParams {} * @category `resources/unsubscribe` */ export interface UnsubscribeRequest extends JSONRPCRequest { - method: 'resources/unsubscribe'; - params: UnsubscribeRequestParams; + method: "resources/unsubscribe"; + params: UnsubscribeRequestParams; } /** @@ -1134,7 +1146,7 @@ export interface UnsubscribeRequest extends JSONRPCRequest { * @category `resources/unsubscribe` */ export interface UnsubscribeResultResponse extends JSONRPCResultResponse { - result: EmptyResult; + result: EmptyResult; } /** @@ -1146,12 +1158,12 @@ export interface UnsubscribeResultResponse extends JSONRPCResultResponse { * @category `notifications/resources/updated` */ export interface ResourceUpdatedNotificationParams extends NotificationParams { - /** - * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. - * - * @format uri - */ - uri: string; + /** + * The URI of the resource that has been updated. This might be a sub-resource of the one that the client actually subscribed to. + * + * @format uri + */ + uri: string; } /** @@ -1163,8 +1175,8 @@ export interface ResourceUpdatedNotificationParams extends NotificationParams { * @category `notifications/resources/updated` */ export interface ResourceUpdatedNotification extends JSONRPCNotification { - method: 'notifications/resources/updated'; - params: ResourceUpdatedNotificationParams; + method: "notifications/resources/updated"; + params: ResourceUpdatedNotificationParams; } /** @@ -1176,38 +1188,38 @@ export interface ResourceUpdatedNotification extends JSONRPCNotification { * @category `resources/list` */ export interface Resource extends BaseMetadata, Icons { - /** - * The URI of this resource. - * - * @format uri - */ - uri: string; + /** + * The URI of this resource. + * + * @format uri + */ + uri: string; - /** - * A description of what this resource represents. - * - * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. - */ - description?: string; + /** + * A description of what this resource represents. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description?: string; - /** - * The MIME type of this resource, if known. - */ - mimeType?: string; + /** + * The MIME type of this resource, if known. + */ + mimeType?: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; + /** + * Optional annotations for the client. + */ + annotations?: Annotations; - /** - * The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known. - * - * This can be used by Hosts to display file sizes and estimate context window usage. - */ - size?: number; + /** + * The size of the raw resource content, in bytes (i.e., before base64 encoding or any tokenization), if known. + * + * This can be used by Hosts to display file sizes and estimate context window usage. + */ + size?: number; - _meta?: MetaObject; + _meta?: MetaObject; } /** @@ -1216,31 +1228,31 @@ export interface Resource extends BaseMetadata, Icons { * @category `resources/templates/list` */ export interface ResourceTemplate extends BaseMetadata, Icons { - /** - * A URI template (according to RFC 6570) that can be used to construct resource URIs. - * - * @format uri-template - */ - uriTemplate: string; + /** + * A URI template (according to RFC 6570) that can be used to construct resource URIs. + * + * @format uri-template + */ + uriTemplate: string; - /** - * A description of what this template is for. - * - * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. - */ - description?: string; + /** + * A description of what this template is for. + * + * This can be used by clients to improve the LLM's understanding of available resources. It can be thought of like a "hint" to the model. + */ + description?: string; - /** - * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. - */ - mimeType?: string; + /** + * The MIME type for all resources that match this template. This should only be included if all resources matching this template have the same type. + */ + mimeType?: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; + /** + * Optional annotations for the client. + */ + annotations?: Annotations; - _meta?: MetaObject; + _meta?: MetaObject; } /** @@ -1249,18 +1261,18 @@ export interface ResourceTemplate extends BaseMetadata, Icons { * @internal */ export interface ResourceContents { - /** - * The URI of this resource. - * - * @format uri - */ - uri: string; - /** - * The MIME type of this resource, if known. - */ - mimeType?: string; + /** + * The URI of this resource. + * + * @format uri + */ + uri: string; + /** + * The MIME type of this resource, if known. + */ + mimeType?: string; - _meta?: MetaObject; + _meta?: MetaObject; } /** @@ -1270,10 +1282,10 @@ export interface ResourceContents { * @category Content */ export interface TextResourceContents extends ResourceContents { - /** - * The text of the item. This must only be set if the item can actually be represented as text (not binary data). - */ - text: string; + /** + * The text of the item. This must only be set if the item can actually be represented as text (not binary data). + */ + text: string; } /** @@ -1283,12 +1295,12 @@ export interface TextResourceContents extends ResourceContents { * @category Content */ export interface BlobResourceContents extends ResourceContents { - /** - * A base64-encoded string representing the binary data of the item. - * - * @format byte - */ - blob: string; + /** + * A base64-encoded string representing the binary data of the item. + * + * @format byte + */ + blob: string; } /* Prompts */ @@ -1301,7 +1313,7 @@ export interface BlobResourceContents extends ResourceContents { * @category `prompts/list` */ export interface ListPromptsRequest extends PaginatedRequest { - method: 'prompts/list'; + method: "prompts/list"; } /** @@ -1313,7 +1325,7 @@ export interface ListPromptsRequest extends PaginatedRequest { * @category `prompts/list` */ export interface ListPromptsResult extends PaginatedResult { - prompts: Prompt[]; + prompts: Prompt[]; } /** @@ -1325,7 +1337,7 @@ export interface ListPromptsResult extends PaginatedResult { * @category `prompts/list` */ export interface ListPromptsResultResponse extends JSONRPCResultResponse { - result: ListPromptsResult; + result: ListPromptsResult; } /** @@ -1337,14 +1349,14 @@ export interface ListPromptsResultResponse extends JSONRPCResultResponse { * @category `prompts/get` */ export interface GetPromptRequestParams extends RequestParams { - /** - * The name of the prompt or prompt template. - */ - name: string; - /** - * Arguments to use for templating the prompt. - */ - arguments?: { [key: string]: string }; + /** + * The name of the prompt or prompt template. + */ + name: string; + /** + * Arguments to use for templating the prompt. + */ + arguments?: { [key: string]: string }; } /** @@ -1356,8 +1368,8 @@ export interface GetPromptRequestParams extends RequestParams { * @category `prompts/get` */ export interface GetPromptRequest extends JSONRPCRequest { - method: 'prompts/get'; - params: GetPromptRequestParams; + method: "prompts/get"; + params: GetPromptRequestParams; } /** @@ -1369,11 +1381,11 @@ export interface GetPromptRequest extends JSONRPCRequest { * @category `prompts/get` */ export interface GetPromptResult extends Result { - /** - * An optional description for the prompt. - */ - description?: string; - messages: PromptMessage[]; + /** + * An optional description for the prompt. + */ + description?: string; + messages: PromptMessage[]; } /** @@ -1385,7 +1397,7 @@ export interface GetPromptResult extends Result { * @category `prompts/get` */ export interface GetPromptResultResponse extends JSONRPCResultResponse { - result: GetPromptResult; + result: GetPromptResult; } /** @@ -1394,17 +1406,17 @@ export interface GetPromptResultResponse extends JSONRPCResultResponse { * @category `prompts/list` */ export interface Prompt extends BaseMetadata, Icons { - /** - * An optional description of what this prompt provides - */ - description?: string; + /** + * An optional description of what this prompt provides + */ + description?: string; - /** - * A list of arguments to use for templating the prompt. - */ - arguments?: PromptArgument[]; + /** + * A list of arguments to use for templating the prompt. + */ + arguments?: PromptArgument[]; - _meta?: MetaObject; + _meta?: MetaObject; } /** @@ -1413,14 +1425,14 @@ export interface Prompt extends BaseMetadata, Icons { * @category `prompts/list` */ export interface PromptArgument extends BaseMetadata { - /** - * A human-readable description of the argument. - */ - description?: string; - /** - * Whether this argument must be provided. - */ - required?: boolean; + /** + * A human-readable description of the argument. + */ + description?: string; + /** + * Whether this argument must be provided. + */ + required?: boolean; } /** @@ -1428,7 +1440,7 @@ export interface PromptArgument extends BaseMetadata { * * @category Common Types */ -export type Role = 'user' | 'assistant'; +export type Role = "user" | "assistant"; /** * Describes a message returned as part of a prompt. @@ -1439,8 +1451,8 @@ export type Role = 'user' | 'assistant'; * @category `prompts/get` */ export interface PromptMessage { - role: Role; - content: ContentBlock; + role: Role; + content: ContentBlock; } /** @@ -1454,7 +1466,7 @@ export interface PromptMessage { * @category Content */ export interface ResourceLink extends Resource { - type: 'resource_link'; + type: "resource_link"; } /** @@ -1469,15 +1481,15 @@ export interface ResourceLink extends Resource { * @category Content */ export interface EmbeddedResource { - type: 'resource'; - resource: TextResourceContents | BlobResourceContents; + type: "resource"; + resource: TextResourceContents | BlobResourceContents; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; + /** + * Optional annotations for the client. + */ + annotations?: Annotations; - _meta?: MetaObject; + _meta?: MetaObject; } /** * An optional notification from the server to the client, informing it that the list of prompts it offers has changed. This may be issued by servers without any previous subscription from the client. @@ -1488,8 +1500,8 @@ export interface EmbeddedResource { * @category `notifications/prompts/list_changed` */ export interface PromptListChangedNotification extends JSONRPCNotification { - method: 'notifications/prompts/list_changed'; - params?: NotificationParams; + method: "notifications/prompts/list_changed"; + params?: NotificationParams; } /* Tools */ @@ -1502,7 +1514,7 @@ export interface PromptListChangedNotification extends JSONRPCNotification { * @category `tools/list` */ export interface ListToolsRequest extends PaginatedRequest { - method: 'tools/list'; + method: "tools/list"; } /** @@ -1514,7 +1526,7 @@ export interface ListToolsRequest extends PaginatedRequest { * @category `tools/list` */ export interface ListToolsResult extends PaginatedResult { - tools: Tool[]; + tools: Tool[]; } /** @@ -1526,7 +1538,7 @@ export interface ListToolsResult extends PaginatedResult { * @category `tools/list` */ export interface ListToolsResultResponse extends JSONRPCResultResponse { - result: ListToolsResult; + result: ListToolsResult; } /** @@ -1544,31 +1556,31 @@ export interface ListToolsResultResponse extends JSONRPCResultResponse { * @category `tools/call` */ export interface CallToolResult extends Result { - /** - * A list of content objects that represent the unstructured result of the tool call. - */ - content: ContentBlock[]; - - /** - * An optional JSON object that represents the structured result of the tool call. - */ - structuredContent?: { [key: string]: unknown }; - - /** - * Whether the tool call ended in an error. - * - * If not set, this is assumed to be false (the call was successful). - * - * Any errors that originate from the tool SHOULD be reported inside the result - * object, with `isError` set to true, _not_ as an MCP protocol-level error - * response. Otherwise, the LLM would not be able to see that an error occurred - * and self-correct. - * - * However, any errors in _finding_ the tool, an error indicating that the - * server does not support tool calls, or any other exceptional conditions, - * should be reported as an MCP error response. - */ - isError?: boolean; + /** + * A list of content objects that represent the unstructured result of the tool call. + */ + content: ContentBlock[]; + + /** + * An optional JSON object that represents the structured result of the tool call. + */ + structuredContent?: { [key: string]: unknown }; + + /** + * Whether the tool call ended in an error. + * + * If not set, this is assumed to be false (the call was successful). + * + * Any errors that originate from the tool SHOULD be reported inside the result + * object, with `isError` set to true, _not_ as an MCP protocol-level error + * response. Otherwise, the LLM would not be able to see that an error occurred + * and self-correct. + * + * However, any errors in _finding_ the tool, an error indicating that the + * server does not support tool calls, or any other exceptional conditions, + * should be reported as an MCP error response. + */ + isError?: boolean; } /** @@ -1580,7 +1592,7 @@ export interface CallToolResult extends Result { * @category `tools/call` */ export interface CallToolResultResponse extends JSONRPCResultResponse { - result: CallToolResult; + result: CallToolResult; } /** @@ -1595,14 +1607,14 @@ export interface CallToolResultResponse extends JSONRPCResultResponse { * @category `tools/call` */ export interface CallToolRequestParams extends TaskAugmentedRequestParams { - /** - * The name of the tool. - */ - name: string; - /** - * Arguments to use for the tool call. - */ - arguments?: { [key: string]: unknown }; + /** + * The name of the tool. + */ + name: string; + /** + * Arguments to use for the tool call. + */ + arguments?: { [key: string]: unknown }; } /** @@ -1614,8 +1626,8 @@ export interface CallToolRequestParams extends TaskAugmentedRequestParams { * @category `tools/call` */ export interface CallToolRequest extends JSONRPCRequest { - method: 'tools/call'; - params: CallToolRequestParams; + method: "tools/call"; + params: CallToolRequestParams; } /** @@ -1627,8 +1639,8 @@ export interface CallToolRequest extends JSONRPCRequest { * @category `notifications/tools/list_changed` */ export interface ToolListChangedNotification extends JSONRPCNotification { - method: 'notifications/tools/list_changed'; - params?: NotificationParams; + method: "notifications/tools/list_changed"; + params?: NotificationParams; } /** @@ -1644,47 +1656,47 @@ export interface ToolListChangedNotification extends JSONRPCNotification { * @category `tools/list` */ export interface ToolAnnotations { - /** - * A human-readable title for the tool. - */ - title?: string; - - /** - * If true, the tool does not modify its environment. - * - * Default: false - */ - readOnlyHint?: boolean; - - /** - * If true, the tool may perform destructive updates to its environment. - * If false, the tool performs only additive updates. - * - * (This property is meaningful only when `readOnlyHint == false`) - * - * Default: true - */ - destructiveHint?: boolean; - - /** - * If true, calling the tool repeatedly with the same arguments - * will have no additional effect on its environment. - * - * (This property is meaningful only when `readOnlyHint == false`) - * - * Default: false - */ - idempotentHint?: boolean; - - /** - * If true, this tool may interact with an "open world" of external - * entities. If false, the tool's domain of interaction is closed. - * For example, the world of a web search tool is open, whereas that - * of a memory tool is not. - * - * Default: true - */ - openWorldHint?: boolean; + /** + * A human-readable title for the tool. + */ + title?: string; + + /** + * If true, the tool does not modify its environment. + * + * Default: false + */ + readOnlyHint?: boolean; + + /** + * If true, the tool may perform destructive updates to its environment. + * If false, the tool performs only additive updates. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: true + */ + destructiveHint?: boolean; + + /** + * If true, calling the tool repeatedly with the same arguments + * will have no additional effect on its environment. + * + * (This property is meaningful only when `readOnlyHint == false`) + * + * Default: false + */ + idempotentHint?: boolean; + + /** + * If true, this tool may interact with an "open world" of external + * entities. If false, the tool's domain of interaction is closed. + * For example, the world of a web search tool is open, whereas that + * of a memory tool is not. + * + * Default: true + */ + openWorldHint?: boolean; } /** @@ -1693,18 +1705,18 @@ export interface ToolAnnotations { * @category `tools/list` */ export interface ToolExecution { - /** - * Indicates whether this tool supports task-augmented execution. - * This allows clients to handle long-running operations through polling - * the task system. - * - * - `"forbidden"`: Tool does not support task-augmented execution (default when absent) - * - `"optional"`: Tool may support task-augmented execution - * - `"required"`: Tool requires task-augmented execution - * - * Default: `"forbidden"` - */ - taskSupport?: 'forbidden' | 'optional' | 'required'; + /** + * Indicates whether this tool supports task-augmented execution. + * This allows clients to handle long-running operations through polling + * the task system. + * + * - `"forbidden"`: Tool does not support task-augmented execution (default when absent) + * - `"optional"`: Tool may support task-augmented execution + * - `"required"`: Tool requires task-augmented execution + * + * Default: `"forbidden"` + */ + taskSupport?: "forbidden" | "optional" | "required"; } /** @@ -1725,53 +1737,53 @@ export interface ToolExecution { * @category `tools/list` */ export interface Tool extends BaseMetadata, Icons { - /** - * A human-readable description of the tool. - * - * This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model. - */ - description?: string; + /** + * A human-readable description of the tool. + * + * This can be used by clients to improve the LLM's understanding of available tools. It can be thought of like a "hint" to the model. + */ + description?: string; + + /** + * A JSON Schema object defining the expected parameters for the tool. + */ + inputSchema: { + $schema?: string; + type: "object"; + properties?: { [key: string]: JSONValue }; + required?: string[]; + }; + + /** + * Execution-related properties for this tool. + */ + execution?: ToolExecution; + + /** + * An optional JSON Schema object defining the structure of the tool's output returned in + * the structuredContent field of a {@link CallToolResult}. + * + * Defaults to JSON Schema 2020-12 when no explicit `$schema` is provided. + * Currently restricted to `type: "object"` at the root level. + */ + outputSchema?: { + $schema?: string; + type: "object"; + properties?: { [key: string]: JSONValue }; + required?: string[]; + }; + + /** + * Optional additional tool information. + * + * Display name precedence order is: `title`, `annotations.title`, then `name`. + */ + annotations?: ToolAnnotations; + + _meta?: MetaObject; +} - /** - * A JSON Schema object defining the expected parameters for the tool. - */ - inputSchema: { - $schema?: string; - type: 'object'; - properties?: { [key: string]: JSONValue }; - required?: string[]; - }; - - /** - * Execution-related properties for this tool. - */ - execution?: ToolExecution; - - /** - * An optional JSON Schema object defining the structure of the tool's output returned in - * the structuredContent field of a {@link CallToolResult}. - * - * Defaults to JSON Schema 2020-12 when no explicit `$schema` is provided. - * Currently restricted to `type: "object"` at the root level. - */ - outputSchema?: { - $schema?: string; - type: 'object'; - properties?: { [key: string]: JSONValue }; - required?: string[]; - }; - - /** - * Optional additional tool information. - * - * Display name precedence order is: `title`, `annotations.title`, then `name`. - */ - annotations?: ToolAnnotations; - - _meta?: MetaObject; -} - -/* Tasks */ +/* Tasks */ /** * The status of a task. @@ -1779,11 +1791,11 @@ export interface Tool extends BaseMetadata, Icons { * @category `tasks` */ export type TaskStatus = - | 'working' // The request is currently being processed - | 'input_required' // The task is waiting for input (e.g., elicitation or sampling) - | 'completed' // The request completed successfully and results are available - | 'failed' // The associated request did not complete successfully. For tool calls specifically, this includes cases where the tool call result has `isError` set to true. - | 'cancelled'; // The request was cancelled before completion + | "working" // The request is currently being processed + | "input_required" // The task is waiting for input (e.g., elicitation or sampling) + | "completed" // The request completed successfully and results are available + | "failed" // The associated request did not complete successfully. For tool calls specifically, this includes cases where the tool call result has `isError` set to true. + | "cancelled"; // The request was cancelled before completion /** * Metadata for augmenting a request with task execution. @@ -1792,10 +1804,10 @@ export type TaskStatus = * @category `tasks` */ export interface TaskMetadata { - /** - * Requested duration in milliseconds to retain task from creation. - */ - ttl?: number; + /** + * Requested duration in milliseconds to retain task from creation. + */ + ttl?: number; } /** @@ -1805,10 +1817,10 @@ export interface TaskMetadata { * @category `tasks` */ export interface RelatedTaskMetadata { - /** - * The task identifier this message is associated with. - */ - taskId: string; + /** + * The task identifier this message is associated with. + */ + taskId: string; } /** @@ -1817,44 +1829,44 @@ export interface RelatedTaskMetadata { * @category `tasks` */ export interface Task { - /** - * The task identifier. - */ - taskId: string; - - /** - * Current task state. - */ - status: TaskStatus; - - /** - * Optional human-readable message describing the current task state. - * This can provide context for any status, including: - * - Reasons for "cancelled" status - * - Summaries for "completed" status - * - Diagnostic information for "failed" status (e.g., error details, what went wrong) - */ - statusMessage?: string; - - /** - * ISO 8601 timestamp when the task was created. - */ - createdAt: string; - - /** - * ISO 8601 timestamp when the task was last updated. - */ - lastUpdatedAt: string; - - /** - * Actual retention duration from creation in milliseconds, null for unlimited. - */ - ttl: number | null; - - /** - * Suggested polling interval in milliseconds. - */ - pollInterval?: number; + /** + * The task identifier. + */ + taskId: string; + + /** + * Current task state. + */ + status: TaskStatus; + + /** + * Optional human-readable message describing the current task state. + * This can provide context for any status, including: + * - Reasons for "cancelled" status + * - Summaries for "completed" status + * - Diagnostic information for "failed" status (e.g., error details, what went wrong) + */ + statusMessage?: string; + + /** + * ISO 8601 timestamp when the task was created. + */ + createdAt: string; + + /** + * ISO 8601 timestamp when the task was last updated. + */ + lastUpdatedAt: string; + + /** + * Actual retention duration from creation in milliseconds, null for unlimited. + */ + ttl: number | null; + + /** + * Suggested polling interval in milliseconds. + */ + pollInterval?: number; } /** @@ -1863,7 +1875,7 @@ export interface Task { * @category `tasks` */ export interface CreateTaskResult extends Result { - task: Task; + task: Task; } /** @@ -1872,7 +1884,7 @@ export interface CreateTaskResult extends Result { * @category `tasks` */ export interface CreateTaskResultResponse extends JSONRPCResultResponse { - result: CreateTaskResult; + result: CreateTaskResult; } /** @@ -1881,13 +1893,13 @@ export interface CreateTaskResultResponse extends JSONRPCResultResponse { * @category `tasks/get` */ export interface GetTaskRequest extends JSONRPCRequest { - method: 'tasks/get'; - params: { - /** - * The task identifier to query. - */ - taskId: string; - }; + method: "tasks/get"; + params: { + /** + * The task identifier to query. + */ + taskId: string; + }; } /** @@ -1903,7 +1915,7 @@ export type GetTaskResult = Result & Task; * @category `tasks/get` */ export interface GetTaskResultResponse extends JSONRPCResultResponse { - result: GetTaskResult; + result: GetTaskResult; } /** @@ -1912,13 +1924,13 @@ export interface GetTaskResultResponse extends JSONRPCResultResponse { * @category `tasks/result` */ export interface GetTaskPayloadRequest extends JSONRPCRequest { - method: 'tasks/result'; - params: { - /** - * The task identifier to retrieve results for. - */ - taskId: string; - }; + method: "tasks/result"; + params: { + /** + * The task identifier to retrieve results for. + */ + taskId: string; + }; } /** @@ -1929,7 +1941,7 @@ export interface GetTaskPayloadRequest extends JSONRPCRequest { * @category `tasks/result` */ export interface GetTaskPayloadResult extends Result { - [key: string]: unknown; + [key: string]: unknown; } /** @@ -1938,7 +1950,7 @@ export interface GetTaskPayloadResult extends Result { * @category `tasks/result` */ export interface GetTaskPayloadResultResponse extends JSONRPCResultResponse { - result: GetTaskPayloadResult; + result: GetTaskPayloadResult; } /** @@ -1947,13 +1959,13 @@ export interface GetTaskPayloadResultResponse extends JSONRPCResultResponse { * @category `tasks/cancel` */ export interface CancelTaskRequest extends JSONRPCRequest { - method: 'tasks/cancel'; - params: { - /** - * The task identifier to cancel. - */ - taskId: string; - }; + method: "tasks/cancel"; + params: { + /** + * The task identifier to cancel. + */ + taskId: string; + }; } /** @@ -1969,7 +1981,7 @@ export type CancelTaskResult = Result & Task; * @category `tasks/cancel` */ export interface CancelTaskResultResponse extends JSONRPCResultResponse { - result: CancelTaskResult; + result: CancelTaskResult; } /** @@ -1978,7 +1990,7 @@ export interface CancelTaskResultResponse extends JSONRPCResultResponse { * @category `tasks/list` */ export interface ListTasksRequest extends PaginatedRequest { - method: 'tasks/list'; + method: "tasks/list"; } /** @@ -1987,7 +1999,7 @@ export interface ListTasksRequest extends PaginatedRequest { * @category `tasks/list` */ export interface ListTasksResult extends PaginatedResult { - tasks: Task[]; + tasks: Task[]; } /** @@ -1996,7 +2008,7 @@ export interface ListTasksResult extends PaginatedResult { * @category `tasks/list` */ export interface ListTasksResultResponse extends JSONRPCResultResponse { - result: ListTasksResult; + result: ListTasksResult; } /** @@ -2012,8 +2024,8 @@ export type TaskStatusNotificationParams = NotificationParams & Task; * @category `notifications/tasks/status` */ export interface TaskStatusNotification extends JSONRPCNotification { - method: 'notifications/tasks/status'; - params: TaskStatusNotificationParams; + method: "notifications/tasks/status"; + params: TaskStatusNotificationParams; } /* Logging */ @@ -2027,10 +2039,10 @@ export interface TaskStatusNotification extends JSONRPCNotification { * @category `logging/setLevel` */ export interface SetLevelRequestParams extends RequestParams { - /** - * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as {@link LoggingMessageNotification | notifications/message}. - */ - level: LoggingLevel; + /** + * The level of logging that the client wants to receive from the server. The server should send all logs at this level and higher (i.e., more severe) to the client as {@link LoggingMessageNotification | notifications/message}. + */ + level: LoggingLevel; } /** @@ -2042,8 +2054,8 @@ export interface SetLevelRequestParams extends RequestParams { * @category `logging/setLevel` */ export interface SetLevelRequest extends JSONRPCRequest { - method: 'logging/setLevel'; - params: SetLevelRequestParams; + method: "logging/setLevel"; + params: SetLevelRequestParams; } /** @@ -2055,7 +2067,7 @@ export interface SetLevelRequest extends JSONRPCRequest { * @category `logging/setLevel` */ export interface SetLevelResultResponse extends JSONRPCResultResponse { - result: EmptyResult; + result: EmptyResult; } /** @@ -2067,18 +2079,18 @@ export interface SetLevelResultResponse extends JSONRPCResultResponse { * @category `notifications/message` */ export interface LoggingMessageNotificationParams extends NotificationParams { - /** - * The severity of this log message. - */ - level: LoggingLevel; - /** - * An optional name of the logger issuing this message. - */ - logger?: string; - /** - * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. - */ - data: unknown; + /** + * The severity of this log message. + */ + level: LoggingLevel; + /** + * An optional name of the logger issuing this message. + */ + logger?: string; + /** + * The data to be logged, such as a string message or an object. Any JSON serializable type is allowed here. + */ + data: unknown; } /** @@ -2090,8 +2102,8 @@ export interface LoggingMessageNotificationParams extends NotificationParams { * @category `notifications/message` */ export interface LoggingMessageNotification extends JSONRPCNotification { - method: 'notifications/message'; - params: LoggingMessageNotificationParams; + method: "notifications/message"; + params: LoggingMessageNotificationParams; } /** @@ -2102,7 +2114,15 @@ export interface LoggingMessageNotification extends JSONRPCNotification { * * @category Common Types */ -export type LoggingLevel = 'debug' | 'info' | 'notice' | 'warning' | 'error' | 'critical' | 'alert' | 'emergency'; +export type LoggingLevel = + | "debug" + | "info" + | "notice" + | "warning" + | "error" + | "critical" + | "alert" + | "emergency"; /* Sampling */ /** @@ -2120,49 +2140,49 @@ export type LoggingLevel = 'debug' | 'info' | 'notice' | 'warning' | 'error' | ' * @category `sampling/createMessage` */ export interface CreateMessageRequestParams extends TaskAugmentedRequestParams { - messages: SamplingMessage[]; - /** - * The server's preferences for which model to select. The client MAY ignore these preferences. - */ - modelPreferences?: ModelPreferences; - /** - * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. - */ - systemPrompt?: string; - /** - * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. - * The client MAY ignore this request. - * - * Default is `"none"`. Values `"thisServer"` and `"allServers"` are soft-deprecated. Servers SHOULD only use these values if the client - * declares {@link ClientCapabilities.sampling.context}. These values may be removed in future spec releases. - */ - includeContext?: 'none' | 'thisServer' | 'allServers'; - /** - * @TJS-type number - */ - temperature?: number; - /** - * The requested maximum number of tokens to sample (to prevent runaway completions). - * - * The client MAY choose to sample fewer tokens than the requested maximum. - */ - maxTokens: number; - stopSequences?: string[]; - /** - * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. - */ - metadata?: JSONObject; - /** - * Tools that the model may use during generation. - * The client MUST return an error if this field is provided but {@link ClientCapabilities.sampling.tools} is not declared. - */ - tools?: Tool[]; - /** - * Controls how the model uses tools. - * The client MUST return an error if this field is provided but {@link ClientCapabilities.sampling.tools} is not declared. - * Default is `{ mode: "auto" }`. - */ - toolChoice?: ToolChoice; + messages: SamplingMessage[]; + /** + * The server's preferences for which model to select. The client MAY ignore these preferences. + */ + modelPreferences?: ModelPreferences; + /** + * An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt. + */ + systemPrompt?: string; + /** + * A request to include context from one or more MCP servers (including the caller), to be attached to the prompt. + * The client MAY ignore this request. + * + * Default is `"none"`. Values `"thisServer"` and `"allServers"` are soft-deprecated. Servers SHOULD only use these values if the client + * declares {@link ClientCapabilities.sampling.context}. These values may be removed in future spec releases. + */ + includeContext?: "none" | "thisServer" | "allServers"; + /** + * @TJS-type number + */ + temperature?: number; + /** + * The requested maximum number of tokens to sample (to prevent runaway completions). + * + * The client MAY choose to sample fewer tokens than the requested maximum. + */ + maxTokens: number; + stopSequences?: string[]; + /** + * Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific. + */ + metadata?: JSONObject; + /** + * Tools that the model may use during generation. + * The client MUST return an error if this field is provided but {@link ClientCapabilities.sampling.tools} is not declared. + */ + tools?: Tool[]; + /** + * Controls how the model uses tools. + * The client MUST return an error if this field is provided but {@link ClientCapabilities.sampling.tools} is not declared. + * Default is `{ mode: "auto" }`. + */ + toolChoice?: ToolChoice; } /** @@ -2171,13 +2191,13 @@ export interface CreateMessageRequestParams extends TaskAugmentedRequestParams { * @category `sampling/createMessage` */ export interface ToolChoice { - /** - * Controls the tool use ability of the model: - * - `"auto"`: Model decides whether to use tools (default) - * - `"required"`: Model MUST use at least one tool before completing - * - `"none"`: Model MUST NOT use any tools - */ - mode?: 'auto' | 'required' | 'none'; + /** + * Controls the tool use ability of the model: + * - `"auto"`: Model decides whether to use tools (default) + * - `"required"`: Model MUST use at least one tool before completing + * - `"none"`: Model MUST NOT use any tools + */ + mode?: "auto" | "required" | "none"; } /** @@ -2189,8 +2209,8 @@ export interface ToolChoice { * @category `sampling/createMessage` */ export interface CreateMessageRequest extends JSONRPCRequest { - method: 'sampling/createMessage'; - params: CreateMessageRequestParams; + method: "sampling/createMessage"; + params: CreateMessageRequestParams; } /** @@ -2210,23 +2230,23 @@ export interface CreateMessageRequest extends JSONRPCRequest { * @category `sampling/createMessage` */ export interface CreateMessageResult extends Result, SamplingMessage { - /** - * The name of the model that generated the message. - */ - model: string; - - /** - * The reason why sampling stopped, if known. - * - * Standard values: - * - `"endTurn"`: Natural end of the assistant's turn - * - `"stopSequence"`: A stop sequence was encountered - * - `"maxTokens"`: Maximum token limit was reached - * - `"toolUse"`: The model wants to use one or more tools - * - * This field is an open string to allow for provider-specific stop reasons. - */ - stopReason?: 'endTurn' | 'stopSequence' | 'maxTokens' | 'toolUse' | string; + /** + * The name of the model that generated the message. + */ + model: string; + + /** + * The reason why sampling stopped, if known. + * + * Standard values: + * - `"endTurn"`: Natural end of the assistant's turn + * - `"stopSequence"`: A stop sequence was encountered + * - `"maxTokens"`: Maximum token limit was reached + * - `"toolUse"`: The model wants to use one or more tools + * + * This field is an open string to allow for provider-specific stop reasons. + */ + stopReason?: "endTurn" | "stopSequence" | "maxTokens" | "toolUse" | string; } /** @@ -2238,7 +2258,7 @@ export interface CreateMessageResult extends Result, SamplingMessage { * @category `sampling/createMessage` */ export interface CreateMessageResultResponse extends JSONRPCResultResponse { - result: CreateMessageResult; + result: CreateMessageResult; } /** @@ -2253,15 +2273,20 @@ export interface CreateMessageResultResponse extends JSONRPCResultResponse { * @category `sampling/createMessage` */ export interface SamplingMessage { - role: Role; - content: SamplingMessageContentBlock | SamplingMessageContentBlock[]; - _meta?: MetaObject; + role: Role; + content: SamplingMessageContentBlock | SamplingMessageContentBlock[]; + _meta?: MetaObject; } /** * @category `sampling/createMessage` */ -export type SamplingMessageContentBlock = TextContent | ImageContent | AudioContent | ToolUseContent | ToolResultContent; +export type SamplingMessageContentBlock = + | TextContent + | ImageContent + | AudioContent + | ToolUseContent + | ToolResultContent; /** * Optional annotations for the client. The client can use annotations to inform how objects are used or displayed @@ -2269,41 +2294,46 @@ export type SamplingMessageContentBlock = TextContent | ImageContent | AudioCont * @category Common Types */ export interface Annotations { - /** - * Describes who the intended audience of this object or data is. - * - * It can include multiple entries to indicate content useful for multiple audiences (e.g., `["user", "assistant"]`). - */ - audience?: Role[]; - - /** - * Describes how important this data is for operating the server. - * - * A value of 1 means "most important," and indicates that the data is - * effectively required, while 0 means "least important," and indicates that - * the data is entirely optional. - * - * @TJS-type number - * @minimum 0 - * @maximum 1 - */ - priority?: number; - - /** - * The moment the resource was last modified, as an ISO 8601 formatted string. - * - * Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z"). - * - * Examples: last activity timestamp in an open file, timestamp when the resource - * was attached, etc. - */ - lastModified?: string; + /** + * Describes who the intended audience of this object or data is. + * + * It can include multiple entries to indicate content useful for multiple audiences (e.g., `["user", "assistant"]`). + */ + audience?: Role[]; + + /** + * Describes how important this data is for operating the server. + * + * A value of 1 means "most important," and indicates that the data is + * effectively required, while 0 means "least important," and indicates that + * the data is entirely optional. + * + * @TJS-type number + * @minimum 0 + * @maximum 1 + */ + priority?: number; + + /** + * The moment the resource was last modified, as an ISO 8601 formatted string. + * + * Should be an ISO 8601 formatted string (e.g., "2025-01-12T15:00:58Z"). + * + * Examples: last activity timestamp in an open file, timestamp when the resource + * was attached, etc. + */ + lastModified?: string; } /** * @category Content */ -export type ContentBlock = TextContent | ImageContent | AudioContent | ResourceLink | EmbeddedResource; +export type ContentBlock = + | TextContent + | ImageContent + | AudioContent + | ResourceLink + | EmbeddedResource; /** * Text provided to or from an LLM. @@ -2314,19 +2344,19 @@ export type ContentBlock = TextContent | ImageContent | AudioContent | ResourceL * @category Content */ export interface TextContent { - type: 'text'; + type: "text"; - /** - * The text content of the message. - */ - text: string; + /** + * The text content of the message. + */ + text: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; + /** + * Optional annotations for the client. + */ + annotations?: Annotations; - _meta?: MetaObject; + _meta?: MetaObject; } /** @@ -2338,26 +2368,26 @@ export interface TextContent { * @category Content */ export interface ImageContent { - type: 'image'; + type: "image"; - /** - * The base64-encoded image data. - * - * @format byte - */ - data: string; + /** + * The base64-encoded image data. + * + * @format byte + */ + data: string; - /** - * The MIME type of the image. Different providers may support different image types. - */ - mimeType: string; + /** + * The MIME type of the image. Different providers may support different image types. + */ + mimeType: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; + /** + * Optional annotations for the client. + */ + annotations?: Annotations; - _meta?: MetaObject; + _meta?: MetaObject; } /** @@ -2369,26 +2399,26 @@ export interface ImageContent { * @category Content */ export interface AudioContent { - type: 'audio'; + type: "audio"; - /** - * The base64-encoded audio data. - * - * @format byte - */ - data: string; + /** + * The base64-encoded audio data. + * + * @format byte + */ + data: string; - /** - * The MIME type of the audio. Different providers may support different audio types. - */ - mimeType: string; + /** + * The MIME type of the audio. Different providers may support different audio types. + */ + mimeType: string; - /** - * Optional annotations for the client. - */ - annotations?: Annotations; + /** + * Optional annotations for the client. + */ + annotations?: Annotations; - _meta?: MetaObject; + _meta?: MetaObject; } /** @@ -2400,30 +2430,30 @@ export interface AudioContent { * @category `sampling/createMessage` */ export interface ToolUseContent { - type: 'tool_use'; + type: "tool_use"; - /** - * A unique identifier for this tool use. - * - * This ID is used to match tool results to their corresponding tool uses. - */ - id: string; + /** + * A unique identifier for this tool use. + * + * This ID is used to match tool results to their corresponding tool uses. + */ + id: string; - /** - * The name of the tool to call. - */ - name: string; + /** + * The name of the tool to call. + */ + name: string; - /** - * The arguments to pass to the tool, conforming to the tool's input schema. - */ - input: { [key: string]: unknown }; + /** + * The arguments to pass to the tool, conforming to the tool's input schema. + */ + input: { [key: string]: unknown }; - /** - * Optional metadata about the tool use. Clients SHOULD preserve this field when - * including tool uses in subsequent sampling requests to enable caching optimizations. - */ - _meta?: MetaObject; + /** + * Optional metadata about the tool use. Clients SHOULD preserve this field when + * including tool uses in subsequent sampling requests to enable caching optimizations. + */ + _meta?: MetaObject; } /** @@ -2435,43 +2465,43 @@ export interface ToolUseContent { * @category `sampling/createMessage` */ export interface ToolResultContent { - type: 'tool_result'; - - /** - * The ID of the tool use this result corresponds to. - * - * This MUST match the ID from a previous {@link ToolUseContent}. - */ - toolUseId: string; - - /** - * The unstructured result content of the tool use. - * - * This has the same format as {@link CallToolResult.content} and can include text, images, - * audio, resource links, and embedded resources. - */ - content: ContentBlock[]; - - /** - * An optional structured result object. - * - * If the tool defined an {@link Tool.outputSchema}, this SHOULD conform to that schema. - */ - structuredContent?: { [key: string]: unknown }; - - /** - * Whether the tool use resulted in an error. - * - * If true, the content typically describes the error that occurred. - * Default: false - */ - isError?: boolean; - - /** - * Optional metadata about the tool result. Clients SHOULD preserve this field when - * including tool results in subsequent sampling requests to enable caching optimizations. - */ - _meta?: MetaObject; + type: "tool_result"; + + /** + * The ID of the tool use this result corresponds to. + * + * This MUST match the ID from a previous {@link ToolUseContent}. + */ + toolUseId: string; + + /** + * The unstructured result content of the tool use. + * + * This has the same format as {@link CallToolResult.content} and can include text, images, + * audio, resource links, and embedded resources. + */ + content: ContentBlock[]; + + /** + * An optional structured result object. + * + * If the tool defined an {@link Tool.outputSchema}, this SHOULD conform to that schema. + */ + structuredContent?: { [key: string]: unknown }; + + /** + * Whether the tool use resulted in an error. + * + * If true, the content typically describes the error that occurred. + * Default: false + */ + isError?: boolean; + + /** + * Optional metadata about the tool result. Clients SHOULD preserve this field when + * including tool results in subsequent sampling requests to enable caching optimizations. + */ + _meta?: MetaObject; } /** @@ -2493,49 +2523,49 @@ export interface ToolResultContent { * @category `sampling/createMessage` */ export interface ModelPreferences { - /** - * Optional hints to use for model selection. - * - * If multiple hints are specified, the client MUST evaluate them in order - * (such that the first match is taken). - * - * The client SHOULD prioritize these hints over the numeric priorities, but - * MAY still use the priorities to select from ambiguous matches. - */ - hints?: ModelHint[]; - - /** - * How much to prioritize cost when selecting a model. A value of 0 means cost - * is not important, while a value of 1 means cost is the most important - * factor. - * - * @TJS-type number - * @minimum 0 - * @maximum 1 - */ - costPriority?: number; - - /** - * How much to prioritize sampling speed (latency) when selecting a model. A - * value of 0 means speed is not important, while a value of 1 means speed is - * the most important factor. - * - * @TJS-type number - * @minimum 0 - * @maximum 1 - */ - speedPriority?: number; - - /** - * How much to prioritize intelligence and capabilities when selecting a - * model. A value of 0 means intelligence is not important, while a value of 1 - * means intelligence is the most important factor. - * - * @TJS-type number - * @minimum 0 - * @maximum 1 - */ - intelligencePriority?: number; + /** + * Optional hints to use for model selection. + * + * If multiple hints are specified, the client MUST evaluate them in order + * (such that the first match is taken). + * + * The client SHOULD prioritize these hints over the numeric priorities, but + * MAY still use the priorities to select from ambiguous matches. + */ + hints?: ModelHint[]; + + /** + * How much to prioritize cost when selecting a model. A value of 0 means cost + * is not important, while a value of 1 means cost is the most important + * factor. + * + * @TJS-type number + * @minimum 0 + * @maximum 1 + */ + costPriority?: number; + + /** + * How much to prioritize sampling speed (latency) when selecting a model. A + * value of 0 means speed is not important, while a value of 1 means speed is + * the most important factor. + * + * @TJS-type number + * @minimum 0 + * @maximum 1 + */ + speedPriority?: number; + + /** + * How much to prioritize intelligence and capabilities when selecting a + * model. A value of 0 means intelligence is not important, while a value of 1 + * means intelligence is the most important factor. + * + * @TJS-type number + * @minimum 0 + * @maximum 1 + */ + intelligencePriority?: number; } /** @@ -2547,18 +2577,18 @@ export interface ModelPreferences { * @category `sampling/createMessage` */ export interface ModelHint { - /** - * A hint for a model name. - * - * The client SHOULD treat this as a substring of a model name; for example: - * - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022` - * - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc. - * - `claude` should match any Claude model - * - * The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example: - * - `gemini-1.5-flash` could match `claude-3-haiku-20240307` - */ - name?: string; + /** + * A hint for a model name. + * + * The client SHOULD treat this as a substring of a model name; for example: + * - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022` + * - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc. + * - `claude` should match any Claude model + * + * The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example: + * - `gemini-1.5-flash` could match `claude-3-haiku-20240307` + */ + name?: string; } /* Autocomplete */ @@ -2574,30 +2604,30 @@ export interface ModelHint { * {@includeCode ./examples/CompleteRequestParams/prompt-argument-completion-with-context.json} */ export interface CompleteRequestParams extends RequestParams { - ref: PromptReference | ResourceTemplateReference; + ref: PromptReference | ResourceTemplateReference; + /** + * The argument's information + */ + argument: { /** - * The argument's information + * The name of the argument */ - argument: { - /** - * The name of the argument - */ - name: string; - /** - * The value of the argument to use for completion matching. - */ - value: string; - }; + name: string; + /** + * The value of the argument to use for completion matching. + */ + value: string; + }; + /** + * Additional, optional context for completions + */ + context?: { /** - * Additional, optional context for completions + * Previously-resolved variables in a URI template or prompt. */ - context?: { - /** - * Previously-resolved variables in a URI template or prompt. - */ - arguments?: { [key: string]: string }; - }; + arguments?: { [key: string]: string }; + }; } /** @@ -2609,8 +2639,8 @@ export interface CompleteRequestParams extends RequestParams { * @category `completion/complete` */ export interface CompleteRequest extends JSONRPCRequest { - method: 'completion/complete'; - params: CompleteRequestParams; + method: "completion/complete"; + params: CompleteRequestParams; } /** @@ -2625,20 +2655,22 @@ export interface CompleteRequest extends JSONRPCRequest { * {@includeCode ./examples/CompleteResult/multiple-completion-values-with-more-available.json} */ export interface CompleteResult extends Result { - completion: { - /** - * An array of completion values. Must not exceed 100 items. - */ - values: string[]; - /** - * The total number of completion options available. This can exceed the number of values actually sent in the response. - */ - total?: number; - /** - * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. - */ - hasMore?: boolean; - }; + completion: { + /** + * An array of completion values. Must not exceed 100 items. + * + * @maxItems 100 + */ + values: string[]; + /** + * The total number of completion options available. This can exceed the number of values actually sent in the response. + */ + total?: number; + /** + * Indicates whether there are additional completion options beyond those provided in the current response, even if the exact total is unknown. + */ + hasMore?: boolean; + }; } /** @@ -2650,7 +2682,7 @@ export interface CompleteResult extends Result { * @category `completion/complete` */ export interface CompleteResultResponse extends JSONRPCResultResponse { - result: CompleteResult; + result: CompleteResult; } /** @@ -2659,13 +2691,13 @@ export interface CompleteResultResponse extends JSONRPCResultResponse { * @category `completion/complete` */ export interface ResourceTemplateReference { - type: 'ref/resource'; - /** - * The URI or URI template of the resource. - * - * @format uri-template - */ - uri: string; + type: "ref/resource"; + /** + * The URI or URI template of the resource. + * + * @format uri-template + */ + uri: string; } /** @@ -2674,7 +2706,7 @@ export interface ResourceTemplateReference { * @category `completion/complete` */ export interface PromptReference extends BaseMetadata { - type: 'ref/prompt'; + type: "ref/prompt"; } /* Roots */ @@ -2693,8 +2725,8 @@ export interface PromptReference extends BaseMetadata { * @category `roots/list` */ export interface ListRootsRequest extends JSONRPCRequest { - method: 'roots/list'; - params?: RequestParams; + method: "roots/list"; + params?: RequestParams; } /** @@ -2711,7 +2743,7 @@ export interface ListRootsRequest extends JSONRPCRequest { * @category `roots/list` */ export interface ListRootsResult extends Result { - roots: Root[]; + roots: Root[]; } /** @@ -2723,7 +2755,7 @@ export interface ListRootsResult extends Result { * @category `roots/list` */ export interface ListRootsResultResponse extends JSONRPCResultResponse { - result: ListRootsResult; + result: ListRootsResult; } /** @@ -2735,22 +2767,22 @@ export interface ListRootsResultResponse extends JSONRPCResultResponse { * @category `roots/list` */ export interface Root { - /** - * The URI identifying the root. This *must* start with `file://` for now. - * This restriction may be relaxed in future versions of the protocol to allow - * other URI schemes. - * - * @format uri - */ - uri: string; - /** - * An optional name for the root. This can be used to provide a human-readable - * identifier for the root, which may be useful for display purposes or for - * referencing the root in other parts of the application. - */ - name?: string; + /** + * The URI identifying the root. This *must* start with `file://` for now. + * This restriction may be relaxed in future versions of the protocol to allow + * other URI schemes. + * + * @format uri + */ + uri: string; + /** + * An optional name for the root. This can be used to provide a human-readable + * identifier for the root, which may be useful for display purposes or for + * referencing the root in other parts of the application. + */ + name?: string; - _meta?: MetaObject; + _meta?: MetaObject; } /** @@ -2764,8 +2796,8 @@ export interface Root { * @category `notifications/roots/list_changed` */ export interface RootsListChangedNotification extends JSONRPCNotification { - method: 'notifications/roots/list_changed'; - params?: NotificationParams; + method: "notifications/roots/list_changed"; + params?: NotificationParams; } /** @@ -2780,28 +2812,28 @@ export interface RootsListChangedNotification extends JSONRPCNotification { * @category `elicitation/create` */ export interface ElicitRequestFormParams extends TaskAugmentedRequestParams { - /** - * The elicitation mode. - */ - mode?: 'form'; - - /** - * The message to present to the user describing what information is being requested. - */ - message: string; - - /** - * A restricted subset of JSON Schema. - * Only top-level properties are allowed, without nesting. - */ - requestedSchema: { - $schema?: string; - type: 'object'; - properties: { - [key: string]: PrimitiveSchemaDefinition; - }; - required?: string[]; + /** + * The elicitation mode. + */ + mode?: "form"; + + /** + * The message to present to the user describing what information is being requested. + */ + message: string; + + /** + * A restricted subset of JSON Schema. + * Only top-level properties are allowed, without nesting. + */ + requestedSchema: { + $schema?: string; + type: "object"; + properties: { + [key: string]: PrimitiveSchemaDefinition; }; + required?: string[]; + }; } /** @@ -2813,28 +2845,28 @@ export interface ElicitRequestFormParams extends TaskAugmentedRequestParams { * @category `elicitation/create` */ export interface ElicitRequestURLParams extends TaskAugmentedRequestParams { - /** - * The elicitation mode. - */ - mode: 'url'; + /** + * The elicitation mode. + */ + mode: "url"; - /** - * The message to present to the user explaining why the interaction is needed. - */ - message: string; + /** + * The message to present to the user explaining why the interaction is needed. + */ + message: string; - /** - * The ID of the elicitation, which must be unique within the context of the server. - * The client MUST treat this ID as an opaque value. - */ - elicitationId: string; + /** + * The ID of the elicitation, which must be unique within the context of the server. + * The client MUST treat this ID as an opaque value. + */ + elicitationId: string; - /** - * The URL that the user should navigate to. - * - * @format uri - */ - url: string; + /** + * The URL that the user should navigate to. + * + * @format uri + */ + url: string; } /** @@ -2842,7 +2874,9 @@ export interface ElicitRequestURLParams extends TaskAugmentedRequestParams { * * @category `elicitation/create` */ -export type ElicitRequestParams = ElicitRequestFormParams | ElicitRequestURLParams; +export type ElicitRequestParams = + | ElicitRequestFormParams + | ElicitRequestURLParams; /** * A request from the server to elicit additional information from the user via the client. @@ -2853,8 +2887,8 @@ export type ElicitRequestParams = ElicitRequestFormParams | ElicitRequestURLPara * @category `elicitation/create` */ export interface ElicitRequest extends JSONRPCRequest { - method: 'elicitation/create'; - params: ElicitRequestParams; + method: "elicitation/create"; + params: ElicitRequestParams; } /** @@ -2863,7 +2897,11 @@ export interface ElicitRequest extends JSONRPCRequest { * * @category `elicitation/create` */ -export type PrimitiveSchemaDefinition = StringSchema | NumberSchema | BooleanSchema | EnumSchema; +export type PrimitiveSchemaDefinition = + | StringSchema + | NumberSchema + | BooleanSchema + | EnumSchema; /** * @example Email input schema @@ -2872,13 +2910,13 @@ export type PrimitiveSchemaDefinition = StringSchema | NumberSchema | BooleanSch * @category `elicitation/create` */ export interface StringSchema { - type: 'string'; - title?: string; - description?: string; - minLength?: number; - maxLength?: number; - format?: 'email' | 'uri' | 'date' | 'date-time'; - default?: string; + type: "string"; + title?: string; + description?: string; + minLength?: number; + maxLength?: number; + format?: "email" | "uri" | "date" | "date-time"; + default?: string; } /** @@ -2888,12 +2926,12 @@ export interface StringSchema { * @category `elicitation/create` */ export interface NumberSchema { - type: 'number' | 'integer'; - title?: string; - description?: string; - minimum?: number; - maximum?: number; - default?: number; + type: "number" | "integer"; + title?: string; + description?: string; + minimum?: number; + maximum?: number; + default?: number; } /** @@ -2903,10 +2941,10 @@ export interface NumberSchema { * @category `elicitation/create` */ export interface BooleanSchema { - type: 'boolean'; - title?: string; - description?: string; - default?: boolean; + type: "boolean"; + title?: string; + description?: string; + default?: boolean; } /** @@ -2918,23 +2956,23 @@ export interface BooleanSchema { * @category `elicitation/create` */ export interface UntitledSingleSelectEnumSchema { - type: 'string'; - /** - * Optional title for the enum field. - */ - title?: string; - /** - * Optional description for the enum field. - */ - description?: string; - /** - * Array of enum values to choose from. - */ - enum: string[]; - /** - * Optional default value. - */ - default?: string; + type: "string"; + /** + * Optional title for the enum field. + */ + title?: string; + /** + * Optional description for the enum field. + */ + description?: string; + /** + * Array of enum values to choose from. + */ + enum: string[]; + /** + * Optional default value. + */ + default?: string; } /** @@ -2946,39 +2984,41 @@ export interface UntitledSingleSelectEnumSchema { * @category `elicitation/create` */ export interface TitledSingleSelectEnumSchema { - type: 'string'; - /** - * Optional title for the enum field. - */ - title?: string; + type: "string"; + /** + * Optional title for the enum field. + */ + title?: string; + /** + * Optional description for the enum field. + */ + description?: string; + /** + * Array of enum options with values and display labels. + */ + oneOf: Array<{ /** - * Optional description for the enum field. + * The enum value. */ - description?: string; - /** - * Array of enum options with values and display labels. - */ - oneOf: Array<{ - /** - * The enum value. - */ - const: string; - /** - * Display label for this option. - */ - title: string; - }>; + const: string; /** - * Optional default value. + * Display label for this option. */ - default?: string; + title: string; + }>; + /** + * Optional default value. + */ + default?: string; } /** * @category `elicitation/create` */ // Combined single selection enumeration -export type SingleSelectEnumSchema = UntitledSingleSelectEnumSchema | TitledSingleSelectEnumSchema; +export type SingleSelectEnumSchema = + | UntitledSingleSelectEnumSchema + | TitledSingleSelectEnumSchema; /** * Schema for multiple-selection enumeration without display titles for options. @@ -2989,37 +3029,37 @@ export type SingleSelectEnumSchema = UntitledSingleSelectEnumSchema | TitledSing * @category `elicitation/create` */ export interface UntitledMultiSelectEnumSchema { - type: 'array'; - /** - * Optional title for the enum field. - */ - title?: string; - /** - * Optional description for the enum field. - */ - description?: string; - /** - * Minimum number of items to select. - */ - minItems?: number; - /** - * Maximum number of items to select. - */ - maxItems?: number; + type: "array"; + /** + * Optional title for the enum field. + */ + title?: string; + /** + * Optional description for the enum field. + */ + description?: string; + /** + * Minimum number of items to select. + */ + minItems?: number; + /** + * Maximum number of items to select. + */ + maxItems?: number; + /** + * Schema for the array items. + */ + items: { + type: "string"; /** - * Schema for the array items. - */ - items: { - type: 'string'; - /** - * Array of enum values to choose from. - */ - enum: string[]; - }; - /** - * Optional default value. + * Array of enum values to choose from. */ - default?: string[]; + enum: string[]; + }; + /** + * Optional default value. + */ + default?: string[]; } /** @@ -3031,52 +3071,54 @@ export interface UntitledMultiSelectEnumSchema { * @category `elicitation/create` */ export interface TitledMultiSelectEnumSchema { - type: 'array'; - /** - * Optional title for the enum field. - */ - title?: string; - /** - * Optional description for the enum field. - */ - description?: string; - /** - * Minimum number of items to select. - */ - minItems?: number; - /** - * Maximum number of items to select. - */ - maxItems?: number; - /** - * Schema for array items with enum options and display labels. - */ - items: { - /** - * Array of enum options with values and display labels. - */ - anyOf: Array<{ - /** - * The constant enum value. - */ - const: string; - /** - * Display title for this option. - */ - title: string; - }>; - }; + type: "array"; + /** + * Optional title for the enum field. + */ + title?: string; + /** + * Optional description for the enum field. + */ + description?: string; + /** + * Minimum number of items to select. + */ + minItems?: number; + /** + * Maximum number of items to select. + */ + maxItems?: number; + /** + * Schema for array items with enum options and display labels. + */ + items: { /** - * Optional default value. + * Array of enum options with values and display labels. */ - default?: string[]; + anyOf: Array<{ + /** + * The constant enum value. + */ + const: string; + /** + * Display title for this option. + */ + title: string; + }>; + }; + /** + * Optional default value. + */ + default?: string[]; } /** * @category `elicitation/create` */ // Combined multiple selection enumeration -export type MultiSelectEnumSchema = UntitledMultiSelectEnumSchema | TitledMultiSelectEnumSchema; +export type MultiSelectEnumSchema = + | UntitledMultiSelectEnumSchema + | TitledMultiSelectEnumSchema; /** * Use {@link TitledSingleSelectEnumSchema} instead. @@ -3085,23 +3127,26 @@ export type MultiSelectEnumSchema = UntitledMultiSelectEnumSchema | TitledMultiS * @category `elicitation/create` */ export interface LegacyTitledEnumSchema { - type: 'string'; - title?: string; - description?: string; - enum: string[]; - /** - * (Legacy) Display names for enum values. - * Non-standard according to JSON schema 2020-12. - */ - enumNames?: string[]; - default?: string; + type: "string"; + title?: string; + description?: string; + enum: string[]; + /** + * (Legacy) Display names for enum values. + * Non-standard according to JSON schema 2020-12. + */ + enumNames?: string[]; + default?: string; } /** * @category `elicitation/create` */ // Union type for all enum schemas -export type EnumSchema = SingleSelectEnumSchema | MultiSelectEnumSchema | LegacyTitledEnumSchema; +export type EnumSchema = + | SingleSelectEnumSchema + | MultiSelectEnumSchema + | LegacyTitledEnumSchema; /** * The result returned by the client for an {@link ElicitRequest | elicitation/create} request. @@ -3118,20 +3163,20 @@ export type EnumSchema = SingleSelectEnumSchema | MultiSelectEnumSchema | Legacy * @category `elicitation/create` */ export interface ElicitResult extends Result { - /** - * The user action in response to the elicitation. - * - `"accept"`: User submitted the form/confirmed the action - * - `"decline"`: User explicitly declined the action - * - `"cancel"`: User dismissed without making an explicit choice - */ - action: 'accept' | 'decline' | 'cancel'; + /** + * The user action in response to the elicitation. + * - `"accept"`: User submitted the form/confirmed the action + * - `"decline"`: User explicitly declined the action + * - `"cancel"`: User dismissed without making an explicit choice + */ + action: "accept" | "decline" | "cancel"; - /** - * The submitted form data, only present when action is `"accept"` and mode was `"form"`. - * Contains values matching the requested schema. - * Omitted for out-of-band mode responses. - */ - content?: { [key: string]: string | number | boolean | string[] }; + /** + * The submitted form data, only present when action is `"accept"` and mode was `"form"`. + * Contains values matching the requested schema. + * Omitted for out-of-band mode responses. + */ + content?: { [key: string]: string | number | boolean | string[] }; } /** @@ -3143,7 +3188,7 @@ export interface ElicitResult extends Result { * @category `elicitation/create` */ export interface ElicitResultResponse extends JSONRPCResultResponse { - result: ElicitResult; + result: ElicitResult; } /** @@ -3155,93 +3200,93 @@ export interface ElicitResultResponse extends JSONRPCResultResponse { * @category `notifications/elicitation/complete` */ export interface ElicitationCompleteNotification extends JSONRPCNotification { - method: 'notifications/elicitation/complete'; - params: { - /** - * The ID of the elicitation that completed. - */ - elicitationId: string; - }; + method: "notifications/elicitation/complete"; + params: { + /** + * The ID of the elicitation that completed. + */ + elicitationId: string; + }; } /* Client messages */ /** @internal */ export type ClientRequest = - | PingRequest - | InitializeRequest - | CompleteRequest - | SetLevelRequest - | GetPromptRequest - | ListPromptsRequest - | ListResourcesRequest - | ListResourceTemplatesRequest - | ReadResourceRequest - | SubscribeRequest - | UnsubscribeRequest - | CallToolRequest - | ListToolsRequest - | GetTaskRequest - | GetTaskPayloadRequest - | ListTasksRequest - | CancelTaskRequest; + | PingRequest + | InitializeRequest + | CompleteRequest + | SetLevelRequest + | GetPromptRequest + | ListPromptsRequest + | ListResourcesRequest + | ListResourceTemplatesRequest + | ReadResourceRequest + | SubscribeRequest + | UnsubscribeRequest + | CallToolRequest + | ListToolsRequest + | GetTaskRequest + | GetTaskPayloadRequest + | ListTasksRequest + | CancelTaskRequest; /** @internal */ export type ClientNotification = - | CancelledNotification - | ProgressNotification - | InitializedNotification - | RootsListChangedNotification - | TaskStatusNotification; + | CancelledNotification + | ProgressNotification + | InitializedNotification + | RootsListChangedNotification + | TaskStatusNotification; /** @internal */ export type ClientResult = - | EmptyResult - | CreateMessageResult - | ListRootsResult - | ElicitResult - | GetTaskResult - | GetTaskPayloadResult - | ListTasksResult - | CancelTaskResult; + | EmptyResult + | CreateMessageResult + | ListRootsResult + | ElicitResult + | GetTaskResult + | GetTaskPayloadResult + | ListTasksResult + | CancelTaskResult; /* Server messages */ /** @internal */ export type ServerRequest = - | PingRequest - | CreateMessageRequest - | ListRootsRequest - | ElicitRequest - | GetTaskRequest - | GetTaskPayloadRequest - | ListTasksRequest - | CancelTaskRequest; + | PingRequest + | CreateMessageRequest + | ListRootsRequest + | ElicitRequest + | GetTaskRequest + | GetTaskPayloadRequest + | ListTasksRequest + | CancelTaskRequest; /** @internal */ export type ServerNotification = - | CancelledNotification - | ProgressNotification - | LoggingMessageNotification - | ResourceUpdatedNotification - | ResourceListChangedNotification - | ToolListChangedNotification - | PromptListChangedNotification - | ElicitationCompleteNotification - | TaskStatusNotification; + | CancelledNotification + | ProgressNotification + | LoggingMessageNotification + | ResourceUpdatedNotification + | ResourceListChangedNotification + | ToolListChangedNotification + | PromptListChangedNotification + | ElicitationCompleteNotification + | TaskStatusNotification; /** @internal */ export type ServerResult = - | EmptyResult - | InitializeResult - | CompleteResult - | GetPromptResult - | ListPromptsResult - | ListResourceTemplatesResult - | ListResourcesResult - | ReadResourceResult - | CallToolResult - | CreateTaskResult - | ListToolsResult - | GetTaskResult - | GetTaskPayloadResult - | ListTasksResult - | CancelTaskResult; + | EmptyResult + | InitializeResult + | CompleteResult + | GetPromptResult + | ListPromptsResult + | ListResourceTemplatesResult + | ListResourcesResult + | ReadResourceResult + | CallToolResult + | CreateTaskResult + | ListToolsResult + | GetTaskResult + | GetTaskPayloadResult + | ListTasksResult + | CancelTaskResult;