This is the documentation for v1.x — looking for the v2 beta documentation?
Skip to content

MCP TypeScript SDK / types

types

notifications/elicitation/complete

ElicitationCompleteNotificationParamsSchema

const ElicitationCompleteNotificationParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; elicitationId: ZodString; }, $strip>

Defined in: src/types.ts:2046

Parameters for a notifications/elicitation/complete notification.


ElicitationCompleteNotificationSchema

const ElicitationCompleteNotificationSchema: ZodObject<{ method: ZodLiteral<"notifications/elicitation/complete">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; elicitationId: ZodString; }, $strip>; }, $strip>

Defined in: src/types.ts:2058

A notification from the server to the client, informing it of a completion of an out-of-band elicitation request.

notifications/progress

ProgressNotificationSchema

const ProgressNotificationSchema: ZodObject<{ method: ZodLiteral<"notifications/progress">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; message: ZodOptional<ZodString>; progress: ZodNumber; progressToken: ZodUnion<readonly [ZodString, ZodNumber]>; total: ZodOptional<ZodNumber>; }, $strip>; }, $strip>

Defined in: src/types.ts:670

An out-of-band notification used to inform the receiver of a progress update for a long-running request.

Other

ErrorCode

Defined in: src/types.ts:191

Error codes defined by the JSON-RPC specification.

Enumeration Members

ConnectionClosed

ConnectionClosed: -32000

Defined in: src/types.ts:193

InternalError

InternalError: -32603

Defined in: src/types.ts:201

InvalidParams

InvalidParams: -32602

Defined in: src/types.ts:200

InvalidRequest

InvalidRequest: -32600

Defined in: src/types.ts:198

MethodNotFound

MethodNotFound: -32601

Defined in: src/types.ts:199

ParseError

ParseError: -32700

Defined in: src/types.ts:197

RequestTimeout

RequestTimeout: -32001

Defined in: src/types.ts:194

UrlElicitationRequired

UrlElicitationRequired: -32042

Defined in: src/types.ts:204


McpError

Defined in: src/types.ts:2307

Extends

  • Error

Extended by

Constructors

Constructor

new McpError(code, message, data?): McpError

Defined in: src/types.ts:2308

Parameters
code

number

message

string

data?

unknown

Returns

McpError

Overrides

Error.constructor

Properties

code

readonly code: number

Defined in: src/types.ts:2309

data?

readonly optional data?: unknown

Defined in: src/types.ts:2311

message

message: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

Error.message

name

name: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

Error.name

stack?

optional stack?: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

Error.stack

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

Error.stackTraceLimit

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

Error.captureStackTrace

fromError()

static fromError(code, message, data?): McpError

Defined in: src/types.ts:2320

Factory method to create the appropriate error type based on the error code and data

Parameters
code

number

message

string

data?

unknown

Returns

McpError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

Error.prepareStackTrace


UrlElicitationRequiredError

Defined in: src/types.ts:2338

Specialized error type when a tool requires a URL mode elicitation. This makes it nicer for the client to handle since there is specific data to work with instead of just a code to check against.

Extends

Constructors

Constructor

new UrlElicitationRequiredError(elicitations, message?): UrlElicitationRequiredError

Defined in: src/types.ts:2339

Parameters
elicitations

object[]

message?

string = ...

Returns

UrlElicitationRequiredError

Overrides

McpError.constructor

Properties

code

readonly code: number

Defined in: src/types.ts:2309

Inherited from

McpError.code

data?

readonly optional data?: unknown

Defined in: src/types.ts:2311

Inherited from

McpError.data

message

message: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1077

Inherited from

McpError.message

name

name: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from

McpError.name

stack?

optional stack?: string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from

McpError.stack

stackTraceLimit

static stackTraceLimit: number

Defined in: node_modules/@types/node/globals.d.ts:68

The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).

The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will not capture any frames.

Inherited from

McpError.stackTraceLimit

Accessors

elicitations
Get Signature

get elicitations(): object[]

Defined in: src/types.ts:2345

Returns

Methods

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/@types/node/globals.d.ts:52

Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.

js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`

The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.

The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.

The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:

js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
Parameters
targetObject

object

constructorOpt?

Function

Returns

void

Inherited from

McpError.captureStackTrace

fromError()

static fromError(code, message, data?): McpError

Defined in: src/types.ts:2320

Factory method to create the appropriate error type based on the error code and data

Parameters
code

number

message

string

data?

unknown

Returns

McpError

Inherited from

McpError.fromError

prepareStackTrace()

static prepareStackTrace(err, stackTraces): any

Defined in: node_modules/@types/node/globals.d.ts:56

Parameters
err

Error

stackTraces

CallSite[]

Returns

any

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Inherited from

McpError.prepareStackTrace


CreateMessageRequestParamsWithTools

Defined in: src/types.ts:2571

CreateMessageRequestParams with required tools - for tool-enabled overload.

Extends

Properties

_meta?

optional _meta?: object

Defined in: src/types.ts:78

See General fields: _meta for notes on _meta usage.

Index Signature

[key: string]: unknown

optional io.modelcontextprotocol/related-task?: object

If specified, this request is related to the provided task.

taskId: string

progressToken?

optional progressToken?: string | number

If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.

Inherited from

CreateMessageRequestParams._meta

includeContext?

optional includeContext?: "none" | "thisServer" | "allServers"

Defined in: src/types.ts:1759

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 ClientCapabilities.sampling.context. These values may be removed in future spec releases.

Inherited from

CreateMessageRequestParams.includeContext

maxTokens

maxTokens: number

Defined in: src/types.ts:1766

The requested maximum number of tokens to sample (to prevent runaway completions).

The client MAY choose to sample fewer tokens than the requested maximum.

Inherited from

CreateMessageRequestParams.maxTokens

messages

messages: object[]

Defined in: src/types.ts:1743

_meta?

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature

[key: string]: unknown

content

content: { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; } | { _meta?: {[key: string]: unknown; }; content: ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; description?: string; icons?: object[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; resource: { _meta?: {[key: ...]: ...; }; mimeType?: string; text: string; uri: string; } | { _meta?: {[key: ...]: ...; }; blob: string; mimeType?: string; uri: string; }; type: "resource"; })[]; isError?: boolean; structuredContent?: {[key: string]: unknown; }; toolUseId: string; type: "tool_result"; } | ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: (... | ...)[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: (... | ...)[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: (... | ...)[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; } | { _meta?: {[key: string]: unknown; }; content: ({ _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; text: string; type: "text"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; description?: string; icons?: ...[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; resource: { _meta?: ...; mimeType?: ...; text: ...; uri: ...; } | { _meta?: ...; blob: ...; mimeType?: ...; uri: ...; }; type: "resource"; })[]; isError?: boolean; structuredContent?: {[key: string]: unknown; }; toolUseId: string; type: "tool_result"; })[]

Union Members
Type Literal

{ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; text: string; type: "text"; }

_meta?

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature

[key: string]: unknown

annotations?

optional annotations?: object

Optional annotations for the client.

annotations.audience?

optional audience?: ("user" | "assistant")[]

Intended audience(s) for the resource.

annotations.lastModified?

optional lastModified?: string

ISO 8601 timestamp for the most recent modification.

annotations.priority?

optional priority?: number

Importance hint for the resource, from 0 (least) to 1 (most).

text

text: string

The text content of the message.

type

type: "text"


Type Literal

{ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; }

_meta?

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature

[key: string]: unknown

annotations?

optional annotations?: object

Optional annotations for the client.

annotations.audience?

optional audience?: ("user" | "assistant")[]

Intended audience(s) for the resource.

annotations.lastModified?

optional lastModified?: string

ISO 8601 timestamp for the most recent modification.

annotations.priority?

optional priority?: number

Importance hint for the resource, from 0 (least) to 1 (most).

data

data: string = Base64Schema

The base64-encoded image data.

mimeType

mimeType: string

The MIME type of the image. Different providers may support different image types.

type

type: "image"


Type Literal

{ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; }

_meta?

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature

[key: string]: unknown

annotations?

optional annotations?: object

Optional annotations for the client.

annotations.audience?

optional audience?: ("user" | "assistant")[]

Intended audience(s) for the resource.

annotations.lastModified?

optional lastModified?: string

ISO 8601 timestamp for the most recent modification.

annotations.priority?

optional priority?: number

Importance hint for the resource, from 0 (least) to 1 (most).

data

data: string = Base64Schema

The base64-encoded audio data.

mimeType

mimeType: string

The MIME type of the audio. Different providers may support different audio types.

type

type: "audio"


Type Literal

{ _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; }

_meta?

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature

[key: string]: unknown

id

id: string

Unique identifier for this tool call. Used to correlate with ToolResultContent in subsequent messages.

input

input: object

Arguments to pass to the tool. Must conform to the tool's inputSchema.

Index Signature

[key: string]: unknown

name

name: string

The name of the tool to invoke. Must match a tool name from the request's tools array.

type

type: "tool_use"


Type Literal

{ _meta?: {[key: string]: unknown; }; content: ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; description?: string; icons?: object[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; resource: { _meta?: {[key: ...]: ...; }; mimeType?: string; text: string; uri: string; } | { _meta?: {[key: ...]: ...; }; blob: string; mimeType?: string; uri: string; }; type: "resource"; })[]; isError?: boolean; structuredContent?: {[key: string]: unknown; }; toolUseId: string; type: "tool_result"; }

_meta?

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature

[key: string]: unknown

content

content: ({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; description?: string; icons?: object[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: ...[]; lastModified?: string; priority?: number; }; resource: { _meta?: {[key: ...]: ...; }; mimeType?: string; text: string; uri: string; } | { _meta?: {[key: ...]: ...; }; blob: string; mimeType?: string; uri: string; }; type: "resource"; })[]

isError?

optional isError?: boolean

structuredContent?

optional structuredContent?: object

Index Signature

[key: string]: unknown

toolUseId

toolUseId: string

type

type: "tool_result"


({ _meta?: {[key: string]: unknown; }; annotations?: { audience?: (... | ...)[]; lastModified?: string; priority?: number; }; text: string; type: "text"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: (... | ...)[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: string]: unknown; }; annotations?: { audience?: (... | ...)[]; lastModified?: string; priority?: number; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: string]: unknown; }; id: string; input: {[key: string]: unknown; }; name: string; type: "tool_use"; } | { _meta?: {[key: string]: unknown; }; content: ({ _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; text: string; type: "text"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; data: string; mimeType: string; type: "image"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; data: string; mimeType: string; type: "audio"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; description?: string; icons?: ...[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; resource: { _meta?: ...; mimeType?: ...; text: ...; uri: ...; } | { _meta?: ...; blob: ...; mimeType?: ...; uri: ...; }; type: "resource"; })[]; isError?: boolean; structuredContent?: {[key: string]: unknown; }; toolUseId: string; type: "tool_result"; })[]

role

role: "user" | "assistant" = RoleSchema

Inherited from

CreateMessageRequestParams.messages

metadata?

optional metadata?: object

Defined in: src/types.ts:1771

Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.

Inherited from

CreateMessageRequestParams.metadata

modelPreferences?

optional modelPreferences?: object

Defined in: src/types.ts:1747

The server's preferences for which model to select. The client MAY modify or omit this request.

costPriority?

optional costPriority?: number

How much to prioritize cost when selecting a model.

hints?

optional hints?: object[]

Optional hints to use for model selection.

intelligencePriority?

optional intelligencePriority?: number

How much to prioritize intelligence and capabilities when selecting a model.

speedPriority?

optional speedPriority?: number

How much to prioritize sampling speed (latency) when selecting a model.

Inherited from

CreateMessageRequestParams.modelPreferences

stopSequences?

optional stopSequences?: string[]

Defined in: src/types.ts:1767

Inherited from

CreateMessageRequestParams.stopSequences

systemPrompt?

optional systemPrompt?: string

Defined in: src/types.ts:1751

An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.

Inherited from

CreateMessageRequestParams.systemPrompt

task?

optional task?: object

Defined in: src/types.ts:93

If specified, the caller is requesting task-augmented execution for this request. The request will return a CreateTaskResult immediately, and the actual result can be retrieved later via tasks/result.

Task augmentation is subject to capability negotiation - receivers MUST declare support for task augmentation of specific request types in their capabilities.

ttl?

optional ttl?: number

Inherited from

CreateMessageRequestParams.task

temperature?

optional temperature?: number

Defined in: src/types.ts:1760

Inherited from

CreateMessageRequestParams.temperature

toolChoice?

optional toolChoice?: object

Defined in: src/types.ts:1782

Controls how the model uses tools. The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared. Default is { mode: "auto" }.

mode?

optional mode?: "required" | "none" | "auto"

Controls when tools are used:

  • "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
Inherited from

CreateMessageRequestParams.toolChoice

tools

tools: object[]

Defined in: src/types.ts:2572

Tools that the model may use during generation. The client MUST return an error if this field is provided but ClientCapabilities.sampling.tools is not declared.

_meta?

optional _meta?: object

See MCP specification for notes on _meta usage.

Index Signature

[key: string]: unknown

annotations?

optional annotations?: object

Optional additional tool information.

annotations.destructiveHint?

optional destructiveHint?: 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

annotations.idempotentHint?

optional idempotentHint?: boolean

If true, calling the tool repeatedly with the same arguments will have no additional effect on the its environment.

(This property is meaningful only when readOnlyHint == false)

Default: false

annotations.openWorldHint?

optional openWorldHint?: 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

annotations.readOnlyHint?

optional readOnlyHint?: boolean

If true, the tool does not modify its environment.

Default: false

annotations.title?

optional title?: string

A human-readable title for the tool.

description?

optional description?: string

A human-readable description of the tool.

execution?

optional execution?: object

Execution-related properties for this tool.

execution.taskSupport?

optional taskSupport?: "optional" | "required" | "forbidden"

Indicates the tool's preference for task-augmented execution.

  • "required": Clients MUST invoke the tool as a task
  • "optional": Clients MAY invoke the tool as a task or normal request
  • "forbidden": Clients MUST NOT attempt to invoke the tool as a task

If not present, defaults to "forbidden".

icons?

optional icons?: object[]

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)
inputSchema

inputSchema: object

A JSON Schema 2020-12 object defining the expected parameters for the tool. Must have type: 'object' at the root level per MCP spec.

Index Signature

[key: string]: unknown

inputSchema.properties?

optional properties?: object

Index Signature

[key: string]: object

inputSchema.required?

optional required?: string[]

inputSchema.type

type: "object"

name

name: string

Intended for programmatic or logical use, but used as a display name in past specs or fallback

outputSchema?

optional outputSchema?: object

An optional JSON Schema 2020-12 object defining the structure of the tool's output returned in the structuredContent field of a CallToolResult. Must have type: 'object' at the root level per MCP spec.

Index Signature

[key: string]: unknown

outputSchema.properties?

optional properties?: object

Index Signature

[key: string]: object

outputSchema.required?

optional required?: string[]

outputSchema.type

type: "object"

title?

optional 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 Tool, where annotations.title should be given precedence over using name, if present).

Overrides

CreateMessageRequestParams.tools


MessageExtraInfo

Defined in: src/types.ts:2387

Extra information about a message.

Properties

authInfo?

optional authInfo?: AuthInfo

Defined in: src/types.ts:2396

The authentication information.

closeSSEStream?

optional closeSSEStream?: () => void

Defined in: src/types.ts:2402

Callback to close the SSE stream for this request, triggering client reconnection. Only available when using StreamableHTTPServerTransport with eventStore configured.

Returns

void

closeStandaloneSSEStream?

optional closeStandaloneSSEStream?: () => void

Defined in: src/types.ts:2408

Callback to close the standalone GET SSE stream, triggering client reconnection. Only available when using StreamableHTTPServerTransport with eventStore configured.

Returns

void

requestInfo?

optional requestInfo?: RequestInfo

Defined in: src/types.ts:2391

The request information.


RequestInfo

Defined in: src/types.ts:2373

Information about the incoming request.

Properties

headers

headers: IsomorphicHeaders

Defined in: src/types.ts:2377

The headers of the request.

url?

optional url?: URL

Defined in: src/types.ts:2381

The full URL of the request.


Annotations

Annotations = Infer<typeof AnnotationsSchema>

Defined in: src/types.ts:2447


AudioContent

AudioContent = Infer<typeof AudioContentSchema>

Defined in: src/types.ts:2521


BaseMetadata

BaseMetadata = Infer<typeof BaseMetadataSchema>

Defined in: src/types.ts:2446


BlobResourceContents

BlobResourceContents = Infer<typeof BlobResourceContentsSchema>

Defined in: src/types.ts:2493


BooleanSchema

BooleanSchema = Infer<typeof BooleanSchemaSchema>

Defined in: src/types.ts:2576


CallToolRequest

CallToolRequest = Infer<typeof CallToolRequestSchema>

Defined in: src/types.ts:2540


CallToolRequestParams

CallToolRequestParams = Infer<typeof CallToolRequestParamsSchema>

Defined in: src/types.ts:2537


CallToolResult

CallToolResult = Infer<typeof CallToolResultSchema>

Defined in: src/types.ts:2538


CancelledNotification

CancelledNotification = Infer<typeof CancelledNotificationSchema>

Defined in: src/types.ts:2441


CancelledNotificationParams

CancelledNotificationParams = Infer<typeof CancelledNotificationParamsSchema>

Defined in: src/types.ts:2440


CancelTaskRequest

CancelTaskRequest = Infer<typeof CancelTaskRequestSchema>

Defined in: src/types.ts:2481


CancelTaskResult

CancelTaskResult = Infer<typeof CancelTaskResultSchema>

Defined in: src/types.ts:2482


ClientCapabilities

ClientCapabilities = Infer<typeof ClientCapabilitiesSchema>

Defined in: src/types.ts:2452


ClientNotification

ClientNotification = Infer<typeof ClientNotificationSchema>

Defined in: src/types.ts:2621


ClientRequest

ClientRequest = Infer<typeof ClientRequestSchema>

Defined in: src/types.ts:2620


ClientResult

ClientResult = Infer<typeof ClientResultSchema>

Defined in: src/types.ts:2622


CompatibilityCallToolResult

CompatibilityCallToolResult = Infer<typeof CompatibilityCallToolResultSchema>

Defined in: src/types.ts:2539


CompleteRequest

CompleteRequest = Infer<typeof CompleteRequestSchema>

Defined in: src/types.ts:2606


CompleteRequestParams

CompleteRequestParams = Infer<typeof CompleteRequestParamsSchema>

Defined in: src/types.ts:2605


CompleteRequestPrompt

CompleteRequestPrompt = ExpandRecursively<CompleteRequest & object>

Defined in: src/types.ts:2610


CompleteRequestResourceTemplate

CompleteRequestResourceTemplate = ExpandRecursively<CompleteRequest & object>

Defined in: src/types.ts:2607


CompleteResult

CompleteResult = Infer<typeof CompleteResultSchema>

Defined in: src/types.ts:2611


ContentBlock

ContentBlock = Infer<typeof ContentBlockSchema>

Defined in: src/types.ts:2526


CreateMessageRequest

CreateMessageRequest = Infer<typeof CreateMessageRequestSchema>

Defined in: src/types.ts:2558


CreateMessageRequestParams

CreateMessageRequestParams = Infer<typeof CreateMessageRequestParamsSchema>

Defined in: src/types.ts:2557


CreateMessageRequestParamsBase

CreateMessageRequestParamsBase = Omit<CreateMessageRequestParams, "tools" | "toolChoice">

Defined in: src/types.ts:2566

CreateMessageRequestParams without tools - for backwards-compatible overload. Excludes tools/toolChoice to indicate they should not be provided.


CreateMessageResult

CreateMessageResult = Infer<typeof CreateMessageResultSchema>

Defined in: src/types.ts:2559


CreateMessageResultWithTools

CreateMessageResultWithTools = Infer<typeof CreateMessageResultWithToolsSchema>

Defined in: src/types.ts:2560


CreateTaskResult

CreateTaskResult = Infer<typeof CreateTaskResultSchema>

Defined in: src/types.ts:2473


Cursor

Cursor = Infer<typeof CursorSchema>

Defined in: src/types.ts:2413


ElicitationCompleteNotification

ElicitationCompleteNotification = Infer<typeof ElicitationCompleteNotificationSchema>

Defined in: src/types.ts:2595


ElicitationCompleteNotificationParams

ElicitationCompleteNotificationParams = Infer<typeof ElicitationCompleteNotificationParamsSchema>

Defined in: src/types.ts:2594


ElicitRequest

ElicitRequest = Infer<typeof ElicitRequestSchema>

Defined in: src/types.ts:2593


ElicitRequestFormParams

ElicitRequestFormParams = Infer<typeof ElicitRequestFormParamsSchema>

Defined in: src/types.ts:2591


ElicitRequestParams

ElicitRequestParams = Infer<typeof ElicitRequestParamsSchema>

Defined in: src/types.ts:2590


ElicitRequestURLParams

ElicitRequestURLParams = Infer<typeof ElicitRequestURLParamsSchema>

Defined in: src/types.ts:2592


ElicitResult

ElicitResult = Infer<typeof ElicitResultSchema>

Defined in: src/types.ts:2596


EmbeddedResource

EmbeddedResource = Infer<typeof EmbeddedResourceSchema>

Defined in: src/types.ts:2524


EmptyResult

EmptyResult = Infer<typeof EmptyResultSchema>

Defined in: src/types.ts:2437


EnumSchema

EnumSchema = Infer<typeof EnumSchemaSchema>

Defined in: src/types.ts:2580


GetPromptRequest

GetPromptRequest = Infer<typeof GetPromptRequestSchema>

Defined in: src/types.ts:2518


GetPromptRequestParams

GetPromptRequestParams = Infer<typeof GetPromptRequestParamsSchema>

Defined in: src/types.ts:2517


GetPromptResult

GetPromptResult = Infer<typeof GetPromptResultSchema>

Defined in: src/types.ts:2528


GetTaskPayloadRequest

GetTaskPayloadRequest = Infer<typeof GetTaskPayloadRequestSchema>

Defined in: src/types.ts:2478


GetTaskPayloadResult

GetTaskPayloadResult = Infer<typeof GetTaskPayloadResultSchema>

Defined in: src/types.ts:2483


GetTaskRequest

GetTaskRequest = Infer<typeof GetTaskRequestSchema>

Defined in: src/types.ts:2476


GetTaskResult

GetTaskResult = Infer<typeof GetTaskResultSchema>

Defined in: src/types.ts:2477


Icon

Icon = Infer<typeof IconSchema>

Defined in: src/types.ts:2444


Icons

Icons = Infer<typeof IconsSchema>

Defined in: src/types.ts:2445


ImageContent

ImageContent = Infer<typeof ImageContentSchema>

Defined in: src/types.ts:2520


Implementation

Implementation = Infer<typeof ImplementationSchema>

Defined in: src/types.ts:2451


InitializedNotification

InitializedNotification = Infer<typeof InitializedNotificationSchema>

Defined in: src/types.ts:2457


InitializeRequest

InitializeRequest = Infer<typeof InitializeRequestSchema>

Defined in: src/types.ts:2454


InitializeRequestParams

InitializeRequestParams = Infer<typeof InitializeRequestParamsSchema>

Defined in: src/types.ts:2453


InitializeResult

InitializeResult = Infer<typeof InitializeResultSchema>

Defined in: src/types.ts:2456


IsomorphicHeaders

IsomorphicHeaders = Record<string, string | string[] | undefined>

Defined in: src/types.ts:2368

Headers that are compatible with both Node.js and the browser.


JSONRPCError

JSONRPCError = JSONRPCErrorResponse

Defined in: src/types.ts:2429

Deprecated

Use JSONRPCErrorResponse instead.

Please note that spec types have renamed JSONRPCError to JSONRPCErrorResponse as per the updated JSON-RPC specification. (was previously just JSONRPCError) and future versions will remove JSONRPCError.


JSONRPCErrorResponse

JSONRPCErrorResponse = Infer<typeof JSONRPCErrorResponseSchema>

Defined in: src/types.ts:2423


JSONRPCMessage

JSONRPCMessage = Infer<typeof JSONRPCMessageSchema>

Defined in: src/types.ts:2432


JSONRPCNotification

JSONRPCNotification = Infer<typeof JSONRPCNotificationSchema>

Defined in: src/types.ts:2421


JSONRPCRequest

JSONRPCRequest = Infer<typeof JSONRPCRequestSchema>

Defined in: src/types.ts:2420


JSONRPCResponse

JSONRPCResponse = Infer<typeof JSONRPCResponseSchema>

Defined in: src/types.ts:2422


JSONRPCResultResponse

JSONRPCResultResponse = Infer<typeof JSONRPCResultResponseSchema>

Defined in: src/types.ts:2430


LegacyTitledEnumSchema

LegacyTitledEnumSchema = Infer<typeof LegacyTitledEnumSchemaSchema>

Defined in: src/types.ts:2583


ListChangedCallback

ListChangedCallback<T> = (error, items) => void

Defined in: src/types.ts:1519

Callback type for list changed notifications.

Type Parameters

T

T

Parameters

error

Error | null

items

T[] | null

Returns

void


ListChangedHandlers

ListChangedHandlers = object

Defined in: src/types.ts:1581

Configuration for list changed notification handlers.

Use this to configure handlers for tools, prompts, and resources list changes when creating a client.

Note: Handlers are only activated if the server advertises the corresponding listChanged capability (e.g., tools.listChanged: true). If the server doesn't advertise this capability, the handler will not be set up.

Properties

prompts?

optional prompts?: ListChangedOptions<Prompt>

Defined in: src/types.ts:1589

Handler for prompt list changes.

resources?

optional resources?: ListChangedOptions<Resource>

Defined in: src/types.ts:1593

Handler for resource list changes.

tools?

optional tools?: ListChangedOptions<Tool>

Defined in: src/types.ts:1585

Handler for tool list changes.


ListChangedOptions

ListChangedOptions<T> = object

Defined in: src/types.ts:1551

Options for subscribing to list changed notifications.

Type Parameters

T

T

The type of items in the list (Tool, Prompt, or Resource)

Properties

autoRefresh?

optional autoRefresh?: boolean

Defined in: src/types.ts:1556

If true, the list will be refreshed automatically when a list changed notification is received.

Default
ts
true
debounceMs?

optional debounceMs?: number

Defined in: src/types.ts:1561

Debounce time in milliseconds. Set to 0 to disable.

Default
ts
300
onChanged

onChanged: ListChangedCallback<T>

Defined in: src/types.ts:1568

Callback invoked when the list changes.

If autoRefresh is true, items contains the updated list. If autoRefresh is false, items is null (caller should refresh manually).


ListPromptsRequest

ListPromptsRequest = Infer<typeof ListPromptsRequestSchema>

Defined in: src/types.ts:2515


ListPromptsResult

ListPromptsResult = Infer<typeof ListPromptsResultSchema>

Defined in: src/types.ts:2516


ListResourcesRequest

ListResourcesRequest = Infer<typeof ListResourcesRequestSchema>

Defined in: src/types.ts:2496


ListResourcesResult

ListResourcesResult = Infer<typeof ListResourcesResultSchema>

Defined in: src/types.ts:2497


ListResourceTemplatesRequest

ListResourceTemplatesRequest = Infer<typeof ListResourceTemplatesRequestSchema>

Defined in: src/types.ts:2498


ListResourceTemplatesResult

ListResourceTemplatesResult = Infer<typeof ListResourceTemplatesResultSchema>

Defined in: src/types.ts:2499


ListRootsRequest

ListRootsRequest = Infer<typeof ListRootsRequestSchema>

Defined in: src/types.ts:2615


ListRootsResult

ListRootsResult = Infer<typeof ListRootsResultSchema>

Defined in: src/types.ts:2616


ListTasksRequest

ListTasksRequest = Infer<typeof ListTasksRequestSchema>

Defined in: src/types.ts:2479


ListTasksResult

ListTasksResult = Infer<typeof ListTasksResultSchema>

Defined in: src/types.ts:2480


ListToolsRequest

ListToolsRequest = Infer<typeof ListToolsRequestSchema>

Defined in: src/types.ts:2535


ListToolsResult

ListToolsResult = Infer<typeof ListToolsResultSchema>

Defined in: src/types.ts:2536


LoggingLevel

LoggingLevel = Infer<typeof LoggingLevelSchema>

Defined in: src/types.ts:2544


LoggingMessageNotification

LoggingMessageNotification = Infer<typeof LoggingMessageNotificationSchema>

Defined in: src/types.ts:2548


LoggingMessageNotificationParams

LoggingMessageNotificationParams = Infer<typeof LoggingMessageNotificationParamsSchema>

Defined in: src/types.ts:2547


ModelHint

ModelHint = Infer<typeof ModelHintSchema>

Defined in: src/types.ts:2552


ModelPreferences

ModelPreferences = Infer<typeof ModelPreferencesSchema>

Defined in: src/types.ts:2553


MultiSelectEnumSchema

MultiSelectEnumSchema = Infer<typeof MultiSelectEnumSchemaSchema>

Defined in: src/types.ts:2587


Notification

Notification = Infer<typeof NotificationSchema>

Defined in: src/types.ts:2417


NotificationParams

NotificationParams = Infer<typeof NotificationsParamsSchema>

Defined in: src/types.ts:2434


NumberSchema

NumberSchema = Infer<typeof NumberSchemaSchema>

Defined in: src/types.ts:2578


PaginatedRequest

PaginatedRequest = Infer<typeof PaginatedRequestSchema>

Defined in: src/types.ts:2487


PaginatedRequestParams

PaginatedRequestParams = Infer<typeof PaginatedRequestParamsSchema>

Defined in: src/types.ts:2486


PaginatedResult

PaginatedResult = Infer<typeof PaginatedResultSchema>

Defined in: src/types.ts:2488


PingRequest

PingRequest = Infer<typeof PingRequestSchema>

Defined in: src/types.ts:2460


PrimitiveSchemaDefinition

PrimitiveSchemaDefinition = Infer<typeof PrimitiveSchemaDefinitionSchema>

Defined in: src/types.ts:2589


Progress

Progress = Infer<typeof ProgressSchema>

Defined in: src/types.ts:2463


ProgressNotification

ProgressNotification = Infer<typeof ProgressNotificationSchema>

Defined in: src/types.ts:2465


ProgressNotificationParams

ProgressNotificationParams = Infer<typeof ProgressNotificationParamsSchema>

Defined in: src/types.ts:2464


ProgressToken

ProgressToken = Infer<typeof ProgressTokenSchema>

Defined in: src/types.ts:2412


Prompt

Prompt = Infer<typeof PromptSchema>

Defined in: src/types.ts:2514


PromptArgument

PromptArgument = Infer<typeof PromptArgumentSchema>

Defined in: src/types.ts:2513


PromptListChangedNotification

PromptListChangedNotification = Infer<typeof PromptListChangedNotificationSchema>

Defined in: src/types.ts:2529


PromptMessage

PromptMessage = Infer<typeof PromptMessageSchema>

Defined in: src/types.ts:2527


PromptReference

PromptReference = Infer<typeof PromptReferenceSchema>

Defined in: src/types.ts:2604


ReadResourceRequest

ReadResourceRequest = Infer<typeof ReadResourceRequestSchema>

Defined in: src/types.ts:2502


ReadResourceRequestParams

ReadResourceRequestParams = Infer<typeof ReadResourceRequestParamsSchema>

Defined in: src/types.ts:2501


ReadResourceResult

ReadResourceResult = Infer<typeof ReadResourceResultSchema>

Defined in: src/types.ts:2503


RelatedTaskMetadata

RelatedTaskMetadata = Infer<typeof RelatedTaskMetadataSchema>

Defined in: src/types.ts:2472


Request

Request = Infer<typeof RequestSchema>

Defined in: src/types.ts:2414


RequestId

RequestId = Infer<typeof RequestIdSchema>

Defined in: src/types.ts:2419


RequestMeta

RequestMeta = Infer<typeof RequestMetaSchema>

Defined in: src/types.ts:2416


RequestParams

RequestParams = Infer<typeof BaseRequestParamsSchema>

Defined in: src/types.ts:2433


Resource

Resource = Infer<typeof ResourceSchema>

Defined in: src/types.ts:2494


ResourceContents

ResourceContents = Infer<typeof ResourceContentsSchema>

Defined in: src/types.ts:2491


ResourceLink = Infer<typeof ResourceLinkSchema>

Defined in: src/types.ts:2525


ResourceListChangedNotification

ResourceListChangedNotification = Infer<typeof ResourceListChangedNotificationSchema>

Defined in: src/types.ts:2504


ResourceReference

ResourceReference = ResourceTemplateReference

Defined in: src/types.ts:2603

Deprecated

Use ResourceTemplateReference instead


ResourceRequestParams

ResourceRequestParams = Infer<typeof ResourceRequestParamsSchema>

Defined in: src/types.ts:2500


ResourceTemplate

ResourceTemplate = Infer<typeof ResourceTemplateSchema>

Defined in: src/types.ts:2495


ResourceTemplateReference

ResourceTemplateReference = Infer<typeof ResourceTemplateReferenceSchema>

Defined in: src/types.ts:2599


ResourceUpdatedNotification

ResourceUpdatedNotification = Infer<typeof ResourceUpdatedNotificationSchema>

Defined in: src/types.ts:2510


ResourceUpdatedNotificationParams

ResourceUpdatedNotificationParams = Infer<typeof ResourceUpdatedNotificationParamsSchema>

Defined in: src/types.ts:2509


Result

Result = Infer<typeof ResultSchema>

Defined in: src/types.ts:2418


Role

Role = Infer<typeof RoleSchema>

Defined in: src/types.ts:2448


Root

Root = Infer<typeof RootSchema>

Defined in: src/types.ts:2614


RootsListChangedNotification

RootsListChangedNotification = Infer<typeof RootsListChangedNotificationSchema>

Defined in: src/types.ts:2617


SamplingContent

SamplingContent = Infer<typeof SamplingContentSchema>

Defined in: src/types.ts:2554


SamplingMessage

SamplingMessage = Infer<typeof SamplingMessageSchema>

Defined in: src/types.ts:2556


SamplingMessageContentBlock

SamplingMessageContentBlock = Infer<typeof SamplingMessageContentBlockSchema>

Defined in: src/types.ts:2555


ServerCapabilities

ServerCapabilities = Infer<typeof ServerCapabilitiesSchema>

Defined in: src/types.ts:2455


ServerNotification

ServerNotification = Infer<typeof ServerNotificationSchema>

Defined in: src/types.ts:2626


ServerRequest

ServerRequest = Infer<typeof ServerRequestSchema>

Defined in: src/types.ts:2625


ServerResult

ServerResult = Infer<typeof ServerResultSchema>

Defined in: src/types.ts:2627


SetLevelRequest

SetLevelRequest = Infer<typeof SetLevelRequestSchema>

Defined in: src/types.ts:2546


SetLevelRequestParams

SetLevelRequestParams = Infer<typeof SetLevelRequestParamsSchema>

Defined in: src/types.ts:2545


SingleSelectEnumSchema

SingleSelectEnumSchema = Infer<typeof SingleSelectEnumSchemaSchema>

Defined in: src/types.ts:2586


StringSchema

StringSchema = Infer<typeof StringSchemaSchema>

Defined in: src/types.ts:2577


SubscribeRequest

SubscribeRequest = Infer<typeof SubscribeRequestSchema>

Defined in: src/types.ts:2506


SubscribeRequestParams

SubscribeRequestParams = Infer<typeof SubscribeRequestParamsSchema>

Defined in: src/types.ts:2505


Task

Task = Infer<typeof TaskSchema>

Defined in: src/types.ts:2468


TaskAugmentedRequestParams

TaskAugmentedRequestParams = Infer<typeof TaskAugmentedRequestParamsSchema>

Defined in: src/types.ts:2415


TaskCreationParams

TaskCreationParams = Infer<typeof TaskCreationParamsSchema>

Defined in: src/types.ts:2470


TaskMetadata

TaskMetadata = Infer<typeof TaskMetadataSchema>

Defined in: src/types.ts:2471


TaskStatus

TaskStatus = Infer<typeof TaskStatusSchema>

Defined in: src/types.ts:2469


TaskStatusNotification

TaskStatusNotification = Infer<typeof TaskStatusNotificationSchema>

Defined in: src/types.ts:2475


TaskStatusNotificationParams

TaskStatusNotificationParams = Infer<typeof TaskStatusNotificationParamsSchema>

Defined in: src/types.ts:2474


TextContent

TextContent = Infer<typeof TextContentSchema>

Defined in: src/types.ts:2519


TextResourceContents

TextResourceContents = Infer<typeof TextResourceContentsSchema>

Defined in: src/types.ts:2492


TitledMultiSelectEnumSchema

TitledMultiSelectEnumSchema = Infer<typeof TitledMultiSelectEnumSchemaSchema>

Defined in: src/types.ts:2585


TitledSingleSelectEnumSchema

TitledSingleSelectEnumSchema = Infer<typeof TitledSingleSelectEnumSchemaSchema>

Defined in: src/types.ts:2582


Tool

Tool = Infer<typeof ToolSchema>

Defined in: src/types.ts:2534


ToolAnnotations

ToolAnnotations = Infer<typeof ToolAnnotationsSchema>

Defined in: src/types.ts:2532


ToolChoice

ToolChoice = Infer<typeof ToolChoiceSchema>

Defined in: src/types.ts:2551


ToolExecution

ToolExecution = Infer<typeof ToolExecutionSchema>

Defined in: src/types.ts:2533


ToolListChangedNotification

ToolListChangedNotification = Infer<typeof ToolListChangedNotificationSchema>

Defined in: src/types.ts:2541


ToolResultContent

ToolResultContent = Infer<typeof ToolResultContentSchema>

Defined in: src/types.ts:2523


ToolUseContent

ToolUseContent = Infer<typeof ToolUseContentSchema>

Defined in: src/types.ts:2522


UnsubscribeRequest

UnsubscribeRequest = Infer<typeof UnsubscribeRequestSchema>

Defined in: src/types.ts:2508


UnsubscribeRequestParams

UnsubscribeRequestParams = Infer<typeof UnsubscribeRequestParamsSchema>

Defined in: src/types.ts:2507


UntitledMultiSelectEnumSchema

UntitledMultiSelectEnumSchema = Infer<typeof UntitledMultiSelectEnumSchemaSchema>

Defined in: src/types.ts:2584


UntitledSingleSelectEnumSchema

UntitledSingleSelectEnumSchema = Infer<typeof UntitledSingleSelectEnumSchemaSchema>

Defined in: src/types.ts:2581


AnnotationsSchema

const AnnotationsSchema: ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: "assistant"; user: "user"; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>

Defined in: src/types.ts:871

Optional annotations providing clients additional context about a resource.


AudioContentSchema

const AudioContentSchema: ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: "assistant"; user: "user"; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>

Defined in: src/types.ts:1192

An Audio provided to or from an LLM.


BaseMetadataSchema

const BaseMetadataSchema: ZodObject<{ name: ZodString; title: ZodOptional<ZodString>; }, $strip>

Defined in: src/types.ts:344

Base metadata interface for common properties across resources, tools, prompts, and implementations.


BlobResourceContentsSchema

const BlobResourceContentsSchema: ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; blob: ZodString; mimeType: ZodOptional<ZodString>; uri: ZodString; }, $strip>

Defined in: src/types.ts:856


BooleanSchemaSchema

const BooleanSchemaSchema: ZodObject<{ default: ZodOptional<ZodBoolean>; description: ZodOptional<ZodString>; title: ZodOptional<ZodString>; type: ZodLiteral<"boolean">; }, $strip>

Defined in: src/types.ts:1852

Primitive schema definition for boolean fields.


CallToolRequestParamsSchema

const CallToolRequestParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; arguments: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; name: ZodString; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; }, $strip>

Defined in: src/types.ts:1489

Parameters for a tools/call request.


CallToolRequestSchema

const CallToolRequestSchema: ZodObject<{ method: ZodLiteral<"tools/call">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; arguments: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; name: ZodString; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; }, $strip>; }, $strip>

Defined in: src/types.ts:1503

Used by the client to invoke a tool provided by the server.


CallToolResultSchema

const CallToolResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; content: ZodDefault<ZodArray<ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<..., ...>>>; mimeType: ZodOptional<ZodString>; name: ZodString; size: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"resource_link">; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; resource: ZodUnion<readonly [ZodObject<..., ...>, ZodObject<..., ...>]>; type: ZodLiteral<"resource">; }, $strip>]>>>; isError: ZodOptional<ZodBoolean>; structuredContent: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; }, $loose>

Defined in: src/types.ts:1444

The server's response to a tool call.


CancelledNotificationParamsSchema

const CancelledNotificationParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; reason: ZodOptional<ZodString>; requestId: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $strip>

Defined in: src/types.ts:265


CancelledNotificationSchema

const CancelledNotificationSchema: ZodObject<{ method: ZodLiteral<"notifications/cancelled">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; reason: ZodOptional<ZodString>; requestId: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $strip>; }, $strip>

Defined in: src/types.ts:287

This notification can be sent by either side to indicate that it is cancelling a previously-issued request.

The request SHOULD still be in-flight, but due to communication latency, it is always possible that this notification MAY arrive after the request has already finished.

This notification indicates that the result will be unused, so any associated processing SHOULD cease.

A client MUST NOT attempt to cancel its initialize request.


CancelTaskRequestSchema

const CancelTaskRequestSchema: ZodObject<{ method: ZodLiteral<"tasks/cancel">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; taskId: ZodString; }, $strip>; }, $strip>

Defined in: src/types.ts:798

A request to cancel a specific task.


CancelTaskResultSchema

const CancelTaskResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>

Defined in: src/types.ts:808

The response to a tasks/cancel request.


ClientCapabilitiesSchema

const ClientCapabilitiesSchema: ZodObject<{ elicitation: ZodOptional<ZodPipe<ZodTransform<unknown, unknown>, ZodIntersection<ZodObject<{ form: ZodOptional<ZodIntersection<ZodObject<{ applyDefaults: ...; }, $strip>, ZodRecord<ZodString, ZodUnknown>>>; url: ZodOptional<ZodCustom<object, object>>; }, $strip>, ZodOptional<ZodRecord<ZodString, ZodUnknown>>>>>; experimental: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; extensions: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; roots: ZodOptional<ZodObject<{ listChanged: ZodOptional<ZodBoolean>; }, $strip>>; sampling: ZodOptional<ZodObject<{ context: ZodOptional<ZodCustom<object, object>>; tools: ZodOptional<ZodCustom<object, object>>; }, $strip>>; tasks: ZodOptional<ZodObject<{ cancel: ZodOptional<ZodCustom<object, object>>; list: ZodOptional<ZodCustom<object, object>>; requests: ZodOptional<ZodObject<{ elicitation: ZodOptional<ZodObject<{ create: ...; }, $loose>>; sampling: ZodOptional<ZodObject<{ createMessage: ...; }, $loose>>; }, $loose>>; }, $loose>>; }, $strip>

Defined in: src/types.ts:475

Capabilities a client may support. Known capabilities are defined here, in this schema, but this is not a closed set: any client can define its own, additional capabilities.


ClientNotificationSchema

const ClientNotificationSchema: ZodUnion<readonly [ZodObject<{ method: ZodLiteral<"notifications/cancelled">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; reason: ZodOptional<ZodString>; requestId: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"notifications/progress">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; message: ZodOptional<ZodString>; progress: ZodNumber; progressToken: ZodUnion<readonly [ZodString, ZodNumber]>; total: ZodOptional<ZodNumber>; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"notifications/initialized">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"notifications/roots/list_changed">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"notifications/tasks/status">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>; }, $strip>]>

Defined in: src/types.ts:2248


ClientRequestSchema

const ClientRequestSchema: ZodUnion<readonly [ZodObject<{ method: ZodLiteral<"ping">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"initialize">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; capabilities: ZodObject<{ elicitation: ZodOptional<ZodPipe<ZodTransform<..., ...>, ZodIntersection<..., ...>>>; experimental: ZodOptional<ZodRecord<ZodString, ZodCustom<..., ...>>>; extensions: ZodOptional<ZodRecord<ZodString, ZodCustom<..., ...>>>; roots: ZodOptional<ZodObject<{ listChanged: ...; }, $strip>>; sampling: ZodOptional<ZodObject<{ context: ...; tools: ...; }, $strip>>; tasks: ZodOptional<ZodObject<{ cancel: ...; list: ...; requests: ...; }, $loose>>; }, $strip>; clientInfo: ZodObject<{ description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<..., ...>>>; name: ZodString; title: ZodOptional<ZodString>; version: ZodString; websiteUrl: ZodOptional<ZodString>; }, $strip>; protocolVersion: ZodString; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"completion/complete">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; argument: ZodObject<{ name: ZodString; value: ZodString; }, $strip>; context: ZodOptional<ZodObject<{ arguments: ZodOptional<ZodRecord<..., ...>>; }, $strip>>; ref: ZodUnion<readonly [ZodObject<{ name: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ type: ZodLiteral<...>; uri: ZodString; }, $strip>]>; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"logging/setLevel">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; level: ZodEnum<{ alert: "alert"; critical: "critical"; debug: "debug"; emergency: "emergency"; error: "error"; info: "info"; notice: "notice"; warning: "warning"; }>; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"prompts/get">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; arguments: ZodOptional<ZodRecord<ZodString, ZodString>>; name: ZodString; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"prompts/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"resources/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"resources/templates/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"resources/read">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; uri: ZodString; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"resources/subscribe">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; uri: ZodString; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"resources/unsubscribe">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; uri: ZodString; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"tools/call">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; arguments: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; name: ZodString; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"tools/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"tasks/get">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; taskId: ZodString; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"tasks/result">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; taskId: ZodString; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"tasks/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"tasks/cancel">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; taskId: ZodString; }, $strip>; }, $strip>]>

Defined in: src/types.ts:2228


ClientResultSchema

const ClientResultSchema: ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; }, $strict>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; content: ZodDiscriminatedUnion<[ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>]>; model: ZodString; role: ZodEnum<{ assistant: "assistant"; user: "user"; }>; stopReason: ZodOptional<ZodUnion<[ZodEnum<{ endTurn: "endTurn"; maxTokens: "maxTokens"; stopSequence: "stopSequence"; }>, ZodString]>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; content: ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; text: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; data: ZodString; mimeType: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; data: ZodString; mimeType: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; id: ZodString; input: ZodRecord<..., ...>; name: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; content: ZodDefault<...>; isError: ZodOptional<...>; structuredContent: ZodOptional<...>; toolUseId: ZodString; type: ZodLiteral<...>; }, $strip>]>, ZodArray<ZodDiscriminatedUnion<[ZodObject<{ _meta: ...; annotations: ...; text: ...; type: ...; }, $strip>, ZodObject<{ _meta: ...; annotations: ...; data: ...; mimeType: ...; type: ...; }, $strip>, ZodObject<{ _meta: ...; annotations: ...; data: ...; mimeType: ...; type: ...; }, $strip>, ZodObject<{ _meta: ...; id: ...; input: ...; name: ...; type: ...; }, $strip>, ZodObject<{ _meta: ...; content: ...; isError: ...; structuredContent: ...; toolUseId: ...; type: ...; }, $strip>]>>]>; model: ZodString; role: ZodEnum<{ assistant: "assistant"; user: "user"; }>; stopReason: ZodOptional<ZodUnion<[ZodEnum<{ endTurn: "endTurn"; maxTokens: "maxTokens"; stopSequence: "stopSequence"; toolUse: "toolUse"; }>, ZodString]>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; action: ZodEnum<{ accept: "accept"; cancel: "cancel"; decline: "decline"; }>; content: ZodPipe<ZodTransform<{ } | undefined, unknown>, ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>>>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; roots: ZodArray<ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; name: ZodOptional<ZodString>; uri: ZodString; }, $strip>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; nextCursor: ZodOptional<ZodString>; tasks: ZodArray<ZodObject<{ createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; task: ZodObject<{ createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>; }, $loose>]>

Defined in: src/types.ts:2256


ClientTasksCapabilitySchema

const ClientTasksCapabilitySchema: ZodObject<{ cancel: ZodOptional<ZodCustom<object, object>>; list: ZodOptional<ZodCustom<object, object>>; requests: ZodOptional<ZodObject<{ elicitation: ZodOptional<ZodObject<{ create: ZodOptional<ZodCustom<object, object>>; }, $loose>>; sampling: ZodOptional<ZodObject<{ createMessage: ZodOptional<ZodCustom<object, object>>; }, $loose>>; }, $loose>>; }, $loose>

Defined in: src/types.ts:409

Task capabilities for clients, indicating which request types support task creation.


CompatibilityCallToolResultSchema

const CompatibilityCallToolResultSchema: ZodUnion<[ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; content: ZodDefault<ZodArray<ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; text: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; data: ZodString; mimeType: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; data: ZodString; mimeType: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; description: ZodOptional<...>; icons: ZodOptional<...>; mimeType: ZodOptional<...>; name: ZodString; size: ZodOptional<...>; title: ZodOptional<...>; type: ZodLiteral<...>; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; resource: ZodUnion<...>; type: ZodLiteral<...>; }, $strip>]>>>; isError: ZodOptional<ZodBoolean>; structuredContent: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; toolResult: ZodUnknown; }, $loose>]>

Defined in: src/types.ts:1480

CallToolResultSchema extended with backwards compatibility to protocol version 2024-10-07.


CompleteRequestParamsSchema

const CompleteRequestParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; argument: ZodObject<{ name: ZodString; value: ZodString; }, $strip>; context: ZodOptional<ZodObject<{ arguments: ZodOptional<ZodRecord<ZodString, ZodString>>; }, $strip>>; ref: ZodUnion<readonly [ZodObject<{ name: ZodString; type: ZodLiteral<"ref/prompt">; }, $strip>, ZodObject<{ type: ZodLiteral<"ref/resource">; uri: ZodString; }, $strip>]>; }, $strip>

Defined in: src/types.ts:2117

Parameters for a completion/complete request.


CompleteRequestSchema

const CompleteRequestSchema: ZodObject<{ method: ZodLiteral<"completion/complete">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; argument: ZodObject<{ name: ZodString; value: ZodString; }, $strip>; context: ZodOptional<ZodObject<{ arguments: ZodOptional<ZodRecord<ZodString, ZodString>>; }, $strip>>; ref: ZodUnion<readonly [ZodObject<{ name: ZodString; type: ZodLiteral<"ref/prompt">; }, $strip>, ZodObject<{ type: ZodLiteral<"ref/resource">; uri: ZodString; }, $strip>]>; }, $strip>; }, $strip>

Defined in: src/types.ts:2144

A request from the client to the server, to ask for completion options.


CompleteResultSchema

const CompleteResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; completion: ZodObject<{ hasMore: ZodOptional<ZodBoolean>; total: ZodOptional<ZodNumber>; values: ZodArray<ZodString>; }, $loose>; }, $loose>

Defined in: src/types.ts:2166

The server's response to a completion/complete request


ContentBlockSchema

const ContentBlockSchema: ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: ...; user: ...; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: ...; user: ...; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: ...; user: ...; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: ...; user: ...; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<ZodString>>; src: ZodString; theme: ZodOptional<ZodEnum<{ dark: ...; light: ...; }>>; }, $strip>>>; mimeType: ZodOptional<ZodString>; name: ZodString; size: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"resource_link">; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: ...; user: ...; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; resource: ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; mimeType: ZodOptional<ZodString>; text: ZodString; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; blob: ZodString; mimeType: ZodOptional<ZodString>; uri: ZodString; }, $strip>]>; type: ZodLiteral<"resource">; }, $strip>]>

Defined in: src/types.ts:1272

A content block that can be used in prompts and tool results.


CreateMessageRequestParamsSchema

const CreateMessageRequestParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; includeContext: ZodOptional<ZodEnum<{ allServers: "allServers"; none: "none"; thisServer: "thisServer"; }>>; maxTokens: ZodNumber; messages: ZodArray<ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; content: ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{ _meta: ...; annotations: ...; text: ...; type: ...; }, $strip>, ZodObject<{ _meta: ...; annotations: ...; data: ...; mimeType: ...; type: ...; }, $strip>, ZodObject<{ _meta: ...; annotations: ...; data: ...; mimeType: ...; type: ...; }, $strip>, ZodObject<{ _meta: ...; id: ...; input: ...; name: ...; type: ...; }, $strip>, ZodObject<{ _meta: ...; content: ...; isError: ...; structuredContent: ...; toolUseId: ...; type: ...; }, $strip>]>, ZodArray<ZodDiscriminatedUnion<[ZodObject<..., ...>, ZodObject<..., ...>, ZodObject<..., ...>, ZodObject<..., ...>, ZodObject<..., ...>]>>]>; role: ZodEnum<{ assistant: "assistant"; user: "user"; }>; }, $strip>>; metadata: ZodOptional<ZodCustom<object, object>>; modelPreferences: ZodOptional<ZodObject<{ costPriority: ZodOptional<ZodNumber>; hints: ZodOptional<ZodArray<ZodObject<{ name: ZodOptional<ZodString>; }, $strip>>>; intelligencePriority: ZodOptional<ZodNumber>; speedPriority: ZodOptional<ZodNumber>; }, $strip>>; stopSequences: ZodOptional<ZodArray<ZodString>>; systemPrompt: ZodOptional<ZodString>; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; temperature: ZodOptional<ZodNumber>; toolChoice: ZodOptional<ZodObject<{ mode: ZodOptional<ZodEnum<{ auto: "auto"; none: "none"; required: "required"; }>>; }, $strip>>; tools: ZodOptional<ZodArray<ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ destructiveHint: ZodOptional<ZodBoolean>; idempotentHint: ZodOptional<ZodBoolean>; openWorldHint: ZodOptional<ZodBoolean>; readOnlyHint: ZodOptional<ZodBoolean>; title: ZodOptional<ZodString>; }, $strip>>; description: ZodOptional<ZodString>; execution: ZodOptional<ZodObject<{ taskSupport: ZodOptional<ZodEnum<...>>; }, $strip>>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<...>; sizes: ZodOptional<...>; src: ZodString; theme: ZodOptional<...>; }, $strip>>>; inputSchema: ZodObject<{ properties: ZodOptional<ZodRecord<ZodString, ZodCustom<..., ...>>>; required: ZodOptional<ZodArray<ZodString>>; type: ZodLiteral<"object">; }, $catchall<ZodUnknown>>; name: ZodString; outputSchema: ZodOptional<ZodObject<{ properties: ZodOptional<ZodRecord<..., ...>>; required: ZodOptional<ZodArray<...>>; type: ZodLiteral<"object">; }, $catchall<ZodUnknown>>>; title: ZodOptional<ZodString>; }, $strip>>>; }, $strip>

Defined in: src/types.ts:1742

Parameters for a sampling/createMessage request.


CreateMessageRequestSchema

const CreateMessageRequestSchema: ZodObject<{ method: ZodLiteral<"sampling/createMessage">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; includeContext: ZodOptional<ZodEnum<{ allServers: "allServers"; none: "none"; thisServer: "thisServer"; }>>; maxTokens: ZodNumber; messages: ZodArray<ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; content: ZodUnion<readonly [ZodDiscriminatedUnion<[..., ..., ..., ..., ...]>, ZodArray<ZodDiscriminatedUnion<...>>]>; role: ZodEnum<{ assistant: "assistant"; user: "user"; }>; }, $strip>>; metadata: ZodOptional<ZodCustom<object, object>>; modelPreferences: ZodOptional<ZodObject<{ costPriority: ZodOptional<ZodNumber>; hints: ZodOptional<ZodArray<ZodObject<{ name: ...; }, $strip>>>; intelligencePriority: ZodOptional<ZodNumber>; speedPriority: ZodOptional<ZodNumber>; }, $strip>>; stopSequences: ZodOptional<ZodArray<ZodString>>; systemPrompt: ZodOptional<ZodString>; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; temperature: ZodOptional<ZodNumber>; toolChoice: ZodOptional<ZodObject<{ mode: ZodOptional<ZodEnum<{ auto: "auto"; none: "none"; required: "required"; }>>; }, $strip>>; tools: ZodOptional<ZodArray<ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ destructiveHint: ...; idempotentHint: ...; openWorldHint: ...; readOnlyHint: ...; title: ...; }, $strip>>; description: ZodOptional<ZodString>; execution: ZodOptional<ZodObject<{ taskSupport: ...; }, $strip>>; icons: ZodOptional<ZodArray<ZodObject<..., ...>>>; inputSchema: ZodObject<{ properties: ZodOptional<...>; required: ZodOptional<...>; type: ZodLiteral<...>; }, $catchall<ZodUnknown>>; name: ZodString; outputSchema: ZodOptional<ZodObject<{ properties: ...; required: ...; type: ...; }, $catchall<...>>>; title: ZodOptional<ZodString>; }, $strip>>>; }, $strip>; }, $strip>

Defined in: src/types.ts:1787

A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.


CreateMessageResultSchema

const CreateMessageResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; content: ZodDiscriminatedUnion<[ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<...>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<...>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<...>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>]>; model: ZodString; role: ZodEnum<{ assistant: "assistant"; user: "user"; }>; stopReason: ZodOptional<ZodUnion<[ZodEnum<{ endTurn: "endTurn"; maxTokens: "maxTokens"; stopSequence: "stopSequence"; }>, ZodString]>>; }, $loose>

Defined in: src/types.ts:1797

The client's response to a sampling/create_message request from the server. This is the backwards-compatible version that returns single content (no arrays). Used when the request does not include tools.


CreateMessageResultWithToolsSchema

const CreateMessageResultWithToolsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; content: ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; id: ZodString; input: ZodRecord<ZodString, ZodUnknown>; name: ZodString; type: ZodLiteral<"tool_use">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; content: ZodDefault<ZodArray<ZodUnion<...>>>; isError: ZodOptional<ZodBoolean>; structuredContent: ZodOptional<ZodObject<{ }, $loose>>; toolUseId: ZodString; type: ZodLiteral<"tool_result">; }, $strip>]>, ZodArray<ZodDiscriminatedUnion<[ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; annotations: ZodOptional<ZodObject<..., ...>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; annotations: ZodOptional<ZodObject<..., ...>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; annotations: ZodOptional<ZodObject<..., ...>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; id: ZodString; input: ZodRecord<ZodString, ZodUnknown>; name: ZodString; type: ZodLiteral<"tool_use">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; content: ZodDefault<ZodArray<...>>; isError: ZodOptional<ZodBoolean>; structuredContent: ZodOptional<ZodObject<..., ...>>; toolUseId: ZodString; type: ZodLiteral<"tool_result">; }, $strip>]>>]>; model: ZodString; role: ZodEnum<{ assistant: "assistant"; user: "user"; }>; stopReason: ZodOptional<ZodUnion<[ZodEnum<{ endTurn: "endTurn"; maxTokens: "maxTokens"; stopSequence: "stopSequence"; toolUse: "toolUse"; }>, ZodString]>>; }, $loose>

Defined in: src/types.ts:1824

The client's response to a sampling/create_message request when tools were provided. This version supports array content for tool use flows.


CreateTaskResultSchema

const CreateTaskResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; task: ZodObject<{ createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>; }, $loose>

Defined in: src/types.ts:731

Result returned when a task is created, containing the task data wrapped in a task field.


CursorSchema

const CursorSchema: ZodString

Defined in: src/types.ts:31

An opaque token used to represent a cursor for pagination.


DEFAULT_NEGOTIATED_PROTOCOL_VERSION

const DEFAULT_NEGOTIATED_PROTOCOL_VERSION: "2025-03-26" = '2025-03-26'

Defined in: src/types.ts:5


ElicitRequestFormParamsSchema

const ElicitRequestFormParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; message: ZodString; mode: ZodOptional<ZodLiteral<"form">>; requestedSchema: ZodObject<{ properties: ZodRecord<ZodString, ZodUnion<readonly [ZodUnion<readonly [ZodObject<{ default: ...; description: ...; enum: ...; enumNames: ...; title: ...; type: ...; }, $strip>, ZodUnion<readonly [..., ...]>, ZodUnion<readonly [..., ...]>]>, ZodObject<{ default: ZodOptional<ZodBoolean>; description: ZodOptional<ZodString>; title: ZodOptional<ZodString>; type: ZodLiteral<"boolean">; }, $strip>, ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; format: ZodOptional<ZodEnum<...>>; maxLength: ZodOptional<ZodNumber>; minLength: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>, ZodObject<{ default: ZodOptional<ZodNumber>; description: ZodOptional<ZodString>; maximum: ZodOptional<ZodNumber>; minimum: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodEnum<{ integer: ...; number: ...; }>; }, $strip>]>>; required: ZodOptional<ZodArray<ZodString>>; type: ZodLiteral<"object">; }, $strip>; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; }, $strip>

Defined in: src/types.ts:1981

Parameters for an elicitation/create request for form-based elicitation.


ElicitRequestParamsSchema

const ElicitRequestParamsSchema: ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; message: ZodString; mode: ZodOptional<ZodLiteral<"form">>; requestedSchema: ZodObject<{ properties: ZodRecord<ZodString, ZodUnion<readonly [ZodUnion<readonly [..., ..., ...]>, ZodObject<{ default: ...; description: ...; title: ...; type: ...; }, $strip>, ZodObject<{ default: ...; description: ...; format: ...; maxLength: ...; minLength: ...; title: ...; type: ...; }, $strip>, ZodObject<{ default: ...; description: ...; maximum: ...; minimum: ...; title: ...; type: ...; }, $strip>]>>; required: ZodOptional<ZodArray<ZodString>>; type: ZodLiteral<"object">; }, $strip>; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; elicitationId: ZodString; message: ZodString; mode: ZodLiteral<"url">; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; url: ZodString; }, $strip>]>

Defined in: src/types.ts:2029

The parameters for a request to elicit additional information from the user via the client.


ElicitRequestSchema

const ElicitRequestSchema: ZodObject<{ method: ZodLiteral<"elicitation/create">; params: ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; message: ZodString; mode: ZodOptional<ZodLiteral<"form">>; requestedSchema: ZodObject<{ properties: ZodRecord<ZodString, ZodUnion<readonly [..., ..., ..., ...]>>; required: ZodOptional<ZodArray<ZodString>>; type: ZodLiteral<"object">; }, $strip>; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; elicitationId: ZodString; message: ZodString; mode: ZodLiteral<"url">; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; url: ZodString; }, $strip>]>; }, $strip>

Defined in: src/types.ts:2036

A request from the server to elicit user input via the client. The client should present the message and form fields to the user (form mode) or navigate to a URL (URL mode).


ElicitRequestURLParamsSchema

const ElicitRequestURLParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; elicitationId: ZodString; message: ZodString; mode: ZodLiteral<"url">; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; url: ZodString; }, $strip>

Defined in: src/types.ts:2006

Parameters for an elicitation/create request for URL-based elicitation.


ElicitResultSchema

const ElicitResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; action: ZodEnum<{ accept: "accept"; cancel: "cancel"; decline: "decline"; }>; content: ZodPipe<ZodTransform<{ } | undefined, unknown>, ZodOptional<ZodRecord<ZodString, ZodUnion<readonly [ZodString, ZodNumber, ZodBoolean, ZodArray<ZodString>]>>>>; }, $loose>

Defined in: src/types.ts:2066

The client's response to an elicitation/create request from the server.


EmbeddedResourceSchema

const EmbeddedResourceSchema: ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: "assistant"; user: "user"; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; resource: ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; mimeType: ZodOptional<ZodString>; text: ZodString; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; blob: ZodString; mimeType: ZodOptional<ZodString>; uri: ZodString; }, $strip>]>; type: ZodLiteral<"resource">; }, $strip>

Defined in: src/types.ts:1246

The contents of a resource, embedded into a prompt or tool call result.


EmptyResultSchema

const EmptyResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; }, $strict>

Defined in: src/types.ts:263

A response that indicates success but carries no data.


EnumSchemaSchema

const EnumSchemaSchema: ZodUnion<readonly [ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; enum: ZodArray<ZodString>; enumNames: ZodOptional<ZodArray<ZodString>>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>, ZodUnion<readonly [ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; enum: ZodArray<ZodString>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>, ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; oneOf: ZodArray<ZodObject<{ const: ZodString; title: ZodString; }, $strip>>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>]>, ZodUnion<readonly [ZodObject<{ default: ZodOptional<ZodArray<ZodString>>; description: ZodOptional<ZodString>; items: ZodObject<{ enum: ZodArray<ZodString>; type: ZodLiteral<"string">; }, $strip>; maxItems: ZodOptional<ZodNumber>; minItems: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"array">; }, $strip>, ZodObject<{ default: ZodOptional<ZodArray<ZodString>>; description: ZodOptional<ZodString>; items: ZodObject<{ anyOf: ZodArray<ZodObject<{ const: ...; title: ...; }, $strip>>; }, $strip>; maxItems: ZodOptional<ZodNumber>; minItems: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"array">; }, $strip>]>]>

Defined in: src/types.ts:1971

Primitive schema definition for enum fields.


GetPromptRequestParamsSchema

const GetPromptRequestParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; arguments: ZodOptional<ZodRecord<ZodString, ZodString>>; name: ZodString; }, $strip>

Defined in: src/types.ts:1123

Parameters for a prompts/get request.


GetPromptRequestSchema

const GetPromptRequestSchema: ZodObject<{ method: ZodLiteral<"prompts/get">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; arguments: ZodOptional<ZodRecord<ZodString, ZodString>>; name: ZodString; }, $strip>; }, $strip>

Defined in: src/types.ts:1136

Used by the client to get a prompt provided by the server.


GetPromptResultSchema

const GetPromptResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; description: ZodOptional<ZodString>; messages: ZodArray<ZodObject<{ content: ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; annotations: ZodOptional<ZodObject<..., ...>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; annotations: ZodOptional<ZodObject<..., ...>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; annotations: ZodOptional<ZodObject<..., ...>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodObject<..., ...>>; annotations: ZodOptional<ZodObject<..., ...>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<...>>; mimeType: ZodOptional<ZodString>; name: ZodString; size: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"resource_link">; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; annotations: ZodOptional<ZodObject<..., ...>>; resource: ZodUnion<readonly [..., ...]>; type: ZodLiteral<"resource">; }, $strip>]>; role: ZodEnum<{ assistant: "assistant"; user: "user"; }>; }, $strip>>; }, $loose>

Defined in: src/types.ts:1291

The server's response to a prompts/get request from the client.


GetTaskPayloadRequestSchema

const GetTaskPayloadRequestSchema: ZodObject<{ method: ZodLiteral<"tasks/result">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; taskId: ZodString; }, $strip>; }, $strip>

Defined in: src/types.ts:766

A request to get the result of a specific task.


GetTaskPayloadResultSchema

const GetTaskPayloadResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; }, $loose>

Defined in: src/types.ts:779

The response to a tasks/result request. The structure matches the result type of the original request. For example, a tools/call task would return the CallToolResult structure.


GetTaskRequestSchema

const GetTaskRequestSchema: ZodObject<{ method: ZodLiteral<"tasks/get">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; taskId: ZodString; }, $strip>; }, $strip>

Defined in: src/types.ts:751

A request to get the state of a specific task.


GetTaskResultSchema

const GetTaskResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>

Defined in: src/types.ts:761

The response to a tasks/get request.


IconSchema

const IconSchema: ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<ZodString>>; src: ZodString; theme: ZodOptional<ZodEnum<{ dark: "dark"; light: "light"; }>>; }, $strip>

Defined in: src/types.ts:296

Icon schema for use in tools, prompts, resources, and implementations.


IconsSchema

const IconsSchema: ZodObject<{ icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<ZodString>>; src: ZodString; theme: ZodOptional<ZodEnum<{ dark: "dark"; light: "light"; }>>; }, $strip>>>; }, $strip>

Defined in: src/types.ts:326

Base schema to add icons property.


ImageContentSchema

const ImageContentSchema: ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: "assistant"; user: "user"; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>

Defined in: src/types.ts:1166

An image provided to or from an LLM.


ImplementationSchema

const ImplementationSchema: ZodObject<{ description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<ZodString>>; src: ZodString; theme: ZodOptional<ZodEnum<{ dark: "dark"; light: "light"; }>>; }, $strip>>>; name: ZodString; title: ZodOptional<ZodString>; version: ZodString; websiteUrl: ZodOptional<ZodString>; }, $strip>

Defined in: src/types.ts:362

Describes the name and version of an MCP implementation.


InitializedNotificationSchema

const InitializedNotificationSchema: ZodObject<{ method: ZodLiteral<"notifications/initialized">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; }, $strip>>; }, $strip>

Defined in: src/types.ts:624

This notification is sent from the client to the server after initialization has finished.


InitializeRequestParamsSchema

const InitializeRequestParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; capabilities: ZodObject<{ elicitation: ZodOptional<ZodPipe<ZodTransform<unknown, unknown>, ZodIntersection<ZodObject<{ form: ZodOptional<ZodIntersection<..., ...>>; url: ZodOptional<ZodCustom<..., ...>>; }, $strip>, ZodOptional<ZodRecord<ZodString, ZodUnknown>>>>>; experimental: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; extensions: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; roots: ZodOptional<ZodObject<{ listChanged: ZodOptional<ZodBoolean>; }, $strip>>; sampling: ZodOptional<ZodObject<{ context: ZodOptional<ZodCustom<object, object>>; tools: ZodOptional<ZodCustom<object, object>>; }, $strip>>; tasks: ZodOptional<ZodObject<{ cancel: ZodOptional<ZodCustom<object, object>>; list: ZodOptional<ZodCustom<object, object>>; requests: ZodOptional<ZodObject<{ elicitation: ZodOptional<...>; sampling: ZodOptional<...>; }, $loose>>; }, $loose>>; }, $strip>; clientInfo: ZodObject<{ description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<ZodString>>; src: ZodString; theme: ZodOptional<ZodEnum<{ dark: ...; light: ...; }>>; }, $strip>>>; name: ZodString; title: ZodOptional<ZodString>; version: ZodString; websiteUrl: ZodOptional<ZodString>; }, $strip>; protocolVersion: ZodString; }, $strip>

Defined in: src/types.ts:521


InitializeRequestSchema

const InitializeRequestSchema: ZodObject<{ method: ZodLiteral<"initialize">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; capabilities: ZodObject<{ elicitation: ZodOptional<ZodPipe<ZodTransform<unknown, unknown>, ZodIntersection<ZodObject<{ form: ...; url: ...; }, $strip>, ZodOptional<ZodRecord<..., ...>>>>>; experimental: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; extensions: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; roots: ZodOptional<ZodObject<{ listChanged: ZodOptional<ZodBoolean>; }, $strip>>; sampling: ZodOptional<ZodObject<{ context: ZodOptional<ZodCustom<..., ...>>; tools: ZodOptional<ZodCustom<..., ...>>; }, $strip>>; tasks: ZodOptional<ZodObject<{ cancel: ZodOptional<ZodCustom<..., ...>>; list: ZodOptional<ZodCustom<..., ...>>; requests: ZodOptional<ZodObject<..., ...>>; }, $loose>>; }, $strip>; clientInfo: ZodObject<{ description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<...>; sizes: ZodOptional<...>; src: ZodString; theme: ZodOptional<...>; }, $strip>>>; name: ZodString; title: ZodOptional<ZodString>; version: ZodString; websiteUrl: ZodOptional<ZodString>; }, $strip>; protocolVersion: ZodString; }, $strip>; }, $strip>

Defined in: src/types.ts:532

This request is sent from the client to the server when it first connects, asking it to begin initialization.


InitializeResultSchema

const InitializeResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; capabilities: ZodObject<{ completions: ZodOptional<ZodCustom<object, object>>; experimental: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; extensions: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; logging: ZodOptional<ZodCustom<object, object>>; prompts: ZodOptional<ZodObject<{ listChanged: ZodOptional<ZodBoolean>; }, $strip>>; resources: ZodOptional<ZodObject<{ listChanged: ZodOptional<ZodBoolean>; subscribe: ZodOptional<ZodBoolean>; }, $strip>>; tasks: ZodOptional<ZodObject<{ cancel: ZodOptional<ZodCustom<object, object>>; list: ZodOptional<ZodCustom<object, object>>; requests: ZodOptional<ZodObject<{ tools: ZodOptional<...>; }, $loose>>; }, $loose>>; tools: ZodOptional<ZodObject<{ listChanged: ZodOptional<ZodBoolean>; }, $strip>>; }, $strip>; instructions: ZodOptional<ZodString>; protocolVersion: ZodString; serverInfo: ZodObject<{ description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<ZodString>>; src: ZodString; theme: ZodOptional<ZodEnum<{ dark: ...; light: ...; }>>; }, $strip>>>; name: ZodString; title: ZodOptional<ZodString>; version: ZodString; websiteUrl: ZodOptional<ZodString>; }, $strip>; }, $loose>

Defined in: src/types.ts:606

After receiving an initialize request from the client, the server sends this response.


isJSONRPCError

const isJSONRPCError: (value) => value is { error: { code: number; data?: unknown; message: string }; id?: string | number; jsonrpc: "2.0" } = isJSONRPCErrorResponse

Defined in: src/types.ts:248

Checks if a value is a valid JSONRPCErrorResponse.

Parameters

value

unknown

The value to check.

Returns

value is { error: { code: number; data?: unknown; message: string }; id?: string | number; jsonrpc: "2.0" }

True if the value is a valid JSONRPCErrorResponse, false otherwise.

Deprecated

Use isJSONRPCErrorResponse instead.


isJSONRPCResponse

const isJSONRPCResponse: (value) => value is { id: string | number; jsonrpc: "2.0"; result: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; [key: string]: unknown } } = isJSONRPCResultResponse

Defined in: src/types.ts:186

Checks if a value is a valid JSONRPCResultResponse.

Parameters

value

unknown

The value to check.

Returns

value is { id: string | number; jsonrpc: "2.0"; result: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; [key: string]: unknown } }

True if the value is a valid JSONRPCResultResponse, false otherwise.

Deprecated

Use isJSONRPCResultResponse instead.

Please note that JSONRPCResponse is a union of JSONRPCResultResponse and JSONRPCErrorResponse as per the updated JSON-RPC specification. (was previously just JSONRPCResultResponse)


JSONRPC_VERSION

const JSONRPC_VERSION: "2.0" = '2.0'

Defined in: src/types.ts:11


JSONRPCErrorResponseSchema

const JSONRPCErrorResponseSchema: ZodObject<{ error: ZodObject<{ code: ZodNumber; data: ZodOptional<ZodUnknown>; message: ZodString; }, $strip>; id: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; jsonrpc: ZodLiteral<"2.0">; }, $strict>

Defined in: src/types.ts:210

A response to a request that indicates an error occurred.


JSONRPCErrorSchema

const JSONRPCErrorSchema: ZodObject<{ error: ZodObject<{ code: ZodNumber; data: ZodOptional<ZodUnknown>; message: ZodString; }, $strip>; id: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; jsonrpc: ZodLiteral<"2.0">; }, $strict> = JSONRPCErrorResponseSchema

Defined in: src/types.ts:234

Deprecated

Use JSONRPCErrorResponseSchema instead.


JSONRPCMessageSchema

const JSONRPCMessageSchema: ZodUnion<readonly [ZodObject<{ id: ZodUnion<readonly [ZodString, ZodNumber]>; jsonrpc: ZodLiteral<"2.0">; method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; }, $loose>>; }, $strict>, ZodObject<{ jsonrpc: ZodLiteral<"2.0">; method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; }, $loose>>; }, $strict>, ZodObject<{ id: ZodUnion<readonly [ZodString, ZodNumber]>; jsonrpc: ZodLiteral<"2.0">; result: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; }, $loose>; }, $strict>, ZodObject<{ error: ZodObject<{ code: ZodNumber; data: ZodOptional<ZodUnknown>; message: ZodString; }, $strip>; id: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; jsonrpc: ZodLiteral<"2.0">; }, $strict>]>

Defined in: src/types.ts:250


JSONRPCNotificationSchema

const JSONRPCNotificationSchema: ZodObject<{ jsonrpc: ZodLiteral<"2.0">; method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; }, $loose>>; }, $strict>

Defined in: src/types.ts:152

A notification which does not expect a response.


JSONRPCRequestSchema

const JSONRPCRequestSchema: ZodObject<{ id: ZodUnion<readonly [ZodString, ZodNumber]>; jsonrpc: ZodLiteral<"2.0">; method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; }, $loose>>; }, $strict>

Defined in: src/types.ts:139

A request that expects a response.


JSONRPCResponseSchema

const JSONRPCResponseSchema: ZodUnion<readonly [ZodObject<{ id: ZodUnion<readonly [ZodString, ZodNumber]>; jsonrpc: ZodLiteral<"2.0">; result: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; }, $loose>; }, $strict>, ZodObject<{ error: ZodObject<{ code: ZodNumber; data: ZodOptional<ZodUnknown>; message: ZodString; }, $strip>; id: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; jsonrpc: ZodLiteral<"2.0">; }, $strict>]>

Defined in: src/types.ts:257


JSONRPCResultResponseSchema

const JSONRPCResultResponseSchema: ZodObject<{ id: ZodUnion<readonly [ZodString, ZodNumber]>; jsonrpc: ZodLiteral<"2.0">; result: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; }, $loose>; }, $strict>

Defined in: src/types.ts:164

A successful (non-error) response to a request.


LATEST_PROTOCOL_VERSION

const LATEST_PROTOCOL_VERSION: "2025-11-25" = '2025-11-25'

Defined in: src/types.ts:4


LegacyTitledEnumSchemaSchema

const LegacyTitledEnumSchemaSchema: ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; enum: ZodArray<ZodString>; enumNames: ZodOptional<ZodArray<ZodString>>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>

Defined in: src/types.ts:1915

Use TitledSingleSelectEnumSchema instead. This interface will be removed in a future version.


ListChangedOptionsBaseSchema

const ListChangedOptionsBaseSchema: ZodObject<{ autoRefresh: ZodDefault<ZodBoolean>; debounceMs: ZodDefault<ZodNumber>; }, $strip>

Defined in: src/types.ts:1525

Base schema for list changed subscription options (without callback). Used internally for Zod validation of autoRefresh and debounceMs.


ListPromptsRequestSchema

const ListPromptsRequestSchema: ZodObject<{ method: ZodLiteral<"prompts/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>>; }, $strip>

Defined in: src/types.ts:1109

Sent from the client to request a list of prompts and prompt templates the server has.


ListPromptsResultSchema

const ListPromptsResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; nextCursor: ZodOptional<ZodString>; prompts: ZodArray<ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; arguments: ZodOptional<ZodArray<ZodObject<{ description: ZodOptional<ZodString>; name: ZodString; required: ZodOptional<ZodBoolean>; }, $strip>>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<...>>; src: ZodString; theme: ZodOptional<ZodEnum<...>>; }, $strip>>>; name: ZodString; title: ZodOptional<ZodString>; }, $strip>>; }, $loose>

Defined in: src/types.ts:1116

The server's response to a prompts/list request from the client.


ListResourcesRequestSchema

const ListResourcesRequestSchema: ZodObject<{ method: ZodLiteral<"resources/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>>; }, $strip>

Defined in: src/types.ts:968

Sent from the client to request a list of resources the server has.


ListResourcesResultSchema

const ListResourcesResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; nextCursor: ZodOptional<ZodString>; resources: ZodArray<ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<...>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<...>>; src: ZodString; theme: ZodOptional<ZodEnum<...>>; }, $strip>>>; mimeType: ZodOptional<ZodString>; name: ZodString; size: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; uri: ZodString; }, $strip>>; }, $loose>

Defined in: src/types.ts:975

The server's response to a resources/list request from the client.


ListResourceTemplatesRequestSchema

const ListResourceTemplatesRequestSchema: ZodObject<{ method: ZodLiteral<"resources/templates/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>>; }, $strip>

Defined in: src/types.ts:982

Sent from the client to request a list of resource templates the server has.


ListResourceTemplatesResultSchema

const ListResourceTemplatesResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; nextCursor: ZodOptional<ZodString>; resourceTemplates: ZodArray<ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<...>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<...>>; src: ZodString; theme: ZodOptional<ZodEnum<...>>; }, $strip>>>; mimeType: ZodOptional<ZodString>; name: ZodString; title: ZodOptional<ZodString>; uriTemplate: ZodString; }, $strip>>; }, $loose>

Defined in: src/types.ts:989

The server's response to a resources/templates/list request from the client.


ListRootsRequestSchema

const ListRootsRequestSchema: ZodObject<{ method: ZodLiteral<"roots/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; }, $strip>>; }, $strip>

Defined in: src/types.ts:2207

Sent from the server to request a list of root URIs from the client.


ListRootsResultSchema

const ListRootsResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; roots: ZodArray<ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; name: ZodOptional<ZodString>; uri: ZodString; }, $strip>>; }, $loose>

Defined in: src/types.ts:2215

The client's response to a roots/list request from the server.


ListTasksRequestSchema

const ListTasksRequestSchema: ZodObject<{ method: ZodLiteral<"tasks/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>>; }, $strip>

Defined in: src/types.ts:784

A request to list tasks.


ListTasksResultSchema

const ListTasksResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; nextCursor: ZodOptional<ZodString>; tasks: ZodArray<ZodObject<{ createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>>; }, $loose>

Defined in: src/types.ts:791

The response to a tasks/list request.


ListToolsRequestSchema

const ListToolsRequestSchema: ZodObject<{ method: ZodLiteral<"tools/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>>; }, $strip>

Defined in: src/types.ts:1430

Sent from the client to request a list of tools the server has.


ListToolsResultSchema

const ListToolsResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; nextCursor: ZodOptional<ZodString>; tools: ZodArray<ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ destructiveHint: ZodOptional<ZodBoolean>; idempotentHint: ZodOptional<ZodBoolean>; openWorldHint: ZodOptional<ZodBoolean>; readOnlyHint: ZodOptional<ZodBoolean>; title: ZodOptional<ZodString>; }, $strip>>; description: ZodOptional<ZodString>; execution: ZodOptional<ZodObject<{ taskSupport: ZodOptional<ZodEnum<{ forbidden: ...; optional: ...; required: ...; }>>; }, $strip>>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<...>>; src: ZodString; theme: ZodOptional<ZodEnum<...>>; }, $strip>>>; inputSchema: ZodObject<{ properties: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; required: ZodOptional<ZodArray<ZodString>>; type: ZodLiteral<"object">; }, $catchall<ZodUnknown>>; name: ZodString; outputSchema: ZodOptional<ZodObject<{ properties: ZodOptional<ZodRecord<ZodString, ZodCustom<..., ...>>>; required: ZodOptional<ZodArray<ZodString>>; type: ZodLiteral<"object">; }, $catchall<ZodUnknown>>>; title: ZodOptional<ZodString>; }, $strip>>; }, $loose>

Defined in: src/types.ts:1437

The server's response to a tools/list request from the client.


LoggingLevelSchema

const LoggingLevelSchema: ZodEnum<{ alert: "alert"; critical: "critical"; debug: "debug"; emergency: "emergency"; error: "error"; info: "info"; notice: "notice"; warning: "warning"; }>

Defined in: src/types.ts:1600

The severity of a log message.


LoggingMessageNotificationParamsSchema

const LoggingMessageNotificationParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; data: ZodUnknown; level: ZodEnum<{ alert: "alert"; critical: "critical"; debug: "debug"; emergency: "emergency"; error: "error"; info: "info"; notice: "notice"; warning: "warning"; }>; logger: ZodOptional<ZodString>; }, $strip>

Defined in: src/types.ts:1622

Parameters for a notifications/message notification.


LoggingMessageNotificationSchema

const LoggingMessageNotificationSchema: ZodObject<{ method: ZodLiteral<"notifications/message">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; data: ZodUnknown; level: ZodEnum<{ alert: "alert"; critical: "critical"; debug: "debug"; emergency: "emergency"; error: "error"; info: "info"; notice: "notice"; warning: "warning"; }>; logger: ZodOptional<ZodString>; }, $strip>; }, $strip>

Defined in: src/types.ts:1639

Notification of a log message passed from server to client. If no logging/setLevel request has been sent from the client, the server MAY decide which messages to send automatically.


ModelHintSchema

const ModelHintSchema: ZodObject<{ name: ZodOptional<ZodString>; }, $strip>

Defined in: src/types.ts:1648

Hints to use for model selection.


ModelPreferencesSchema

const ModelPreferencesSchema: ZodObject<{ costPriority: ZodOptional<ZodNumber>; hints: ZodOptional<ZodArray<ZodObject<{ name: ZodOptional<ZodString>; }, $strip>>>; intelligencePriority: ZodOptional<ZodNumber>; speedPriority: ZodOptional<ZodNumber>; }, $strip>

Defined in: src/types.ts:1658

The server's preferences for model selection, requested of the client during sampling.


MultiSelectEnumSchemaSchema

const MultiSelectEnumSchemaSchema: ZodUnion<readonly [ZodObject<{ default: ZodOptional<ZodArray<ZodString>>; description: ZodOptional<ZodString>; items: ZodObject<{ enum: ZodArray<ZodString>; type: ZodLiteral<"string">; }, $strip>; maxItems: ZodOptional<ZodNumber>; minItems: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"array">; }, $strip>, ZodObject<{ default: ZodOptional<ZodArray<ZodString>>; description: ZodOptional<ZodString>; items: ZodObject<{ anyOf: ZodArray<ZodObject<{ const: ZodString; title: ZodString; }, $strip>>; }, $strip>; maxItems: ZodOptional<ZodNumber>; minItems: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"array">; }, $strip>]>

Defined in: src/types.ts:1966

Combined schema for multiple-selection enumeration


NotificationSchema

const NotificationSchema: ZodObject<{ method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; }, $loose>>; }, $strip>

Defined in: src/types.ts:118


NumberSchemaSchema

const NumberSchemaSchema: ZodObject<{ default: ZodOptional<ZodNumber>; description: ZodOptional<ZodString>; maximum: ZodOptional<ZodNumber>; minimum: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodEnum<{ integer: "integer"; number: "number"; }>; }, $strip>

Defined in: src/types.ts:1875

Primitive schema definition for number fields.


PaginatedRequestParamsSchema

const PaginatedRequestParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>

Defined in: src/types.ts:675


PaginatedRequestSchema

const PaginatedRequestSchema: ZodObject<{ method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>>; }, $strip>

Defined in: src/types.ts:684


PaginatedResultSchema

const PaginatedResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; nextCursor: ZodOptional<ZodString>; }, $loose>

Defined in: src/types.ts:688


PingRequestSchema

const PingRequestSchema: ZodObject<{ method: ZodLiteral<"ping">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; }, $strip>>; }, $strip>

Defined in: src/types.ts:636

A ping, issued by either the server or the client, to check that the other party is still alive. The receiver must promptly respond, or else may be disconnected.


PrimitiveSchemaDefinitionSchema

const PrimitiveSchemaDefinitionSchema: ZodUnion<readonly [ZodUnion<readonly [ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; enum: ZodArray<ZodString>; enumNames: ZodOptional<ZodArray<ZodString>>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>, ZodUnion<readonly [ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; enum: ZodArray<ZodString>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>, ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; oneOf: ZodArray<ZodObject<{ const: ...; title: ...; }, $strip>>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>]>, ZodUnion<readonly [ZodObject<{ default: ZodOptional<ZodArray<ZodString>>; description: ZodOptional<ZodString>; items: ZodObject<{ enum: ZodArray<...>; type: ZodLiteral<...>; }, $strip>; maxItems: ZodOptional<ZodNumber>; minItems: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"array">; }, $strip>, ZodObject<{ default: ZodOptional<ZodArray<ZodString>>; description: ZodOptional<ZodString>; items: ZodObject<{ anyOf: ZodArray<...>; }, $strip>; maxItems: ZodOptional<ZodNumber>; minItems: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"array">; }, $strip>]>]>, ZodObject<{ default: ZodOptional<ZodBoolean>; description: ZodOptional<ZodString>; title: ZodOptional<ZodString>; type: ZodLiteral<"boolean">; }, $strip>, ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; format: ZodOptional<ZodEnum<{ date: "date"; date-time: "date-time"; email: "email"; uri: "uri"; }>>; maxLength: ZodOptional<ZodNumber>; minLength: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>, ZodObject<{ default: ZodOptional<ZodNumber>; description: ZodOptional<ZodString>; maximum: ZodOptional<ZodNumber>; minimum: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodEnum<{ integer: "integer"; number: "number"; }>; }, $strip>]>

Defined in: src/types.ts:1976

Union of all primitive schema definitions.


ProgressNotificationParamsSchema

const ProgressNotificationParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; message: ZodOptional<ZodString>; progress: ZodNumber; progressToken: ZodUnion<readonly [ZodString, ZodNumber]>; total: ZodOptional<ZodNumber>; }, $strip>

Defined in: src/types.ts:657


ProgressSchema

const ProgressSchema: ZodObject<{ message: ZodOptional<ZodString>; progress: ZodNumber; total: ZodOptional<ZodNumber>; }, $strip>

Defined in: src/types.ts:642


ProgressTokenSchema

const ProgressTokenSchema: ZodUnion<readonly [ZodString, ZodNumber]>

Defined in: src/types.ts:26

A progress token, used to associate progress notifications with the original request.


PromptArgumentSchema

const PromptArgumentSchema: ZodObject<{ description: ZodOptional<ZodString>; name: ZodString; required: ZodOptional<ZodBoolean>; }, $strip>

Defined in: src/types.ts:1070

Describes an argument that a prompt can accept.


PromptListChangedNotificationSchema

const PromptListChangedNotificationSchema: ZodObject<{ method: ZodLiteral<"notifications/prompts/list_changed">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; }, $strip>>; }, $strip>

Defined in: src/types.ts:1302

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.


PromptMessageSchema

const PromptMessageSchema: ZodObject<{ content: ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<...>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<...>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<...>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<...>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<...>; sizes: ZodOptional<...>; src: ZodString; theme: ZodOptional<...>; }, $strip>>>; mimeType: ZodOptional<ZodString>; name: ZodString; size: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"resource_link">; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<...>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; resource: ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<...>; mimeType: ZodOptional<...>; text: ZodString; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; blob: ZodString; mimeType: ZodOptional<...>; uri: ZodString; }, $strip>]>; type: ZodLiteral<"resource">; }, $strip>]>; role: ZodEnum<{ assistant: "assistant"; user: "user"; }>; }, $strip>

Defined in: src/types.ts:1283

Describes a message returned as part of a prompt.


PromptReferenceSchema

const PromptReferenceSchema: ZodObject<{ name: ZodString; type: ZodLiteral<"ref/prompt">; }, $strip>

Defined in: src/types.ts:2106

Identifies a prompt.


PromptSchema

const PromptSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; arguments: ZodOptional<ZodArray<ZodObject<{ description: ZodOptional<ZodString>; name: ZodString; required: ZodOptional<ZodBoolean>; }, $strip>>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<ZodString>>; src: ZodString; theme: ZodOptional<ZodEnum<{ dark: "dark"; light: "light"; }>>; }, $strip>>>; name: ZodString; title: ZodOptional<ZodString>; }, $strip>

Defined in: src/types.ts:1088

A prompt or prompt template that the server offers.


ReadResourceRequestParamsSchema

const ReadResourceRequestParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; uri: ZodString; }, $strip> = ResourceRequestParamsSchema

Defined in: src/types.ts:1005

Parameters for a resources/read request.


ReadResourceRequestSchema

const ReadResourceRequestSchema: ZodObject<{ method: ZodLiteral<"resources/read">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; uri: ZodString; }, $strip>; }, $strip>

Defined in: src/types.ts:1010

Sent from the client to the server, to read a specific resource URI.


ReadResourceResultSchema

const ReadResourceResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; contents: ZodArray<ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; mimeType: ZodOptional<ZodString>; text: ZodString; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; blob: ZodString; mimeType: ZodOptional<ZodString>; uri: ZodString; }, $strip>]>>; }, $loose>

Defined in: src/types.ts:1018

The server's response to a resources/read request from the client.


const RELATED_TASK_META_KEY: "io.modelcontextprotocol/related-task" = 'io.modelcontextprotocol/related-task'

Defined in: src/types.ts:8


RelatedTaskMetadataSchema

const RelatedTaskMetadataSchema: ZodObject<{ taskId: ZodString; }, $strip>

Defined in: src/types.ts:56

Metadata for associating messages with a task. Include this in the _meta field under the key io.modelcontextprotocol/related-task.


RequestIdSchema

const RequestIdSchema: ZodUnion<readonly [ZodString, ZodNumber]>

Defined in: src/types.ts:134

A uniquely identifying ID for a request in JSON-RPC.


RequestSchema

const RequestSchema: ZodObject<{ method: ZodString; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; }, $loose>>; }, $strip>

Defined in: src/types.ts:105


ResourceContentsSchema

const ResourceContentsSchema: ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; mimeType: ZodOptional<ZodString>; uri: ZodString; }, $strip>

Defined in: src/types.ts:814

The contents of a specific resource or sub-resource.


ResourceLinkSchema

const ResourceLinkSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: "assistant"; user: "user"; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<ZodString>>; src: ZodString; theme: ZodOptional<ZodEnum<{ dark: "dark"; light: "light"; }>>; }, $strip>>>; mimeType: ZodOptional<ZodString>; name: ZodString; size: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"resource_link">; uri: ZodString; }, $strip>

Defined in: src/types.ts:1265

A resource that the server is capable of reading, included in a prompt or tool call result.

Note: resource links returned by tools are not guaranteed to appear in the results of resources/list requests.


ResourceListChangedNotificationSchema

const ResourceListChangedNotificationSchema: ZodObject<{ method: ZodLiteral<"notifications/resources/list_changed">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; }, $strip>>; }, $strip>

Defined in: src/types.ts:1025

An optional notification from the server to the client, informing it that the list of resources it can read from has changed. This may be issued by servers without any previous subscription from the client.


ResourceReferenceSchema

const ResourceReferenceSchema: ZodObject<{ type: ZodLiteral<"ref/resource">; uri: ZodString; }, $strip> = ResourceTemplateReferenceSchema

Defined in: src/types.ts:2101

Deprecated

Use ResourceTemplateReferenceSchema instead


ResourceRequestParamsSchema

const ResourceRequestParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; uri: ZodString; }, $strip>

Defined in: src/types.ts:993


ResourceSchema

const ResourceSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: "assistant"; user: "user"; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<ZodString>>; src: ZodString; theme: ZodOptional<ZodEnum<{ dark: "dark"; light: "light"; }>>; }, $strip>>>; mimeType: ZodOptional<ZodString>; name: ZodString; size: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; uri: ZodString; }, $strip>

Defined in: src/types.ts:891

A known resource that the server is capable of reading.


ResourceTemplateReferenceSchema

const ResourceTemplateReferenceSchema: ZodObject<{ type: ZodLiteral<"ref/resource">; uri: ZodString; }, $strip>

Defined in: src/types.ts:2090

A reference to a resource or resource template definition.


ResourceTemplateSchema

const ResourceTemplateSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: "assistant"; user: "user"; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<ZodString>>; src: ZodString; theme: ZodOptional<ZodEnum<{ dark: "dark"; light: "light"; }>>; }, $strip>>>; mimeType: ZodOptional<ZodString>; name: ZodString; title: ZodOptional<ZodString>; uriTemplate: ZodString; }, $strip>

Defined in: src/types.ts:933

A template description for resources available on the server.


ResourceUpdatedNotificationParamsSchema

const ResourceUpdatedNotificationParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; uri: ZodString; }, $strip>

Defined in: src/types.ts:1051

Parameters for a notifications/resources/updated notification.


ResourceUpdatedNotificationSchema

const ResourceUpdatedNotificationSchema: ZodObject<{ method: ZodLiteral<"notifications/resources/updated">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; uri: ZodString; }, $strip>; }, $strip>

Defined in: src/types.ts:1061

A notification from the server to the client, informing it that a resource has changed and may need to be read again. This should only be sent if the client previously sent a resources/subscribe request.


ResultSchema

const ResultSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; }, $loose>

Defined in: src/types.ts:123


RoleSchema

const RoleSchema: ZodEnum<{ assistant: "assistant"; user: "user"; }>

Defined in: src/types.ts:866

The sender or recipient of messages and data in a conversation.


RootSchema

const RootSchema: ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; name: ZodOptional<ZodString>; uri: ZodString; }, $strip>

Defined in: src/types.ts:2187

Represents a root directory or file that the server can operate on.


RootsListChangedNotificationSchema

const RootsListChangedNotificationSchema: ZodObject<{ method: ZodLiteral<"notifications/roots/list_changed">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; }, $strip>>; }, $strip>

Defined in: src/types.ts:2222

A notification from the client to the server, informing it that the list of roots has changed.


SamplingContentSchema

const SamplingContentSchema: ZodDiscriminatedUnion<[ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: ...; user: ...; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: ...; user: ...; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: ...; user: ...; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>]>

Defined in: src/types.ts:1712

Basic content types for sampling responses (without tool use). Used for backwards-compatible CreateMessageResult when tools are not used.


SamplingMessageContentBlockSchema

const SamplingMessageContentBlockSchema: ZodDiscriminatedUnion<[ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: ...; user: ...; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: ...; user: ...; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: ...; user: ...; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; id: ZodString; input: ZodRecord<ZodString, ZodUnknown>; name: ZodString; type: ZodLiteral<"tool_use">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; content: ZodDefault<ZodArray<ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; text: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; data: ZodString; mimeType: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; data: ZodString; mimeType: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; description: ZodOptional<...>; icons: ZodOptional<...>; mimeType: ZodOptional<...>; name: ZodString; size: ZodOptional<...>; title: ZodOptional<...>; type: ZodLiteral<...>; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; resource: ZodUnion<...>; type: ZodLiteral<...>; }, $strip>]>>>; isError: ZodOptional<ZodBoolean>; structuredContent: ZodOptional<ZodObject<{ }, $loose>>; toolUseId: ZodString; type: ZodLiteral<"tool_result">; }, $strip>]>

Defined in: src/types.ts:1718

Content block types allowed in sampling messages. This includes text, image, audio, tool use requests, and tool results.


SamplingMessageSchema

const SamplingMessageSchema: ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; content: ZodUnion<readonly [ZodDiscriminatedUnion<[ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; id: ZodString; input: ZodRecord<ZodString, ZodUnknown>; name: ZodString; type: ZodLiteral<"tool_use">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; content: ZodDefault<ZodArray<ZodUnion<...>>>; isError: ZodOptional<ZodBoolean>; structuredContent: ZodOptional<ZodObject<{ }, $loose>>; toolUseId: ZodString; type: ZodLiteral<"tool_result">; }, $strip>]>, ZodArray<ZodDiscriminatedUnion<[ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; annotations: ZodOptional<ZodObject<..., ...>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; annotations: ZodOptional<ZodObject<..., ...>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; annotations: ZodOptional<ZodObject<..., ...>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; id: ZodString; input: ZodRecord<ZodString, ZodUnknown>; name: ZodString; type: ZodLiteral<"tool_use">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; content: ZodDefault<ZodArray<...>>; isError: ZodOptional<ZodBoolean>; structuredContent: ZodOptional<ZodObject<..., ...>>; toolUseId: ZodString; type: ZodLiteral<"tool_result">; }, $strip>]>>]>; role: ZodEnum<{ assistant: "assistant"; user: "user"; }>; }, $strip>

Defined in: src/types.ts:1729

Describes a message issued to or received from an LLM API.


ServerCapabilitiesSchema

const ServerCapabilitiesSchema: ZodObject<{ completions: ZodOptional<ZodCustom<object, object>>; experimental: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; extensions: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; logging: ZodOptional<ZodCustom<object, object>>; prompts: ZodOptional<ZodObject<{ listChanged: ZodOptional<ZodBoolean>; }, $strip>>; resources: ZodOptional<ZodObject<{ listChanged: ZodOptional<ZodBoolean>; subscribe: ZodOptional<ZodBoolean>; }, $strip>>; tasks: ZodOptional<ZodObject<{ cancel: ZodOptional<ZodCustom<object, object>>; list: ZodOptional<ZodCustom<object, object>>; requests: ZodOptional<ZodObject<{ tools: ZodOptional<ZodObject<{ call: ...; }, $loose>>; }, $loose>>; }, $loose>>; tools: ZodOptional<ZodObject<{ listChanged: ZodOptional<ZodBoolean>; }, $strip>>; }, $strip>

Defined in: src/types.ts:542

Capabilities that a server may support. Known capabilities are defined here, in this schema, but this is not a closed set: any server can define its own, additional capabilities.


ServerNotificationSchema

const ServerNotificationSchema: ZodUnion<readonly [ZodObject<{ method: ZodLiteral<"notifications/cancelled">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; reason: ZodOptional<ZodString>; requestId: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"notifications/progress">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; message: ZodOptional<ZodString>; progress: ZodNumber; progressToken: ZodUnion<readonly [ZodString, ZodNumber]>; total: ZodOptional<ZodNumber>; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"notifications/message">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; data: ZodUnknown; level: ZodEnum<{ alert: "alert"; critical: "critical"; debug: "debug"; emergency: "emergency"; error: "error"; info: "info"; notice: "notice"; warning: "warning"; }>; logger: ZodOptional<ZodString>; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"notifications/resources/updated">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; uri: ZodString; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"notifications/resources/list_changed">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"notifications/tools/list_changed">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"notifications/prompts/list_changed">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"notifications/tasks/status">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"notifications/elicitation/complete">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; elicitationId: ZodString; }, $strip>; }, $strip>]>

Defined in: src/types.ts:2279


ServerRequestSchema

const ServerRequestSchema: ZodUnion<readonly [ZodObject<{ method: ZodLiteral<"ping">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"sampling/createMessage">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; includeContext: ZodOptional<ZodEnum<{ allServers: "allServers"; none: "none"; thisServer: "thisServer"; }>>; maxTokens: ZodNumber; messages: ZodArray<ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; content: ZodUnion<readonly [..., ...]>; role: ZodEnum<{ assistant: ...; user: ...; }>; }, $strip>>; metadata: ZodOptional<ZodCustom<object, object>>; modelPreferences: ZodOptional<ZodObject<{ costPriority: ZodOptional<ZodNumber>; hints: ZodOptional<ZodArray<...>>; intelligencePriority: ZodOptional<ZodNumber>; speedPriority: ZodOptional<ZodNumber>; }, $strip>>; stopSequences: ZodOptional<ZodArray<ZodString>>; systemPrompt: ZodOptional<ZodString>; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; temperature: ZodOptional<ZodNumber>; toolChoice: ZodOptional<ZodObject<{ mode: ZodOptional<ZodEnum<...>>; }, $strip>>; tools: ZodOptional<ZodArray<ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; description: ZodOptional<...>; execution: ZodOptional<...>; icons: ZodOptional<...>; inputSchema: ZodObject<..., ...>; name: ZodString; outputSchema: ZodOptional<...>; title: ZodOptional<...>; }, $strip>>>; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"elicitation/create">; params: ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ...; progressToken: ...; }, $loose>>; message: ZodString; mode: ZodOptional<ZodLiteral<"form">>; requestedSchema: ZodObject<{ properties: ZodRecord<..., ...>; required: ZodOptional<...>; type: ZodLiteral<...>; }, $strip>; task: ZodOptional<ZodObject<{ ttl: ...; }, $strip>>; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ...; progressToken: ...; }, $loose>>; elicitationId: ZodString; message: ZodString; mode: ZodLiteral<"url">; task: ZodOptional<ZodObject<{ ttl: ...; }, $strip>>; url: ZodString; }, $strip>]>; }, $strip>, ZodObject<{ method: ZodLiteral<"roots/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"tasks/get">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; taskId: ZodString; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"tasks/result">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; taskId: ZodString; }, $strip>; }, $strip>, ZodObject<{ method: ZodLiteral<"tasks/list">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<...>; progressToken: ZodOptional<...>; }, $loose>>; cursor: ZodOptional<ZodString>; }, $strip>>; }, $strip>, ZodObject<{ method: ZodLiteral<"tasks/cancel">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<..., ...>>; progressToken: ZodOptional<ZodUnion<...>>; }, $loose>>; taskId: ZodString; }, $strip>; }, $strip>]>

Defined in: src/types.ts:2268


ServerResultSchema

const ServerResultSchema: ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; }, $strict>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; capabilities: ZodObject<{ completions: ZodOptional<ZodCustom<object, object>>; experimental: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; extensions: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; logging: ZodOptional<ZodCustom<object, object>>; prompts: ZodOptional<ZodObject<{ listChanged: ZodOptional<ZodBoolean>; }, $strip>>; resources: ZodOptional<ZodObject<{ listChanged: ZodOptional<ZodBoolean>; subscribe: ZodOptional<ZodBoolean>; }, $strip>>; tasks: ZodOptional<ZodObject<{ cancel: ZodOptional<ZodCustom<..., ...>>; list: ZodOptional<ZodCustom<..., ...>>; requests: ZodOptional<ZodObject<..., ...>>; }, $loose>>; tools: ZodOptional<ZodObject<{ listChanged: ZodOptional<ZodBoolean>; }, $strip>>; }, $strip>; instructions: ZodOptional<ZodString>; protocolVersion: ZodString; serverInfo: ZodObject<{ description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<...>; sizes: ZodOptional<...>; src: ZodString; theme: ZodOptional<...>; }, $strip>>>; name: ZodString; title: ZodOptional<ZodString>; version: ZodString; websiteUrl: ZodOptional<ZodString>; }, $strip>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; completion: ZodObject<{ hasMore: ZodOptional<ZodBoolean>; total: ZodOptional<ZodNumber>; values: ZodArray<ZodString>; }, $loose>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; description: ZodOptional<ZodString>; messages: ZodArray<ZodObject<{ content: ZodUnion<readonly [ZodObject<{ _meta: ...; annotations: ...; text: ...; type: ...; }, $strip>, ZodObject<{ _meta: ...; annotations: ...; data: ...; mimeType: ...; type: ...; }, $strip>, ZodObject<{ _meta: ...; annotations: ...; data: ...; mimeType: ...; type: ...; }, $strip>, ZodObject<{ _meta: ...; annotations: ...; description: ...; icons: ...; mimeType: ...; name: ...; size: ...; title: ...; type: ...; uri: ...; }, $strip>, ZodObject<{ _meta: ...; annotations: ...; resource: ...; type: ...; }, $strip>]>; role: ZodEnum<{ assistant: "assistant"; user: "user"; }>; }, $strip>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; nextCursor: ZodOptional<ZodString>; prompts: ZodArray<ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; arguments: ZodOptional<ZodArray<ZodObject<{ description: ...; name: ...; required: ...; }, $strip>>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ...; sizes: ...; src: ...; theme: ...; }, $strip>>>; name: ZodString; title: ZodOptional<ZodString>; }, $strip>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; nextCursor: ZodOptional<ZodString>; resources: ZodArray<ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<...>; lastModified: ZodOptional<...>; priority: ZodOptional<...>; }, $strip>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ...; sizes: ...; src: ...; theme: ...; }, $strip>>>; mimeType: ZodOptional<ZodString>; name: ZodString; size: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; uri: ZodString; }, $strip>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; nextCursor: ZodOptional<ZodString>; resourceTemplates: ZodArray<ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<...>; lastModified: ZodOptional<...>; priority: ZodOptional<...>; }, $strip>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ...; sizes: ...; src: ...; theme: ...; }, $strip>>>; mimeType: ZodOptional<ZodString>; name: ZodString; title: ZodOptional<ZodString>; uriTemplate: ZodString; }, $strip>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; contents: ZodArray<ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; mimeType: ZodOptional<ZodString>; text: ZodString; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<..., ...>>; blob: ZodString; mimeType: ZodOptional<ZodString>; uri: ZodString; }, $strip>]>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; content: ZodDefault<ZodArray<ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; text: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; data: ZodString; mimeType: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; data: ZodString; mimeType: ZodString; type: ZodLiteral<...>; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; description: ZodOptional<...>; icons: ZodOptional<...>; mimeType: ZodOptional<...>; name: ZodString; size: ZodOptional<...>; title: ZodOptional<...>; type: ZodLiteral<...>; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<...>; annotations: ZodOptional<...>; resource: ZodUnion<...>; type: ZodLiteral<...>; }, $strip>]>>>; isError: ZodOptional<ZodBoolean>; structuredContent: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; nextCursor: ZodOptional<ZodString>; tools: ZodArray<ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ destructiveHint: ZodOptional<...>; idempotentHint: ZodOptional<...>; openWorldHint: ZodOptional<...>; readOnlyHint: ZodOptional<...>; title: ZodOptional<...>; }, $strip>>; description: ZodOptional<ZodString>; execution: ZodOptional<ZodObject<{ taskSupport: ZodOptional<...>; }, $strip>>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ...; sizes: ...; src: ...; theme: ...; }, $strip>>>; inputSchema: ZodObject<{ properties: ZodOptional<ZodRecord<..., ...>>; required: ZodOptional<ZodArray<...>>; type: ZodLiteral<"object">; }, $catchall<ZodUnknown>>; name: ZodString; outputSchema: ZodOptional<ZodObject<{ properties: ZodOptional<...>; required: ZodOptional<...>; type: ZodLiteral<...>; }, $catchall<ZodUnknown>>>; title: ZodOptional<ZodString>; }, $strip>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; nextCursor: ZodOptional<ZodString>; tasks: ZodArray<ZodObject<{ createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>>; }, $loose>, ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; task: ZodObject<{ createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>; }, $loose>]>

Defined in: src/types.ts:2291


ServerTasksCapabilitySchema

const ServerTasksCapabilitySchema: ZodObject<{ cancel: ZodOptional<ZodCustom<object, object>>; list: ZodOptional<ZodCustom<object, object>>; requests: ZodOptional<ZodObject<{ tools: ZodOptional<ZodObject<{ call: ZodOptional<ZodCustom<object, object>>; }, $loose>>; }, $loose>>; }, $loose>

Defined in: src/types.ts:446

Task capabilities for servers, indicating which request types support task creation.


SetLevelRequestParamsSchema

const SetLevelRequestParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; level: ZodEnum<{ alert: "alert"; critical: "critical"; debug: "debug"; emergency: "emergency"; error: "error"; info: "info"; notice: "notice"; warning: "warning"; }>; }, $strip>

Defined in: src/types.ts:1605

Parameters for a logging/setLevel request.


SetLevelRequestSchema

const SetLevelRequestSchema: ZodObject<{ method: ZodLiteral<"logging/setLevel">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; level: ZodEnum<{ alert: "alert"; critical: "critical"; debug: "debug"; emergency: "emergency"; error: "error"; info: "info"; notice: "notice"; warning: "warning"; }>; }, $strip>; }, $strip>

Defined in: src/types.ts:1614

A request from the client to the server, to enable or adjust logging.


SingleSelectEnumSchemaSchema

const SingleSelectEnumSchemaSchema: ZodUnion<readonly [ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; enum: ZodArray<ZodString>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>, ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; oneOf: ZodArray<ZodObject<{ const: ZodString; title: ZodString; }, $strip>>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>]>

Defined in: src/types.ts:1925


StringSchemaSchema

const StringSchemaSchema: ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; format: ZodOptional<ZodEnum<{ date: "date"; date-time: "date-time"; email: "email"; uri: "uri"; }>>; maxLength: ZodOptional<ZodNumber>; minLength: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>

Defined in: src/types.ts:1862

Primitive schema definition for string fields.


SubscribeRequestParamsSchema

const SubscribeRequestParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; uri: ZodString; }, $strip> = ResourceRequestParamsSchema

Defined in: src/types.ts:1030


SubscribeRequestSchema

const SubscribeRequestSchema: ZodObject<{ method: ZodLiteral<"resources/subscribe">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; uri: ZodString; }, $strip>; }, $strip>

Defined in: src/types.ts:1034

Sent from the client to request resources/updated notifications from the server whenever a particular resource changes.


SUPPORTED_PROTOCOL_VERSIONS

const SUPPORTED_PROTOCOL_VERSIONS: string[]

Defined in: src/types.ts:6


TaskAugmentedRequestParamsSchema

const TaskAugmentedRequestParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; task: ZodOptional<ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>>; }, $strip>

Defined in: src/types.ts:84

Common params for any task-augmented request.


TaskCreationParamsSchema

const TaskCreationParamsSchema: ZodObject<{ pollInterval: ZodOptional<ZodNumber>; ttl: ZodOptional<ZodNumber>; }, $loose>

Defined in: src/types.ts:36

Task creation parameters, used to ask that the server create a task to represent a request.


TaskMetadataSchema

const TaskMetadataSchema: ZodObject<{ ttl: ZodOptional<ZodNumber>; }, $strip>

Defined in: src/types.ts:48


TaskSchema

const TaskSchema: ZodObject<{ createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>

Defined in: src/types.ts:705

A pollable state object associated with a request.


TaskStatusNotificationParamsSchema

const TaskStatusNotificationParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>

Defined in: src/types.ts:738

Parameters for task status notification.


TaskStatusNotificationSchema

const TaskStatusNotificationSchema: ZodObject<{ method: ZodLiteral<"notifications/tasks/status">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; createdAt: ZodString; lastUpdatedAt: ZodString; pollInterval: ZodOptional<ZodNumber>; status: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>; statusMessage: ZodOptional<ZodString>; taskId: ZodString; ttl: ZodUnion<readonly [ZodNumber, ZodNull]>; }, $strip>; }, $strip>

Defined in: src/types.ts:743

A notification sent when a task's status changes.


TaskStatusSchema

const TaskStatusSchema: ZodEnum<{ cancelled: "cancelled"; completed: "completed"; failed: "failed"; input_required: "input_required"; working: "working"; }>

Defined in: src/types.ts:699

The status of a task.


TextContentSchema

const TextContentSchema: ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ZodOptional<ZodArray<ZodEnum<{ assistant: "assistant"; user: "user"; }>>>; lastModified: ZodOptional<ZodISODateTime>; priority: ZodOptional<ZodNumber>; }, $strip>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>

Defined in: src/types.ts:1144

Text provided to or from an LLM.


TextResourceContentsSchema

const TextResourceContentsSchema: ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; mimeType: ZodOptional<ZodString>; text: ZodString; uri: ZodString; }, $strip>

Defined in: src/types.ts:830


TitledMultiSelectEnumSchemaSchema

const TitledMultiSelectEnumSchemaSchema: ZodObject<{ default: ZodOptional<ZodArray<ZodString>>; description: ZodOptional<ZodString>; items: ZodObject<{ anyOf: ZodArray<ZodObject<{ const: ZodString; title: ZodString; }, $strip>>; }, $strip>; maxItems: ZodOptional<ZodNumber>; minItems: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"array">; }, $strip>

Defined in: src/types.ts:1946

Schema for multiple-selection enumeration with display titles for each option.


TitledSingleSelectEnumSchemaSchema

const TitledSingleSelectEnumSchemaSchema: ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; oneOf: ZodArray<ZodObject<{ const: ZodString; title: ZodString; }, $strip>>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>

Defined in: src/types.ts:1898

Schema for single-selection enumeration with display titles for each option.


ToolAnnotationsSchema

const ToolAnnotationsSchema: ZodObject<{ destructiveHint: ZodOptional<ZodBoolean>; idempotentHint: ZodOptional<ZodBoolean>; openWorldHint: ZodOptional<ZodBoolean>; readOnlyHint: ZodOptional<ZodBoolean>; title: ZodOptional<ZodString>; }, $strip>

Defined in: src/types.ts:1318

Additional properties describing a Tool to clients.

NOTE: all properties in ToolAnnotations are hints. They are not guaranteed to provide a faithful description of tool behavior (including descriptive properties like title).

Clients should never make tool use decisions based on ToolAnnotations received from untrusted servers.


ToolChoiceSchema

const ToolChoiceSchema: ZodObject<{ mode: ZodOptional<ZodEnum<{ auto: "auto"; none: "none"; required: "required"; }>>; }, $strip>

Defined in: src/types.ts:1680

Controls tool usage behavior in sampling requests.


ToolExecutionSchema

const ToolExecutionSchema: ZodObject<{ taskSupport: ZodOptional<ZodEnum<{ forbidden: "forbidden"; optional: "optional"; required: "required"; }>>; }, $strip>

Defined in: src/types.ts:1365

Execution-related properties for a tool.


ToolListChangedNotificationSchema

const ToolListChangedNotificationSchema: ZodObject<{ method: ZodLiteral<"notifications/tools/list_changed">; params: ZodOptional<ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ...; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [..., ...]>>; }, $loose>>; }, $strip>>; }, $strip>

Defined in: src/types.ts:1511

An optional notification from the server to the client, informing it that the list of tools it offers has changed. This may be issued by servers without any previous subscription from the client.


ToolResultContentSchema

const ToolResultContentSchema: ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; content: ZodDefault<ZodArray<ZodUnion<readonly [ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; text: ZodString; type: ZodLiteral<"text">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"image">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; data: ZodString; mimeType: ZodString; type: ZodLiteral<"audio">; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodObject<{ }, $loose>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; description: ZodOptional<ZodString>; icons: ZodOptional<ZodArray<ZodObject<..., ...>>>; mimeType: ZodOptional<ZodString>; name: ZodString; size: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"resource_link">; uri: ZodString; }, $strip>, ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ audience: ...; lastModified: ...; priority: ...; }, $strip>>; resource: ZodUnion<readonly [ZodObject<..., ...>, ZodObject<..., ...>]>; type: ZodLiteral<"resource">; }, $strip>]>>>; isError: ZodOptional<ZodBoolean>; structuredContent: ZodOptional<ZodObject<{ }, $loose>>; toolUseId: ZodString; type: ZodLiteral<"tool_result">; }, $strip>

Defined in: src/types.ts:1694

The result of a tool execution, provided by the user (server). Represents the outcome of invoking a tool requested via ToolUseContent.


ToolSchema

const ToolSchema: ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; annotations: ZodOptional<ZodObject<{ destructiveHint: ZodOptional<ZodBoolean>; idempotentHint: ZodOptional<ZodBoolean>; openWorldHint: ZodOptional<ZodBoolean>; readOnlyHint: ZodOptional<ZodBoolean>; title: ZodOptional<ZodString>; }, $strip>>; description: ZodOptional<ZodString>; execution: ZodOptional<ZodObject<{ taskSupport: ZodOptional<ZodEnum<{ forbidden: "forbidden"; optional: "optional"; required: "required"; }>>; }, $strip>>; icons: ZodOptional<ZodArray<ZodObject<{ mimeType: ZodOptional<ZodString>; sizes: ZodOptional<ZodArray<ZodString>>; src: ZodString; theme: ZodOptional<ZodEnum<{ dark: "dark"; light: "light"; }>>; }, $strip>>>; inputSchema: ZodObject<{ properties: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; required: ZodOptional<ZodArray<ZodString>>; type: ZodLiteral<"object">; }, $catchall<ZodUnknown>>; name: ZodString; outputSchema: ZodOptional<ZodObject<{ properties: ZodOptional<ZodRecord<ZodString, ZodCustom<object, object>>>; required: ZodOptional<ZodArray<ZodString>>; type: ZodLiteral<"object">; }, $catchall<ZodUnknown>>>; title: ZodOptional<ZodString>; }, $strip>

Defined in: src/types.ts:1380

Definition for a tool the client can call.


ToolUseContentSchema

const ToolUseContentSchema: ZodObject<{ _meta: ZodOptional<ZodRecord<ZodString, ZodUnknown>>; id: ZodString; input: ZodRecord<ZodString, ZodUnknown>; name: ZodString; type: ZodLiteral<"tool_use">; }, $strip>

Defined in: src/types.ts:1219

A tool call request from an assistant (LLM). Represents the assistant's request to use a tool.


UnsubscribeRequestParamsSchema

const UnsubscribeRequestParamsSchema: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; uri: ZodString; }, $strip> = ResourceRequestParamsSchema

Defined in: src/types.ts:1039


UnsubscribeRequestSchema

const UnsubscribeRequestSchema: ZodObject<{ method: ZodLiteral<"resources/unsubscribe">; params: ZodObject<{ _meta: ZodOptional<ZodObject<{ io.modelcontextprotocol/related-task: ZodOptional<ZodObject<{ taskId: ZodString; }, $strip>>; progressToken: ZodOptional<ZodUnion<readonly [ZodString, ZodNumber]>>; }, $loose>>; uri: ZodString; }, $strip>; }, $strip>

Defined in: src/types.ts:1043

Sent from the client to request cancellation of resources/updated notifications from the server. This should follow a previous resources/subscribe request.


UntitledMultiSelectEnumSchemaSchema

const UntitledMultiSelectEnumSchemaSchema: ZodObject<{ default: ZodOptional<ZodArray<ZodString>>; description: ZodOptional<ZodString>; items: ZodObject<{ enum: ZodArray<ZodString>; type: ZodLiteral<"string">; }, $strip>; maxItems: ZodOptional<ZodNumber>; minItems: ZodOptional<ZodNumber>; title: ZodOptional<ZodString>; type: ZodLiteral<"array">; }, $strip>

Defined in: src/types.ts:1930

Schema for multiple-selection enumeration without display titles for options.


UntitledSingleSelectEnumSchemaSchema

const UntitledSingleSelectEnumSchemaSchema: ZodObject<{ default: ZodOptional<ZodString>; description: ZodOptional<ZodString>; enum: ZodArray<ZodString>; title: ZodOptional<ZodString>; type: ZodLiteral<"string">; }, $strip>

Defined in: src/types.ts:1887

Schema for single-selection enumeration without display titles for options.


assertCompleteRequestPrompt()

assertCompleteRequestPrompt(request): asserts request is { method: "completion/complete"; params: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; argument: { name: string; value: string }; context?: { arguments?: { [key: string]: string } }; ref: { name: string; type: "ref/prompt" } } }

Defined in: src/types.ts:2149

Parameters

request
method

"completion/complete" = ...

params

{ _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; argument: { name: string; value: string; }; context?: { arguments?: {[key: string]: string; }; }; ref: { name: string; type: "ref/prompt"; } | { type: "ref/resource"; uri: string; }; } = CompleteRequestParamsSchema

params._meta?

{[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; } = ...

See General fields: _meta for notes on _meta usage.

{ taskId: string; } = ...

If specified, this request is related to the provided task.

string = ...

params._meta.progressToken?

string | number = ...

If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.

params.argument

{ name: string; value: string; } = ...

The argument's information

params.argument.name

string = ...

The name of the argument

params.argument.value

string = ...

The value of the argument to use for completion matching.

params.context?

{ arguments?: {[key: string]: string; }; } = ...

params.context.arguments?

{[key: string]: string; } = ...

Previously-resolved variables in a URI template or prompt.

params.ref

{ name: string; type: "ref/prompt"; } | { type: "ref/resource"; uri: string; } = ...

Returns

asserts request is { method: "completion/complete"; params: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; argument: { name: string; value: string }; context?: { arguments?: { [key: string]: string } }; ref: { name: string; type: "ref/prompt" } } }


assertCompleteRequestResourceTemplate()

assertCompleteRequestResourceTemplate(request): asserts request is { method: "completion/complete"; params: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; argument: { name: string; value: string }; context?: { arguments?: { [key: string]: string } }; ref: { type: "ref/resource"; uri: string } } }

Defined in: src/types.ts:2156

Parameters

request
method

"completion/complete" = ...

params

{ _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; argument: { name: string; value: string; }; context?: { arguments?: {[key: string]: string; }; }; ref: { name: string; type: "ref/prompt"; } | { type: "ref/resource"; uri: string; }; } = CompleteRequestParamsSchema

params._meta?

{[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; } = ...

See General fields: _meta for notes on _meta usage.

{ taskId: string; } = ...

If specified, this request is related to the provided task.

string = ...

params._meta.progressToken?

string | number = ...

If specified, the caller is requesting out-of-band progress notifications for this request (as represented by notifications/progress). The value of this parameter is an opaque token that will be attached to any subsequent notifications. The receiver is not obligated to provide these notifications.

params.argument

{ name: string; value: string; } = ...

The argument's information

params.argument.name

string = ...

The name of the argument

params.argument.value

string = ...

The value of the argument to use for completion matching.

params.context?

{ arguments?: {[key: string]: string; }; } = ...

params.context.arguments?

{[key: string]: string; } = ...

Previously-resolved variables in a URI template or prompt.

params.ref

{ name: string; type: "ref/prompt"; } | { type: "ref/resource"; uri: string; } = ...

Returns

asserts request is { method: "completion/complete"; params: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; argument: { name: string; value: string }; context?: { arguments?: { [key: string]: string } }; ref: { type: "ref/resource"; uri: string } } }


isInitializedNotification()

isInitializedNotification(value): value is { method: "notifications/initialized"; params?: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown } } }

Defined in: src/types.ts:629

Parameters

value

unknown

Returns

value is { method: "notifications/initialized"; params?: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown } } }


isInitializeRequest()

isInitializeRequest(value): value is { method: "initialize"; params: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; capabilities: { elicitation?: { form?: { applyDefaults?: boolean; [key: string]: unknown }; url?: object; [key: string]: unknown }; experimental?: { [key: string]: object }; extensions?: { [key: string]: object }; roots?: { listChanged?: boolean }; sampling?: { context?: object; tools?: object }; tasks?: { cancel?: object; list?: object; requests?: { elicitation?: { create?: object; [key: string]: unknown }; sampling?: { createMessage?: object; [key: string]: unknown }; [key: string]: unknown }; [key: string]: unknown } }; clientInfo: { description?: string; icons?: { mimeType?: string; sizes?: string[]; src: string; theme?: "light" | "dark" }[]; name: string; title?: string; version: string; websiteUrl?: string }; protocolVersion: string } }

Defined in: src/types.ts:537

Parameters

value

unknown

Returns

value is { method: "initialize"; params: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; capabilities: { elicitation?: { form?: { applyDefaults?: boolean; [key: string]: unknown }; url?: object; [key: string]: unknown }; experimental?: { [key: string]: object }; extensions?: { [key: string]: object }; roots?: { listChanged?: boolean }; sampling?: { context?: object; tools?: object }; tasks?: { cancel?: object; list?: object; requests?: { elicitation?: { create?: object; [key: string]: unknown }; sampling?: { createMessage?: object; [key: string]: unknown }; [key: string]: unknown }; [key: string]: unknown } }; clientInfo: { description?: string; icons?: { mimeType?: string; sizes?: string[]; src: string; theme?: "light" | "dark" }[]; name: string; title?: string; version: string; websiteUrl?: string }; protocolVersion: string } }


isJSONRPCErrorResponse()

isJSONRPCErrorResponse(value): value is { error: { code: number; data?: unknown; message: string }; id?: string | number; jsonrpc: "2.0" }

Defined in: src/types.ts:242

Checks if a value is a valid JSONRPCErrorResponse.

Parameters

value

unknown

The value to check.

Returns

value is { error: { code: number; data?: unknown; message: string }; id?: string | number; jsonrpc: "2.0" }

True if the value is a valid JSONRPCErrorResponse, false otherwise.


isJSONRPCNotification()

isJSONRPCNotification(value): value is { jsonrpc: "2.0"; method: string; params?: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; [key: string]: unknown } }

Defined in: src/types.ts:159

Parameters

value

unknown

Returns

value is { jsonrpc: "2.0"; method: string; params?: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; [key: string]: unknown } }


isJSONRPCRequest()

isJSONRPCRequest(value): value is { id: string | number; jsonrpc: "2.0"; method: string; params?: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; [key: string]: unknown } }

Defined in: src/types.ts:147

Parameters

value

unknown

Returns

value is { id: string | number; jsonrpc: "2.0"; method: string; params?: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; [key: string]: unknown } }


isJSONRPCResultResponse()

isJSONRPCResultResponse(value): value is { id: string | number; jsonrpc: "2.0"; result: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; [key: string]: unknown } }

Defined in: src/types.ts:178

Checks if a value is a valid JSONRPCResultResponse.

Parameters

value

unknown

The value to check.

Returns

value is { id: string | number; jsonrpc: "2.0"; result: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; [key: string]: unknown } }

True if the value is a valid JSONRPCResultResponse, false otherwise.


isTaskAugmentedRequestParams()

isTaskAugmentedRequestParams(value): value is { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; task?: { ttl?: number } }

Defined in: src/types.ts:102

Checks if a value is a valid TaskAugmentedRequestParams.

Parameters

value

unknown

The value to check.

Returns

value is { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; task?: { ttl?: number } }

True if the value is a valid TaskAugmentedRequestParams, false otherwise.