MCP TypeScript SDK (V2) / @modelcontextprotocol/client / index
index
Namespaces
Enumerations
OAuthErrorCode
Defined in: packages/core-internal/src/auth/errors.ts:7
OAuth error codes as defined by RFC 6749 and extensions.
Enumeration Members
AccessDenied
AccessDenied:
"access_denied"
Defined in: packages/core-internal/src/auth/errors.ts:44
The resource owner or authorization server denied the request.
InsufficientScope
InsufficientScope:
"insufficient_scope"
Defined in: packages/core-internal/src/auth/errors.ts:94
The request requires higher privileges than provided by the access token.
InvalidClient
InvalidClient:
"invalid_client"
Defined in: packages/core-internal/src/auth/errors.ts:18
Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).
InvalidClientMetadata
InvalidClientMetadata:
"invalid_client_metadata"
Defined in: packages/core-internal/src/auth/errors.ts:84
The client metadata is invalid. (Custom error for dynamic client registration - RFC 7591)
InvalidGrant
InvalidGrant:
"invalid_grant"
Defined in: packages/core-internal/src/auth/errors.ts:24
The provided authorization grant or refresh token is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client.
InvalidRedirectUri
InvalidRedirectUri:
"invalid_redirect_uri"
Defined in: packages/core-internal/src/auth/errors.ts:89
The value of one or more redirection URIs is invalid. (Dynamic client registration - RFC 7591 §3.2.2)
InvalidRequest
InvalidRequest:
"invalid_request"
Defined in: packages/core-internal/src/auth/errors.ts:12
The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.
InvalidScope
InvalidScope:
"invalid_scope"
Defined in: packages/core-internal/src/auth/errors.ts:39
The requested scope is invalid, unknown, malformed, or exceeds the scope granted by the resource owner.
InvalidTarget
InvalidTarget:
"invalid_target"
Defined in: packages/core-internal/src/auth/errors.ts:99
The requested resource is invalid, missing, unknown, or malformed. (Custom error for resource indicators - RFC 8707)
InvalidToken
InvalidToken:
"invalid_token"
Defined in: packages/core-internal/src/auth/errors.ts:69
The access token provided is expired, revoked, malformed, or invalid for other reasons.
MethodNotAllowed
MethodNotAllowed:
"method_not_allowed"
Defined in: packages/core-internal/src/auth/errors.ts:74
The HTTP method used is not allowed for this endpoint. (Custom, non-standard error)
ServerError
ServerError:
"server_error"
Defined in: packages/core-internal/src/auth/errors.ts:49
The authorization server encountered an unexpected condition that prevented it from fulfilling the request.
TemporarilyUnavailable
TemporarilyUnavailable:
"temporarily_unavailable"
Defined in: packages/core-internal/src/auth/errors.ts:54
The authorization server is currently unable to handle the request due to temporary overloading or maintenance.
TooManyRequests
TooManyRequests:
"too_many_requests"
Defined in: packages/core-internal/src/auth/errors.ts:79
Rate limit exceeded. (Custom, non-standard error based on RFC 6585)
UnauthorizedClient
UnauthorizedClient:
"unauthorized_client"
Defined in: packages/core-internal/src/auth/errors.ts:29
The authenticated client is not authorized to use this authorization grant type.
UnsupportedGrantType
UnsupportedGrantType:
"unsupported_grant_type"
Defined in: packages/core-internal/src/auth/errors.ts:34
The authorization grant type is not supported by the authorization server.
UnsupportedResponseType
UnsupportedResponseType:
"unsupported_response_type"
Defined in: packages/core-internal/src/auth/errors.ts:59
The authorization server does not support obtaining an authorization code using this method.
UnsupportedTokenType
UnsupportedTokenType:
"unsupported_token_type"
Defined in: packages/core-internal/src/auth/errors.ts:64
The authorization server does not support the requested token type.
ProtocolErrorCode
Defined in: packages/core-internal/src/types/enums.ts:5
Error codes for protocol errors that cross the wire as JSON-RPC error responses. These follow the JSON-RPC specification and MCP-specific extensions.
Enumeration Members
InternalError
InternalError:
-32603
Defined in: packages/core-internal/src/types/enums.ts:11
InvalidParams
InvalidParams:
-32602
Defined in: packages/core-internal/src/types/enums.ts:10
InvalidRequest
InvalidRequest:
-32600
Defined in: packages/core-internal/src/types/enums.ts:8
MethodNotFound
MethodNotFound:
-32601
Defined in: packages/core-internal/src/types/enums.ts:9
MissingRequiredClientCapability
MissingRequiredClientCapability:
-32021
Defined in: packages/core-internal/src/types/enums.ts:30
Processing the request requires a capability the client did not declare in the request's clientCapabilities (protocol revision 2026-07-28).
ParseError
ParseError:
-32700
Defined in: packages/core-internal/src/types/enums.ts:7
ResourceNotFound
ResourceNotFound:
-32002
Defined in: packages/core-internal/src/types/enums.ts:25
Resource not found.
Receive-tolerated only: the SDK never EMITS -32002 — resources/read misses answer -32602 (Invalid Params) on every protocol revision per the 2026-07-28 spec MUST, and a handler-thrown -32002 is mapped to -32602 at the era encode seam. The member stays importable so clients can recognise -32002 from peers built on earlier SDK releases (the spec's "clients SHOULD also accept -32002" backwards-compatibility clause). Throw ResourceNotFoundError instead.
UnsupportedProtocolVersion
UnsupportedProtocolVersion:
-32022
Defined in: packages/core-internal/src/types/enums.ts:35
The request's protocol version is unknown to the server or unsupported by it (protocol revision 2026-07-28).
UrlElicitationRequired
UrlElicitationRequired:
-32042
Defined in: packages/core-internal/src/types/enums.ts:36
SdkErrorCode
Defined in: packages/core-internal/src/errors/sdkErrors.ts:9
Error codes for SDK errors (local errors that never cross the wire). Unlike ProtocolErrorCode which uses numeric JSON-RPC codes, SdkErrorCode uses descriptive string values for better developer experience.
These errors are thrown locally by the SDK and are never serialized as JSON-RPC error responses.
Enumeration Members
AlreadyConnected
AlreadyConnected:
"ALREADY_CONNECTED"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:14
Transport is already connected
CapabilityNotSupported
CapabilityNotSupported:
"CAPABILITY_NOT_SUPPORTED"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:20
Required capability is not supported by the remote side
ClientHttpAuthentication
ClientHttpAuthentication:
"CLIENT_HTTP_AUTHENTICATION"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:75
ClientHttpFailedToOpenStream
ClientHttpFailedToOpenStream:
"CLIENT_HTTP_FAILED_TO_OPEN_STREAM"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:78
ClientHttpFailedToTerminateSession
ClientHttpFailedToTerminateSession:
"CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:79
ClientHttpForbidden
ClientHttpForbidden:
"CLIENT_HTTP_FORBIDDEN"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:76
ClientHttpNotImplemented
ClientHttpNotImplemented:
"CLIENT_HTTP_NOT_IMPLEMENTED"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:74
ClientHttpUnexpectedContent
ClientHttpUnexpectedContent:
"CLIENT_HTTP_UNEXPECTED_CONTENT"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:77
ConnectionClosed
ConnectionClosed:
"CONNECTION_CLOSED"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:26
Connection was closed
EraNegotiationFailed
EraNegotiationFailed:
"ERA_NEGOTIATION_FAILED"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:71
Protocol-era negotiation at connect time failed without producing either a usable modern (2026-07-28+) era or a definitive legacy fallback signal — e.g. the negotiation mode forbids falling back (pin), or the probe hit a network failure (a typed connect error, never an era verdict).
Negotiation-phase only: this code is never used once an era is established.
InputRequiredRoundsExceeded
InputRequiredRoundsExceeded:
"INPUT_REQUIRED_ROUNDS_EXCEEDED"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:45
The multi-round-trip auto-fulfilment driver exhausted its round cap (inputRequired.maxRounds) without the server returning a complete result. data.rounds carries the cap that was hit and data.lastResult carries the last input_required payload received ({ inputRequests, requestState? }), so callers can inspect or resume the flow manually.
InvalidResult
InvalidResult:
"INVALID_RESULT"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:30
Response result failed local schema validation
ListPaginationExceeded
ListPaginationExceeded:
"LIST_PAGINATION_EXCEEDED"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:54
The auto-aggregating no-cursor listTools() / listPrompts() / listResources() / listResourceTemplates() walk hit the ClientOptions.listMaxPages cap without the server's pagination converging. data.method carries the list verb and data.listMaxPages the cap that was hit; raise the cap or fall back to explicit per-page { cursor } calls.
MethodNotSupportedByProtocolVersion
MethodNotSupportedByProtocolVersion:
"METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:62
The spec method being sent does not exist on the negotiated protocol version's wire era (e.g. tasks/get toward a 2026-07-28 peer, or server/discover toward a 2025-era peer). Raised locally, before anything reaches the transport. The method and era are carried in data.method / data.era.
NotConnected
NotConnected:
"NOT_CONNECTED"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:12
Transport is not connected
NotInitialized
NotInitialized:
"NOT_INITIALIZED"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:16
Protocol is not initialized
RequestTimeout
RequestTimeout:
"REQUEST_TIMEOUT"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:24
Request timed out waiting for response
SendFailed
SendFailed:
"SEND_FAILED"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:28
Failed to send message
UnsupportedResultType
UnsupportedResultType:
"UNSUPPORTED_RESULT_TYPE"
Defined in: packages/core-internal/src/errors/sdkErrors.ts:36
The response carried a resultType discriminator (protocol revision 2026-07-28) naming a result kind this client cannot consume yet, e.g. input_required. The kind is carried in data.resultType.
Classes
InMemoryTransport
Defined in: packages/core-internal/src/util/inMemory.ts:16
In-memory transport for creating clients and servers that talk to each other within the same process.
Intended for testing and development. For production in-process connections, use StreamableHTTPClientTransport against a local server URL.
Implements
Constructors
Constructor
new InMemoryTransport():
InMemoryTransport
Returns
Properties
onclose?
optionalonclose?: () =>void
Defined in: packages/core-internal/src/util/inMemory.ts:21
Callback for when the connection is closed for any reason.
This should be invoked when close() is called as well.
Returns
void
Implementation of
onerror?
optionalonerror?: (error) =>void
Defined in: packages/core-internal/src/util/inMemory.ts:22
Callback for when an error occurs.
Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
Parameters
error
Error
Returns
void
Implementation of
onmessage?
optionalonmessage?: (message,extra?) =>void
Defined in: packages/core-internal/src/util/inMemory.ts:23
Callback for when a message (request or response) is received over the connection.
Includes the request and authInfo if the transport is authenticated.
The request can be used to get the original request information (headers, etc.)
Parameters
message
extra?
authInfo?
Returns
void
Implementation of
sessionId?
optionalsessionId?:string
Defined in: packages/core-internal/src/util/inMemory.ts:24
The session ID generated for this connection.
Implementation of
Methods
close()
close():
Promise<void>
Defined in: packages/core-internal/src/util/inMemory.ts:45
Closes the connection.
Returns
Promise<void>
Implementation of
send()
send(
message,options?):Promise<void>
Defined in: packages/core-internal/src/util/inMemory.ts:62
Sends a message with optional auth info. This is useful for testing authentication scenarios.
Parameters
message
options?
authInfo?
relatedRequestId?
Returns
Promise<void>
Implementation of
start()
start():
Promise<void>
Defined in: packages/core-internal/src/util/inMemory.ts:37
Starts processing messages on the transport, including any connection steps that might need to be taken.
This method should only be called after callbacks are installed, or else messages may be lost.
NOTE: This method should not be called explicitly when using Client or Server classes, as they will implicitly call start().
Returns
Promise<void>
Implementation of
createLinkedPair()
staticcreateLinkedPair(): [InMemoryTransport,InMemoryTransport]
Defined in: packages/core-internal/src/util/inMemory.ts:29
Creates a pair of linked in-memory transports that can communicate with each other. One should be passed to a Client and one to a Server.
Returns
[InMemoryTransport, InMemoryTransport]
MissingRequiredClientCapabilityError
Defined in: packages/core-internal/src/types/errors.ts:163
Error type for the -32021 MissingRequiredClientCapability protocol error (protocol revision 2026-07-28): processing the request requires a capability the client did not declare in the request's clientCapabilities.
The error data lists the missing capabilities (requiredCapabilities) in the ClientCapabilities shape, so the client can see exactly what it would have to declare for the request to be served. On HTTP, the response status is 400 Bad Request.
Recognize this error by its code and data.requiredCapabilities rather than by class identity (instanceof does not work across separately bundled copies of the SDK).
Extends
Constructors
Constructor
new MissingRequiredClientCapabilityError(
data,message?):MissingRequiredClientCapabilityError
Defined in: packages/core-internal/src/types/errors.ts:164
Parameters
data
MissingRequiredClientCapabilityErrorData
message?
string = ...
Returns
MissingRequiredClientCapabilityError
Overrides
Properties
cause?
optionalcause?:unknown
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonlycode:number
Defined in: packages/core-internal/src/types/errors.ts:15
Inherited from
data?
readonlyoptionaldata?:unknown
Defined in: packages/core-internal/src/types/errors.ts:17
Inherited from
message
message:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optionalstack?:string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
staticstackTraceLimit:number
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
Accessors
requiredCapabilities
Get Signature
get requiredCapabilities():
object
Defined in: packages/core-internal/src/types/errors.ts:175
The capabilities the server requires from the client to process the request (only the missing capabilities are listed).
Returns
elicitation?
optionalelicitation?:object
Present if the client supports eliciting user input.
Index Signature
[key: string]: string | number | boolean | {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
elicitation.form?
optionalform?:object
Index Signature
[key: string]: string | number | boolean | {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
elicitation.form.applyDefaults?
optionalapplyDefaults?:boolean
elicitation.url?
optionalurl?:object
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
experimental?
optionalexperimental?:object
Experimental, non-standard capabilities that the client supports.
Index Signature
[key: string]: object
extensions?
optionalextensions?:object
Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
Index Signature
[key: string]: object
roots?
optionalroots?:object
Present if the client supports listing roots.
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to passing paths via tool parameters, resource URIs, or configuration.
roots.listChanged?
optionallistChanged?:boolean
Whether the client supports issuing notifications for changes to the roots list.
sampling?
optionalsampling?:object
Present if the client supports sampling from an LLM.
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
sampling.context?
optionalcontext?:object
Present if the client supports context inclusion via includeContext parameter. If not declared, servers SHOULD only use includeContext: "none" (or omit it).
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
sampling.tools?
optionaltools?:object
Present if the client supports tool use via tools and toolChoice parameters.
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
tasks?
optionaltasks?:object
Present if the client supports task creation.
Index Signature
[key: string]: unknown
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; parsed for interoperability only — servers built on this SDK never advertise it.
tasks.cancel?
optionalcancel?:object
Present if the client supports cancelling tasks.
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
tasks.list?
optionallist?:object
Present if the client supports listing tasks.
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
tasks.requests?
optionalrequests?:object
Capabilities for task creation on specific request types.
Index Signature
[key: string]: unknown
tasks.requests.elicitation?
optionalelicitation?:object
Task support for elicitation requests.
Index Signature
[key: string]: unknown
tasks.requests.elicitation.create?
optionalcreate?:object
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null
tasks.requests.sampling?
optionalsampling?:object
Task support for sampling requests.
Index Signature
[key: string]: unknown
tasks.requests.sampling.createMessage?
optionalcreateMessage?:object
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null
Methods
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Defined in: node_modules/.pnpm/@types+node@24.12.0/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.
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:
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
ProtocolError.captureStackTrace
fromError()
staticfromError(code,message,data?):ProtocolError
Defined in: packages/core-internal/src/types/errors.ts:26
Factory method to create the appropriate error type based on the error code and data
Parameters
code
number
message
string
data?
unknown
Returns
Inherited from
isError()
staticisError(error):error is Error
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23
Indicates whether the argument provided is a built-in Error instance or not.
Parameters
error
unknown
Returns
error is Error
Inherited from
prepareStackTrace()
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
ProtocolError.prepareStackTrace
OAuthError
Defined in: packages/core-internal/src/auth/errors.ts:105
OAuth error class for all OAuth-related errors.
Extends
Error
Constructors
Constructor
new OAuthError(
code,message,errorUri?):OAuthError
Defined in: packages/core-internal/src/auth/errors.ts:106
Parameters
code
string
message
string
errorUri?
string
Returns
Overrides
Error.constructor
Properties
cause?
optionalcause?:unknown
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Error.cause
code
readonlycode:string
Defined in: packages/core-internal/src/auth/errors.ts:107
errorUri?
readonlyoptionalerrorUri?:string
Defined in: packages/core-internal/src/auth/errors.ts:109
message
message:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Error.message
name
name:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Error.name
stack?
optionalstack?:string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Error.stack
stackTraceLimit
staticstackTraceLimit:number
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
toResponseObject()
toResponseObject():
object
Defined in: packages/core-internal/src/auth/errors.ts:118
Converts the error to a standard OAuth error response object.
Returns
object
error
error:
string
error_description?
optionalerror_description?:string
error_uri?
optionalerror_uri?:string
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Defined in: node_modules/.pnpm/@types+node@24.12.0/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.
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:
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
fromResponse()
staticfromResponse(response):OAuthError
Defined in: packages/core-internal/src/auth/errors.ts:134
Creates an OAuthError from an OAuth error response.
Parameters
response
error
string = ...
error_description?
string = ...
error_uri?
string = ...
Returns
isError()
staticisError(error):error is Error
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23
Indicates whether the argument provided is a built-in Error instance or not.
Parameters
error
unknown
Returns
error is Error
Inherited from
Error.isError
prepareStackTrace()
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
ProtocolError
Defined in: packages/core-internal/src/types/errors.ts:13
Protocol errors are JSON-RPC errors that cross the wire as error responses. They use numeric error codes from the ProtocolErrorCode enum.
Extends
Error
Extended by
MissingRequiredClientCapabilityErrorResourceNotFoundErrorUnsupportedProtocolVersionErrorUrlElicitationRequiredError
Constructors
Constructor
new ProtocolError(
code,message,data?):ProtocolError
Defined in: packages/core-internal/src/types/errors.ts:14
Parameters
code
number
message
string
data?
unknown
Returns
Overrides
Error.constructor
Properties
cause?
optionalcause?:unknown
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Error.cause
code
readonlycode:number
Defined in: packages/core-internal/src/types/errors.ts:15
data?
readonlyoptionaldata?:unknown
Defined in: packages/core-internal/src/types/errors.ts:17
message
message:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Error.message
name
name:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Error.name
stack?
optionalstack?:string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Error.stack
stackTraceLimit
staticstackTraceLimit:number
Defined in: node_modules/.pnpm/@types+node@24.12.0/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()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Defined in: node_modules/.pnpm/@types+node@24.12.0/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.
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:
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()
staticfromError(code,message,data?):ProtocolError
Defined in: packages/core-internal/src/types/errors.ts:26
Factory method to create the appropriate error type based on the error code and data
Parameters
code
number
message
string
data?
unknown
Returns
isError()
staticisError(error):error is Error
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23
Indicates whether the argument provided is a built-in Error instance or not.
Parameters
error
unknown
Returns
error is Error
Inherited from
Error.isError
prepareStackTrace()
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
ReadBuffer
Defined in: packages/core-internal/src/shared/stdio.ts:9
Buffers a continuous stdio stream into discrete JSON-RPC messages.
Constructors
Constructor
new ReadBuffer(
options?):ReadBuffer
Defined in: packages/core-internal/src/shared/stdio.ts:13
Parameters
options?
maxBufferSize?
number
Returns
Methods
append()
append(
chunk):void
Defined in: packages/core-internal/src/shared/stdio.ts:17
Parameters
chunk
Buffer
Returns
void
clear()
clear():
void
Defined in: packages/core-internal/src/shared/stdio.ts:51
Returns
void
readMessage()
readMessage():
JSONRPCMessage|null
Defined in: packages/core-internal/src/shared/stdio.ts:26
Returns
JSONRPCMessage | null
ResourceNotFoundError
Defined in: packages/core-internal/src/types/errors.ts:93
Error type for a resources/read miss: the requested resource does not exist. The wire code is -32602 (Invalid Params) on every protocol revision — the spec MUST for revision 2026-07-28, and the value the v1.x SDK has always emitted on earlier revisions. The error data echoes the requested URI.
Recognise this error by checking error.data is exactly { uri: string } (a -32602 whose data carries uri and nothing else is resource-not-found; any other -32602 is an ordinary Invalid Params). For backwards compatibility, clients should also accept -32002 as resource not found — earlier SDK builds emitted that code, and ProtocolError.fromError reconstructs this class for either code when error.data carries uri (a bare -32002 without data.uri stays a generic ProtocolError). Do not rely on instanceof — it does not work across separately bundled copies of the SDK.
Extends
Constructors
Constructor
new ResourceNotFoundError(
uri,message?):ResourceNotFoundError
Defined in: packages/core-internal/src/types/errors.ts:94
Parameters
uri
string
message?
string = ...
Returns
Overrides
Properties
cause?
optionalcause?:unknown
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonlycode:number
Defined in: packages/core-internal/src/types/errors.ts:15
Inherited from
data?
readonlyoptionaldata?:unknown
Defined in: packages/core-internal/src/types/errors.ts:17
Inherited from
message
message:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optionalstack?:string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
staticstackTraceLimit:number
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
Accessors
uri
Get Signature
get uri():
string
Defined in: packages/core-internal/src/types/errors.ts:99
The URI that was requested and not found.
Returns
string
Methods
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Defined in: node_modules/.pnpm/@types+node@24.12.0/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.
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:
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
ProtocolError.captureStackTrace
fromError()
staticfromError(code,message,data?):ProtocolError
Defined in: packages/core-internal/src/types/errors.ts:26
Factory method to create the appropriate error type based on the error code and data
Parameters
code
number
message
string
data?
unknown
Returns
Inherited from
isError()
staticisError(error):error is Error
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23
Indicates whether the argument provided is a built-in Error instance or not.
Parameters
error
unknown
Returns
error is Error
Inherited from
prepareStackTrace()
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
ProtocolError.prepareStackTrace
SdkError
Defined in: packages/core-internal/src/errors/sdkErrors.ts:100
SDK errors are local errors that never cross the wire. They are distinct from ProtocolError which represents JSON-RPC protocol errors that are serialized and sent as error responses.
Example
try {
// Throwing an SDK error
throw new SdkError(SdkErrorCode.NotConnected, 'Transport is not connected');
} catch (error) {
// Checking error type by code
if (error instanceof SdkError && error.code === SdkErrorCode.RequestTimeout) {
// Handle timeout
}
}Extends
Error
Extended by
Constructors
Constructor
new SdkError(
code,message,data?):SdkError
Defined in: packages/core-internal/src/errors/sdkErrors.ts:101
Parameters
code
message
string
data?
unknown
Returns
Overrides
Error.constructor
Properties
cause?
optionalcause?:unknown
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
Error.cause
code
readonlycode:SdkErrorCode
Defined in: packages/core-internal/src/errors/sdkErrors.ts:102
data?
readonlyoptionaldata?:unknown
Defined in: packages/core-internal/src/errors/sdkErrors.ts:104
message
message:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
Error.message
name
name:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Error.name
stack?
optionalstack?:string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
Error.stack
stackTraceLimit
staticstackTraceLimit:number
Defined in: node_modules/.pnpm/@types+node@24.12.0/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()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Defined in: node_modules/.pnpm/@types+node@24.12.0/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.
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:
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
isError()
staticisError(error):error is Error
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23
Indicates whether the argument provided is a built-in Error instance or not.
Parameters
error
unknown
Returns
error is Error
Inherited from
Error.isError
prepareStackTrace()
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
SdkHttpError
Defined in: packages/core-internal/src/errors/sdkErrors.ts:136
An SdkError subclass for HTTP transport failures.
Thrown by the streamable HTTP transport when the server responds with a non-OK status code. Narrows data to SdkHttpErrorData so consumers can inspect the HTTP status without unsafe casting.
Example
if (error instanceof SdkHttpError) {
console.log(error.status); // number
console.log(error.statusText); // string | undefined
}Extends
Constructors
Constructor
new SdkHttpError(
code,message,data):SdkHttpError
Defined in: packages/core-internal/src/errors/sdkErrors.ts:139
Parameters
code
message
string
data
Returns
Overrides
Properties
cause?
optionalcause?:unknown
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonlycode:SdkErrorCode
Defined in: packages/core-internal/src/errors/sdkErrors.ts:102
Inherited from
data
readonlydata:SdkHttpErrorData
Defined in: packages/core-internal/src/errors/sdkErrors.ts:137
Overrides
message
message:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optionalstack?:string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
staticstackTraceLimit:number
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
Accessors
status
Get Signature
get status():
number
Defined in: packages/core-internal/src/errors/sdkErrors.ts:144
Returns
number
statusText
Get Signature
get statusText():
string|undefined
Defined in: packages/core-internal/src/errors/sdkErrors.ts:148
Returns
string | undefined
Methods
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Defined in: node_modules/.pnpm/@types+node@24.12.0/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.
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:
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
isError()
staticisError(error):error is Error
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23
Indicates whether the argument provided is a built-in Error instance or not.
Parameters
error
unknown
Returns
error is Error
Inherited from
prepareStackTrace()
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
UnsupportedProtocolVersionError
Defined in: packages/core-internal/src/types/errors.ts:129
Error type for the -32022 UnsupportedProtocolVersion protocol error (protocol revision 2026-07-28): the request's protocol version is unknown to the server or unsupported by it.
The error data lists the protocol versions the receiver supports (supported), so the sender can choose a mutually supported version and retry, and echoes the version that was requested (requested).
Extends
Constructors
Constructor
new UnsupportedProtocolVersionError(
data,message?):UnsupportedProtocolVersionError
Defined in: packages/core-internal/src/types/errors.ts:130
Parameters
data
UnsupportedProtocolVersionErrorData
message?
string = ...
Returns
UnsupportedProtocolVersionError
Overrides
Properties
cause?
optionalcause?:unknown
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonlycode:number
Defined in: packages/core-internal/src/types/errors.ts:15
Inherited from
data?
readonlyoptionaldata?:unknown
Defined in: packages/core-internal/src/types/errors.ts:17
Inherited from
message
message:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optionalstack?:string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
staticstackTraceLimit:number
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
Accessors
requested
Get Signature
get requested():
string
Defined in: packages/core-internal/src/types/errors.ts:144
The protocol version that was requested.
Returns
string
supported
Get Signature
get supported():
string[]
Defined in: packages/core-internal/src/types/errors.ts:137
Protocol versions the receiver supports.
Returns
string[]
Methods
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Defined in: node_modules/.pnpm/@types+node@24.12.0/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.
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:
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
ProtocolError.captureStackTrace
fromError()
staticfromError(code,message,data?):ProtocolError
Defined in: packages/core-internal/src/types/errors.ts:26
Factory method to create the appropriate error type based on the error code and data
Parameters
code
number
message
string
data?
unknown
Returns
Inherited from
isError()
staticisError(error):error is Error
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23
Indicates whether the argument provided is a built-in Error instance or not.
Parameters
error
unknown
Returns
error is Error
Inherited from
prepareStackTrace()
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
ProtocolError.prepareStackTrace
UriTemplate
Defined in: packages/core-internal/src/shared/uriTemplate.ts:10
Constructors
Constructor
new UriTemplate(
template):UriTemplate
Defined in: packages/core-internal/src/shared/uriTemplate.ts:34
Parameters
template
string
Returns
Accessors
variableNames
Get Signature
get variableNames():
string[]
Defined in: packages/core-internal/src/shared/uriTemplate.ts:30
Returns
string[]
Methods
expand()
expand(
variables):string
Defined in: packages/core-internal/src/shared/uriTemplate.ts:172
Parameters
variables
Returns
string
match()
match(
uri):Variables|null
Defined in: packages/core-internal/src/shared/uriTemplate.ts:255
Parameters
uri
string
Returns
Variables | null
toString()
toString():
string
Defined in: packages/core-internal/src/shared/uriTemplate.ts:40
Returns
string
isTemplate()
staticisTemplate(str):boolean
Defined in: packages/core-internal/src/shared/uriTemplate.ts:16
Returns true if the given string contains any URI template expressions. A template expression is a sequence of characters enclosed in curly braces, like {foo} or {?bar}.
Parameters
str
string
Returns
boolean
UrlElicitationRequiredError
Defined in: packages/core-internal/src/types/errors.ts:108
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: packages/core-internal/src/types/errors.ts:109
Parameters
elicitations
object[]
message?
string = ...
Returns
Overrides
Properties
cause?
optionalcause?:unknown
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es2022.error.d.ts:26
Inherited from
code
readonlycode:number
Defined in: packages/core-internal/src/types/errors.ts:15
Inherited from
data?
readonlyoptionaldata?:unknown
Defined in: packages/core-internal/src/types/errors.ts:17
Inherited from
message
message:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1077
Inherited from
name
name:
string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
stack?
optionalstack?:string
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.es5.d.ts:1078
Inherited from
stackTraceLimit
staticstackTraceLimit:number
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
Accessors
elicitations
Get Signature
get elicitations():
object[]
Defined in: packages/core-internal/src/types/errors.ts:115
Returns
Methods
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Defined in: node_modules/.pnpm/@types+node@24.12.0/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.
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:
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
ProtocolError.captureStackTrace
fromError()
staticfromError(code,message,data?):ProtocolError
Defined in: packages/core-internal/src/types/errors.ts:26
Factory method to create the appropriate error type based on the error code and data
Parameters
code
number
message
string
data?
unknown
Returns
Inherited from
isError()
staticisError(error):error is Error
Defined in: node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/lib/lib.esnext.error.d.ts:23
Indicates whether the argument provided is a built-in Error instance or not.
Parameters
error
unknown
Returns
error is Error
Inherited from
prepareStackTrace()
staticprepareStackTrace(err,stackTraces):any
Defined in: node_modules/.pnpm/@types+node@24.12.0/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
ProtocolError.prepareStackTrace
Interfaces
AjvJsonSchemaValidator
Defined in: packages/core-internal/src/validators/ajvProvider.ts:79
AJV-backed JSON Schema validator. See @modelcontextprotocol/{client,server}/validators/ajv for the customisation entry point (re-exports Ajv and addFormats from the bundled copy).
Default validates as JSON Schema 2020-12 (SEP-1613). Schemas declaring a different $schema are rejected with a plain Error; pass a pre-configured Ajv instance to validate other dialects. The SDK bundles ajv internally but does not re-export Ajv2020 (its type graph tips downstream declaration bundling — see #2339). To construct a custom 2020-12 instance, add ajv to your own dependencies (matching the SDK's pinned version) and import { Ajv2020 } from 'ajv/dist/2020.js' — new Ajv(...) is the draft-07 class and would silently downgrade dialect.
Examples
Use with default configuration
const validator = new AjvJsonSchemaValidator();Use with a custom AJV instance
// import { Ajv2020 } from 'ajv/dist/2020.js';
const ajv = new Ajv2020({ strict: false, validateSchema: false, allErrors: true });
const validator = new AjvJsonSchemaValidator(ajv);Register ajv-formats
// import { Ajv2020 } from 'ajv/dist/2020.js';
const ajv = new Ajv2020({ strict: false, validateSchema: false, allErrors: true });
addFormats(ajv);
const validator = new AjvJsonSchemaValidator(ajv);Implements
Methods
getValidator()
getValidator<
T>(schema):JsonSchemaValidator<T>
Defined in: packages/core-internal/src/validators/ajvProvider.ts:97
Create a validator for the given JSON Schema
Type Parameters
T
T
Parameters
schema
Standard JSON Schema object
Returns
A validator function that can be called multiple times
Implementation of
jsonSchemaValidator.getValidator
AuthInfo
Defined in: packages/core-internal/src/types/types.ts:724
Information about a validated access token, provided to request handlers.
Properties
clientId
clientId:
string
Defined in: packages/core-internal/src/types/types.ts:733
The client ID associated with this token.
expiresAt?
optionalexpiresAt?:number
Defined in: packages/core-internal/src/types/types.ts:743
When the token expires (in seconds since epoch).
extra?
optionalextra?:Record<string,unknown>
Defined in: packages/core-internal/src/types/types.ts:755
Additional data associated with the token. This field should be used for any additional data that needs to be attached to the auth info.
resource?
optionalresource?:URL
Defined in: packages/core-internal/src/types/types.ts:749
The RFC 8707 resource server identifier for which this token is valid. If set, this MUST match the MCP server's resource identifier (minus hash fragment).
scopes
scopes:
string[]
Defined in: packages/core-internal/src/types/types.ts:738
Scopes associated with this token.
token
token:
string
Defined in: packages/core-internal/src/types/types.ts:728
The access token.
CfWorkerJsonSchemaValidator
Defined in: packages/core-internal/src/validators/cfWorkerProvider.ts:50
@cfworker/json-schema-backed JSON Schema validator. See @modelcontextprotocol/{client,server}/validators/cf-worker for the customisation entry point.
Default validates as JSON Schema 2020-12 (SEP-1613). Schemas declaring a different $schema are rejected with a plain Error. Passing an explicit draft to the constructor overrides this — that draft is used for every schema regardless of $schema.
Examples
Use with default configuration (2020-12, shortcircuit on)
const validator = new CfWorkerJsonSchemaValidator();Use with custom configuration
const validator = new CfWorkerJsonSchemaValidator({
draft: '2020-12',
shortcircuit: false // Report all errors
});Implements
Methods
getValidator()
getValidator<
T>(schema):JsonSchemaValidator<T>
Defined in: packages/core-internal/src/validators/cfWorkerProvider.ts:77
Create a validator for the given JSON Schema
Unlike AJV, this validator is not cached internally
Type Parameters
T
T
Parameters
schema
Standard JSON Schema object
Returns
A validator function that validates input data
Implementation of
jsonSchemaValidator.getValidator
CreateMessageRequestParamsWithTools
Defined in: packages/core-internal/src/types/types.ts:939
CreateMessageRequestParams with required tools - for tool-enabled overload.
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
Extends
Properties
_meta?
optional_meta?:object
Defined in: packages/core-internal/src/types/schemas.ts:54
See General fields: _meta for notes on _meta usage.
Index Signature
[key: string]: unknown
io.modelcontextprotocol/related-task?
optionalio.modelcontextprotocol/related-task?:object
If specified, this request is related to the provided task.
io.modelcontextprotocol/related-task.taskId
taskId:
string
progressToken?
optionalprogressToken?: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?
optionalincludeContext?:"none"|"thisServer"|"allServers"
Defined in: packages/core-internal/src/types/schemas.ts:1703
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". The values "thisServer" and "allServers" are deprecated (SEP-2596): servers SHOULD omit this field or use "none", and SHOULD only use the deprecated values if the client declares ClientCapabilities.sampling.context.
Deprecated
The "thisServer" and "allServers" values are deprecated as of protocol version 2025-11-25 (SEP-2596) and will be removed no later than the Sampling feature itself (SEP-2577). Omit this field or use "none".
Inherited from
CreateMessageRequestParams.includeContext
maxTokens
maxTokens:
number
Defined in: packages/core-internal/src/types/schemas.ts:1710
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: packages/core-internal/src/types/schemas.ts:1683
_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; };resource: {_meta?: {[key: ...]: ...; };mimeType?:string;text:string;uri:string; } | {_meta?: {[key: ...]: ...; };blob:string;mimeType?:string;uri:string; };type:"resource"; } | {_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; })[];isError?:boolean;structuredContent?: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?: ...; };resource: {_meta?: ...;mimeType?: ...;text: ...;uri: ...; } | {_meta?: ...;blob: ...;mimeType?: ...;uri: ...; };type:"resource"; } | {_meta?: {[key: ...]: ...; };annotations?: {audience?: ...;lastModified?: ...;priority?: ...; };description?:string;icons?: ...[];mimeType?:string;name:string;size?:number;title?:string;type:"resource_link";uri:string; })[];isError?:boolean;structuredContent?: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?
optionalannotations?:object
Optional annotations for the client.
annotations.audience?
optionalaudience?: ("user"|"assistant")[]
Intended audience(s) for the resource.
annotations.lastModified?
optionallastModified?:string
ISO 8601 timestamp for the most recent modification.
annotations.priority?
optionalpriority?: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?
optionalannotations?:object
Optional annotations for the client.
annotations.audience?
optionalaudience?: ("user"|"assistant")[]
Intended audience(s) for the resource.
annotations.lastModified?
optionallastModified?:string
ISO 8601 timestamp for the most recent modification.
annotations.priority?
optionalpriority?: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?
optionalannotations?:object
Optional annotations for the client.
annotations.audience?
optionalaudience?: ("user"|"assistant")[]
Intended audience(s) for the resource.
annotations.lastModified?
optionallastModified?:string
ISO 8601 timestamp for the most recent modification.
annotations.priority?
optionalpriority?: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; }; resource: { _meta?: {[key: ...]: ...; }; mimeType?: string; text: string; uri: string; } | { _meta?: {[key: ...]: ...; }; blob: string; mimeType?: string; uri: string; }; type: "resource"; } | { _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; })[]; isError?: boolean; structuredContent?: 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; };resource: {_meta?: {[key: ...]: ...; };mimeType?:string;text:string;uri:string; } | {_meta?: {[key: ...]: ...; };blob:string;mimeType?:string;uri:string; };type:"resource"; } | {_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; })[]
isError?
optionalisError?:boolean
structuredContent?
optionalstructuredContent?:unknown
SEP-2106: any JSON value is permitted. The 2025-11-25 wire parse retains the object-only constraint via the frozen schema in wire/rev2025-11-25/schemas.ts.
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?: ...; }; resource: { _meta?: ...; mimeType?: ...; text: ...; uri: ...; } | { _meta?: ...; blob: ...; mimeType?: ...; uri: ...; }; type: "resource"; } | { _meta?: {[key: ...]: ...; }; annotations?: { audience?: ...; lastModified?: ...; priority?: ...; }; description?: string; icons?: ...[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string; })[]; isError?: boolean; structuredContent?: unknown; toolUseId: string; type: "tool_result"; })[]
role
role:
"user"|"assistant"=RoleSchema
Inherited from
CreateMessageRequestParams.messages
metadata?
optionalmetadata?:object
Defined in: packages/core-internal/src/types/schemas.ts:1715
Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
Inherited from
CreateMessageRequestParams.metadata
modelPreferences?
optionalmodelPreferences?:object
Defined in: packages/core-internal/src/types/schemas.ts:1687
The server's preferences for which model to select. The client MAY modify or omit this request.
costPriority?
optionalcostPriority?:number
How much to prioritize cost when selecting a model.
hints?
optionalhints?:object[]
Optional hints to use for model selection.
intelligencePriority?
optionalintelligencePriority?:number
How much to prioritize intelligence and capabilities when selecting a model.
speedPriority?
optionalspeedPriority?:number
How much to prioritize sampling speed (latency) when selecting a model.
Inherited from
CreateMessageRequestParams.modelPreferences
stopSequences?
optionalstopSequences?:string[]
Defined in: packages/core-internal/src/types/schemas.ts:1711
Inherited from
CreateMessageRequestParams.stopSequences
systemPrompt?
optionalsystemPrompt?:string
Defined in: packages/core-internal/src/types/schemas.ts:1691
An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
Inherited from
CreateMessageRequestParams.systemPrompt
task?
optionaltask?:object
Defined in: packages/core-internal/src/types/schemas.ts:71
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?
optionalttl?:number
Inherited from
CreateMessageRequestParams.task
temperature?
optionaltemperature?:number
Defined in: packages/core-internal/src/types/schemas.ts:1704
Inherited from
CreateMessageRequestParams.temperature
toolChoice?
optionaltoolChoice?:object
Defined in: packages/core-internal/src/types/schemas.ts:1726
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?
optionalmode?:"required"|"auto"|"none"
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: packages/core-internal/src/types/types.ts:940
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?
optionalannotations?:object
Optional additional tool information.
annotations.destructiveHint?
optionaldestructiveHint?: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?
optionalidempotentHint?:boolean
If true, calling the tool repeatedly with the same arguments will have no additional effect on its environment.
(This property is meaningful only when readOnlyHint == false)
Default: false
annotations.openWorldHint?
optionalopenWorldHint?: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?
optionalreadOnlyHint?:boolean
If true, the tool does not modify its environment.
Default: false
annotations.title?
optionaltitle?:string
A human-readable title for the tool.
description?
optionaldescription?:string
A human-readable description of the tool.
execution?
optionalexecution?:object
Execution-related properties for this tool.
execution.taskSupport?
optionaltaskSupport?:"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?
optionalicons?: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(andimage/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?
optionalproperties?:object
Index Signature
[key: string]: string | number | boolean | {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
inputSchema.required?
optionalrequired?: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?
optionaloutputSchema?:object
An optional JSON Schema 2020-12 document describing the structure of the tool's output returned in the structuredContent field of a CallToolResult.
SEP-2106: any JSON Schema root is permitted (e.g. type:'array', oneOf, $ref). The 2025-11-25 wire parse retains the type:'object' constraint via the frozen schema in wire/rev2025-11-25/schemas.ts; this neutral/public schema widens.
Index Signature
[key: string]: unknown
outputSchema.$schema?
optional$schema?:string
title?
optionaltitle?: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
InputRequests
Defined in: packages/core-internal/src/types/types.ts:605
A map of embedded input requests, keyed by server-assigned identifiers that are unique within the scope of the request.
Indexable
[
key:string]:InputRequest
InputRequiredOptions
Defined in: packages/core-internal/src/shared/inputRequiredDriver.ts:48
Multi-round-trip driver options (inputRequired on the client options bag).
Properties
autoFulfill?
optionalautoFulfill?:boolean
Defined in: packages/core-internal/src/shared/inputRequiredDriver.ts:60
Fulfil input_required results automatically by dispatching the embedded requests to the registered handlers and retrying.
Set to false for manual mode: an input_required response then surfaces as a typed error unless the individual call opts in with allowInputRequired: true (and, for typed results on the explicit schema path, withInputRequired()).
Default
truemaxRounds?
optionalmaxRounds?:number
Defined in: packages/core-internal/src/shared/inputRequiredDriver.ts:69
Maximum number of rounds (retries) the driver performs for a single call before failing with a typed SdkErrorCode.InputRequiredRoundsExceeded error.
Default
10InputRequiredResult
Defined in: packages/core-internal/src/types/types.ts:644
The input-required result a handler for a multi-round-trip method (tools/call, prompts/get, resources/read) returns to request more input from the client (protocol revision 2026-07-28). Build it with the inputRequired() builder; hand-built literals are equally legal — resultType: 'input_required' is the discriminator, and the SDK re-checks the at-least-one rule at the seam.
This is the one place the wire discriminator resultType appears on the neutral surface: the handler authors it, the 2026-07-28 codec passes it through to the wire, and consumers receiving results never see it (complete results are lifted).
At least one of inputRequests or requestState must be present.
requestState is an opaque, server-minted string echoed back verbatim by the client on retry. It travels through the client and MUST be treated by the server as attacker-controlled input on re-entry: if it influences authorization, resource access, or business logic, the server MUST protect its integrity (e.g. HMAC or AEAD) and MUST reject state that fails verification (spec: basic/patterns/mrtr §Server Requirements). The SDK applies no integrity protection by default — without a configured ServerOptions.requestState.verify hook, ctx.mcpReq.requestState() returns the raw, unverified string; with one, the seam rejects state the hook refuses and the accessor returns the hook's decoded payload.
Extends
Indexable
[
key:string]:unknown
Properties
_meta?
optional_meta?:object
Defined in: packages/core-internal/src/types/schemas.ts:97
See MCP specification for notes on _meta usage.
Index Signature
[key: string]: unknown
io.modelcontextprotocol/related-task?
optionalio.modelcontextprotocol/related-task?:object
If specified, this request is related to the provided task.
io.modelcontextprotocol/related-task.taskId
taskId:
string
progressToken?
optionalprogressToken?: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
Result._meta
inputRequests?
optionalinputRequests?:InputRequests
Defined in: packages/core-internal/src/types/types.ts:647
Embedded requests the client must fulfil before retrying.
requestState?
optionalrequestState?:string
Defined in: packages/core-internal/src/types/types.ts:649
Opaque server state the client echoes back verbatim on retry.
resultType
resultType:
"input_required"
Defined in: packages/core-internal/src/types/types.ts:645
InputResponses
Defined in: packages/core-internal/src/types/types.ts:614
A map of embedded input responses. Keys correspond to the keys of the InputRequests map the server sent; values are the client's bare result for each request.
Indexable
[
key:string]:InputResponse
InternalError
Defined in: packages/core-internal/src/types/types.ts:772
Extends
JSONRPCErrorObject
Properties
code
code:
-32603
Defined in: packages/core-internal/src/types/types.ts:773
Overrides
JSONRPCErrorObject.code
data?
optionaldata?:unknown
Defined in: packages/core-internal/src/types/types.ts:758
Inherited from
JSONRPCErrorObject.data
message
message:
string
Defined in: packages/core-internal/src/types/types.ts:758
Inherited from
JSONRPCErrorObject.message
InvalidParamsError
Defined in: packages/core-internal/src/types/types.ts:769
Extends
JSONRPCErrorObject
Properties
code
code:
-32602
Defined in: packages/core-internal/src/types/types.ts:770
Overrides
JSONRPCErrorObject.code
data?
optionaldata?:unknown
Defined in: packages/core-internal/src/types/types.ts:758
Inherited from
JSONRPCErrorObject.data
message
message:
string
Defined in: packages/core-internal/src/types/types.ts:758
Inherited from
JSONRPCErrorObject.message
InvalidRequestError
Defined in: packages/core-internal/src/types/types.ts:763
Extends
JSONRPCErrorObject
Properties
code
code:
-32600
Defined in: packages/core-internal/src/types/types.ts:764
Overrides
JSONRPCErrorObject.code
data?
optionaldata?:unknown
Defined in: packages/core-internal/src/types/types.ts:758
Inherited from
JSONRPCErrorObject.data
message
message:
string
Defined in: packages/core-internal/src/types/types.ts:758
Inherited from
JSONRPCErrorObject.message
jsonSchemaValidator
Defined in: packages/core-internal/src/validators/types.ts:51
Provider interface for creating validators from JSON Schemas
This is the main extension point for custom validator implementations. Implementations should:
- Support JSON Schema Draft 2020-12 (or be compatible with it)
- Return validator functions that can be called multiple times
- Handle schema compilation/caching internally
- Provide clear error messages on validation failure
Example
class MyValidatorProvider implements jsonSchemaValidator {
getValidator<T>(schema: JsonSchemaType): JsonSchemaValidator<T> {
// Compile/cache validator from schema
return (input: unknown) =>
isValid(schema, input)
? { valid: true, data: input as T, errorMessage: undefined }
: { valid: false, data: undefined, errorMessage: 'Error details' };
}
}Methods
getValidator()
getValidator<
T>(schema):JsonSchemaValidator<T>
Defined in: packages/core-internal/src/validators/types.ts:58
Create a validator for the given JSON Schema
Type Parameters
T
T
Parameters
schema
Standard JSON Schema object
Returns
A validator function that can be called multiple times
MessageClassification
Defined in: packages/core-internal/src/types/types.ts:871
Protocol-era classification of an inbound message.
Populated by transports that classify messages at the edge (e.g. an HTTP entry distinguishing 2025-era from 2026-era traffic). The wire era itself is connection state (the negotiated protocol version held by the Client/Server instance); the protocol layer validates a classified message against that instance era at dispatch — a mismatch is treated as an entry/routing error, never a per-message era switch. Unclassified traffic is dispatched on the instance era unchanged.
Properties
era
era:
"legacy"|"modern"
Defined in: packages/core-internal/src/types/types.ts:876
The wire era the message was classified into: legacy for the 2025-11-25 family of revisions, modern for 2026-07-28 and later.
revision?
optionalrevision?:string
Defined in: packages/core-internal/src/types/types.ts:881
The exact protocol revision, when the classifier derived one.
MessageExtraInfo
Defined in: packages/core-internal/src/types/types.ts:887
Extra information about a message.
Properties
authInfo?
optionalauthInfo?:AuthInfo
Defined in: packages/core-internal/src/types/types.ts:904
The authentication information.
classification?
optionalclassification?:MessageClassification
Defined in: packages/core-internal/src/types/types.ts:899
Protocol-era classification of the message, when the transport classified it at the edge. Validated by the protocol layer against the instance's negotiated era at dispatch (the edge→instance handoff check); it does not select the era itself.
closeSSEStream?
optionalcloseSSEStream?: () =>void
Defined in: packages/core-internal/src/types/types.ts:910
Callback to close the SSE stream for this request, triggering client reconnection. Only available when using NodeStreamableHTTPServerTransport with eventStore configured.
Returns
void
closeStandaloneSSEStream?
optionalcloseStandaloneSSEStream?: () =>void
Defined in: packages/core-internal/src/types/types.ts:916
Callback to close the standalone GET SSE stream, triggering client reconnection. Only available when using NodeStreamableHTTPServerTransport with eventStore configured.
Returns
void
request?
optionalrequest?:Request
Defined in: packages/core-internal/src/types/types.ts:891
The original HTTP request.
MethodNotFoundError
Defined in: packages/core-internal/src/types/types.ts:766
Extends
JSONRPCErrorObject
Properties
code
code:
-32601
Defined in: packages/core-internal/src/types/types.ts:767
Overrides
JSONRPCErrorObject.code
data?
optionaldata?:unknown
Defined in: packages/core-internal/src/types/types.ts:758
Inherited from
JSONRPCErrorObject.data
message
message:
string
Defined in: packages/core-internal/src/types/types.ts:758
Inherited from
JSONRPCErrorObject.message
MissingRequiredClientCapabilityErrorData
Defined in: packages/core-internal/src/types/types.ts:780
Data carried by a -32021 MissingRequiredClientCapability protocol error (protocol revision 2026-07-28).
Properties
requiredCapabilities
requiredCapabilities:
object
Defined in: packages/core-internal/src/types/types.ts:786
The capabilities the server requires from the client to process the request, in the ClientCapabilities shape (only the missing capabilities are listed).
elicitation?
optionalelicitation?:object
Present if the client supports eliciting user input.
Index Signature
[key: string]: string | number | boolean | {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
elicitation.form?
optionalform?:object
Index Signature
[key: string]: string | number | boolean | {[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
elicitation.form.applyDefaults?
optionalapplyDefaults?:boolean
elicitation.url?
optionalurl?:object
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
experimental?
optionalexperimental?:object
Experimental, non-standard capabilities that the client supports.
Index Signature
[key: string]: object
extensions?
optionalextensions?:object
Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
Index Signature
[key: string]: object
roots?
optionalroots?:object
Present if the client supports listing roots.
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to passing paths via tool parameters, resource URIs, or configuration.
roots.listChanged?
optionallistChanged?:boolean
Whether the client supports issuing notifications for changes to the roots list.
sampling?
optionalsampling?:object
Present if the client supports sampling from an LLM.
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
sampling.context?
optionalcontext?:object
Present if the client supports context inclusion via includeContext parameter. If not declared, servers SHOULD only use includeContext: "none" (or omit it).
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
sampling.tools?
optionaltools?:object
Present if the client supports tool use via tools and toolChoice parameters.
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
tasks?
optionaltasks?:object
Present if the client supports task creation.
Index Signature
[key: string]: unknown
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; parsed for interoperability only — servers built on this SDK never advertise it.
tasks.cancel?
optionalcancel?:object
Present if the client supports cancelling tasks.
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
tasks.list?
optionallist?:object
Present if the client supports listing tasks.
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null[] | null
tasks.requests?
optionalrequests?:object
Capabilities for task creation on specific request types.
Index Signature
[key: string]: unknown
tasks.requests.elicitation?
optionalelicitation?:object
Task support for elicitation requests.
Index Signature
[key: string]: unknown
tasks.requests.elicitation.create?
optionalcreate?:object
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null
tasks.requests.sampling?
optionalsampling?:object
Task support for sampling requests.
Index Signature
[key: string]: unknown
tasks.requests.sampling.createMessage?
optionalcreateMessage?:object
Index Signature
[key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; } | ...[] | null
ParseError
Defined in: packages/core-internal/src/types/types.ts:760
Extends
JSONRPCErrorObject
Properties
code
code:
-32700
Defined in: packages/core-internal/src/types/types.ts:761
Overrides
JSONRPCErrorObject.code
data?
optionaldata?:unknown
Defined in: packages/core-internal/src/types/types.ts:758
Inherited from
JSONRPCErrorObject.data
message
message:
string
Defined in: packages/core-internal/src/types/types.ts:758
Inherited from
JSONRPCErrorObject.message
RequestHandlerSchemas
Defined in: packages/core-internal/src/shared/protocol.ts:1853
Schema bundle accepted by setRequestHandler's 3-arg form.
params is required and validates the inbound request.params. result is optional; when supplied it types the handler's return value (no runtime validation is performed on the result).
Type Parameters
P
P extends StandardSchemaV1 = StandardSchemaV1
R
R extends StandardSchemaV1 | undefined = StandardSchemaV1 | undefined
Properties
params
params:
P
Defined in: packages/core-internal/src/shared/protocol.ts:1857
result?
optionalresult?:R
Defined in: packages/core-internal/src/shared/protocol.ts:1858
SdkHttpErrorData
Defined in: packages/core-internal/src/errors/sdkErrors.ts:114
Typed shape for HTTP error data carried by SdkHttpError.
Indexable
[
key:string]:unknown
Properties
status
status:
number
Defined in: packages/core-internal/src/errors/sdkErrors.ts:115
statusText?
optionalstatusText?:string
Defined in: packages/core-internal/src/errors/sdkErrors.ts:116
StandardSchemaV1
Defined in: packages/core-internal/src/util/standardSchema.ts:33
Extended by
Type Parameters
Input
Input = unknown
Output
Output = Input
Properties
~standard
readonly~standard:Props<Input,Output>
Defined in: packages/core-internal/src/util/standardSchema.ts:34
StandardSchemaV1Sync
Defined in: packages/core-internal/src/util/standardSchema.ts:126
Narrowing of StandardSchemaV1 whose validate is guaranteed synchronous.
The Zod schemas backing specTypeSchemas contain no async refinements or transforms, so every entry satisfies this interface. Consumers can call validate() and access .issues / .value on the result without await.
StandardSchemaV1Sync is assignable to StandardSchemaV1 — it is a strict subtype.
Extends
StandardSchemaV1<Input,Output>
Type Parameters
Input
Input = unknown
Output
Output = Input
Properties
~standard
readonly~standard:Props<Input,Output>
Defined in: packages/core-internal/src/util/standardSchema.ts:127
Overrides
StandardSchemaWithJSON
Defined in: packages/core-internal/src/util/standardSchema.ts:108
Combined interface for schemas with both validation and JSON Schema conversion — the intersection of StandardSchemaV1 and StandardJSONSchemaV1.
This is the type accepted by registerTool / registerPrompt. The SDK needs ~standard.jsonSchema to advertise the tool's argument shape in tools/list, and ~standard.validate to check incoming arguments when a tools/call arrives.
Zod v4, ArkType, and Valibot (via @valibot/to-json-schema's toStandardJsonSchema) all implement both interfaces.
See
https://standardschema.dev/ for the Standard Schema specification
Type Parameters
Input
Input = unknown
Output
Output = Input
Properties
~standard
readonly~standard:Props<Input,Output> &Props<Input,Output>
Defined in: packages/core-internal/src/util/standardSchema.ts:109
Transport
Defined in: packages/core-internal/src/shared/transport.ts:107
Describes the minimal contract for an MCP transport that a client or server can communicate over.
Properties
hasPerRequestStream?
readonlyoptionalhasPerRequestStream?:boolean
Defined in: packages/core-internal/src/shared/transport.ts:139
true when this transport opens one underlying request per outbound JSON-RPC request (the Streamable HTTP POST-per-request model) and therefore honors TransportSendOptions.requestSignal. The 2026-07-28 spec makes closing that per-request stream the cancellation signal — the protocol layer aborts requestSignal instead of POSTing notifications/cancelled when this flag is set on a 2026-era connection. Transports that share a single channel (stdio, in-memory) leave it undefined.
onclose?
optionalonclose?: () =>void
Defined in: packages/core-internal/src/shared/transport.ts:146
Callback for when the connection is closed for any reason.
This should be invoked when close() is called as well.
Returns
void
onerror?
optionalonerror?: (error) =>void
Defined in: packages/core-internal/src/shared/transport.ts:153
Callback for when an error occurs.
Note that errors are not necessarily fatal; they are used for reporting any kind of exceptional condition out of band.
Parameters
error
Error
Returns
void
onmessage?
optionalonmessage?: <T>(message,extra?) =>void
Defined in: packages/core-internal/src/shared/transport.ts:162
Callback for when a message (request or response) is received over the connection.
Includes the request and authInfo if the transport is authenticated.
The request can be used to get the original request information (headers, etc.)
Type Parameters
T
T extends JSONRPCMessage
Parameters
message
T
extra?
Returns
void
sessionId?
optionalsessionId?:string
Defined in: packages/core-internal/src/shared/transport.ts:167
The session ID generated for this connection.
setProtocolVersion?
optionalsetProtocolVersion?: (version) =>void
Defined in: packages/core-internal/src/shared/transport.ts:172
Sets the protocol version used for the connection (called when the initialize response is received).
Parameters
version
string
Returns
void
setSupportedProtocolVersions?
optionalsetSupportedProtocolVersions?: (versions) =>void
Defined in: packages/core-internal/src/shared/transport.ts:178
Sets the supported protocol versions for header validation (called during connect). This allows the server to pass its supported versions to the transport.
Parameters
versions
string[]
Returns
void
Methods
close()
close():
Promise<void>
Defined in: packages/core-internal/src/shared/transport.ts:127
Closes the connection.
Returns
Promise<void>
send()
send(
message,options?):Promise<void>
Defined in: packages/core-internal/src/shared/transport.ts:122
Sends a JSON-RPC message (request or response).
If present, relatedRequestId is used to indicate to the transport which incoming request to associate this outgoing message with.
Parameters
message
options?
Returns
Promise<void>
start()
start():
Promise<void>
Defined in: packages/core-internal/src/shared/transport.ts:115
Starts processing messages on the transport, including any connection steps that might need to be taken.
This method should only be called after callbacks are installed, or else messages may be lost.
NOTE: This method should not be called explicitly when using Client or Server classes, as they will implicitly call start().
Returns
Promise<void>
UnsupportedProtocolVersionErrorData
Defined in: packages/core-internal/src/types/types.ts:793
Data carried by a -32022 UnsupportedProtocolVersion protocol error (protocol revision 2026-07-28).
Properties
requested
requested:
string
Defined in: packages/core-internal/src/types/types.ts:802
The protocol version that was requested.
supported
supported:
string[]
Defined in: packages/core-internal/src/types/types.ts:798
Protocol versions the receiver supports. The sender should choose a mutually supported version from this list and retry.
Type Aliases
Annotations
Annotations =
Infer<typeofAnnotationsSchema>
Defined in: packages/core-internal/src/types/types.ts:267
AudioContent
AudioContent =
Infer<typeofAudioContentSchema>
Defined in: packages/core-internal/src/types/types.ts:393
AuthorizationServerMetadata
AuthorizationServerMetadata =
OAuthMetadata|OpenIdProviderDiscoveryMetadata
Defined in: packages/core-internal/src/shared/auth.ts:285
BaseContext
BaseContext =
object
Defined in: packages/core-internal/src/shared/protocol.ts:326
Base context provided to all request handlers.
Properties
http?
optionalhttp?:object
Defined in: packages/core-internal/src/shared/protocol.ts:439
HTTP transport information, only available when using an HTTP-based transport.
authInfo?
optionalauthInfo?:AuthInfo
Information about a validated access token, provided to request handlers.
mcpReq
mcpReq:
object
Defined in: packages/core-internal/src/shared/protocol.ts:335
Information about the MCP request being handled.
_meta?
optional_meta?:RequestMeta
Metadata from the original request, with the reserved io.modelcontextprotocol/* envelope keys already lifted out (readable via ctx.mcpReq.envelope).
droppedInputResponseKeys?
optionaldroppedInputResponseKeys?:string[]
Keys of inputResponses entries the SDK dropped because they were not bare response objects (for example the wrapped {method, result} shape some peers emit). Surfaced so a handler can re-issue the corresponding input request rather than hard-fail.
envelope?
optionalenvelope?:Partial<RequestMetaEnvelope>
The per-request _meta envelope (protocol revision 2026-07-28): the reserved io.modelcontextprotocol/* keys carried by the request, lifted out of the _meta the handler sees. Surfaced as received — Partial because only the keys the request actually carried are present (envelope requiredness is enforced per request at dispatch time, not by the lift); only present at all when the request carried envelope keys.
id
id:
RequestId
The JSON-RPC ID of the request being handled.
inputResponses?
optionalinputResponses?:Record<string,unknown>
Multi-round-trip input responses carried by a retried request (protocol revision 2026-07-28), lifted out of the params the handler sees. Entries are the BARE response objects keyed by the identifiers the server assigned in inputRequests; entries that do not look like bare responses (e.g. a {method, result} wrapper) are dropped and their keys recorded in droppedInputResponseKeys.
The values arrive from the client and are NOT validated by the SDK — treat them as untrusted input.
method
method:
string
The method name of the request (e.g., 'tools/call', 'ping').
notify
notify: (
notification) =>Promise<void>
Sends a notification that relates to the current request being handled.
This is used by certain transports to correctly associate related messages.
Parameters
notification
Returns
Promise<void>
requestState
requestState:
RequestStateAccessor
Reads the multi-round-trip request state for the current round: the value the configured ServerOptions.requestState.verify hook resolved with (e.g. createRequestStateCodec.verify's decoded payload — mint<T>/requestState<T>() are the typed pair), the raw wire string when no hook is configured, or undefined when the round carried no state. The type parameter is a compile-time cast only.
SECURITY: requestState round-trips through the client and MUST be treated as attacker-controlled input. The SDK applies no integrity protection by default — servers whose state influences authorization or business logic MUST integrity-protect it and verify via the requestState.verify hook (spec: basic/patterns/mrtr, server requirements 4–5).
send
send: {<
M>(request,options?):Promise<ResultTypeMap[M]>; <T>(request,resultSchema,options?):Promise<InferOutput<T>>; }
Sends a request that relates to the current request being handled.
This is used by certain transports to correctly associate related messages.
For spec methods the result type is inferred from the method name. For custom (non-spec) methods, pass a result schema as the second argument.
Call Signature
<
M>(request,options?):Promise<ResultTypeMap[M]>
Type Parameters
M
M extends RequestMethod
Parameters
request
method
M
params?
Record<string, unknown>
options?
Returns
Promise<ResultTypeMap[M]>
Call Signature
<
T>(request,resultSchema,options?):Promise<InferOutput<T>>
Type Parameters
T
T extends StandardSchemaV1<unknown, unknown>
Parameters
request
method
string = ...
params?
{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; } = ...
params._meta?
{[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; } = ...
See General fields: _meta for notes on _meta usage.
params._meta.io.modelcontextprotocol/related-task?
{ taskId: string; } = ...
If specified, this request is related to the provided task.
params._meta.io.modelcontextprotocol/related-task.taskId
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.
resultSchema
T
options?
Returns
Promise<InferOutput<T>>
signal
signal:
AbortSignal
An abort signal used to communicate if the request was cancelled from the sender's side.
sessionId?
optionalsessionId?:string
Defined in: packages/core-internal/src/shared/protocol.ts:330
The session ID from the transport, if available.
BaseMetadata
BaseMetadata =
Infer<typeofBaseMetadataSchema>
Defined in: packages/core-internal/src/types/types.ts:266
BlobResourceContents
BlobResourceContents =
Infer<typeofBlobResourceContentsSchema>
Defined in: packages/core-internal/src/types/types.ts:355
BooleanSchema
BooleanSchema =
Infer<typeofBooleanSchemaSchema>
Defined in: packages/core-internal/src/types/types.ts:520
CallToolRequest
CallToolRequest =
Infer<typeofCallToolRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:422
CallToolRequestParams
CallToolRequestParams =
Infer<typeofCallToolRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:419
CallToolResult
CallToolResult =
StripWireOnly<Infer<typeofCallToolResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:420
CancelledNotification
CancelledNotification =
Infer<typeofCancelledNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:261
CancelledNotificationParams
CancelledNotificationParams =
Infer<typeofCancelledNotificationParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:260
CancelTaskRequest
CancelTaskRequest =
Infer<typeofCancelTaskRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:341
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
CancelTaskResult
CancelTaskResult =
StripWireOnly<Infer<typeofCancelTaskResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:343
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
CfWorkerSchemaDraft
CfWorkerSchemaDraft =
"4"|"7"|"2019-09"|"2020-12"
Defined in: packages/core-internal/src/validators/cfWorkerProvider.ts:18
JSON Schema draft version supported by @cfworker/json-schema.
ClientCapabilities
ClientCapabilities =
Infer<typeofClientCapabilitiesSchema>
Defined in: packages/core-internal/src/types/types.ts:279
Capabilities a client may support.
Note: the roots and sampling capabilities are deprecated as of protocol version 2026-07-28 (SEP-2577); they remain in the specification for at least twelve months. See ClientCapabilitiesSchema.
ClientContext
ClientContext =
BaseContext
Defined in: packages/core-internal/src/shared/protocol.ts:510
Context provided to client-side request handlers.
ClientNotification
ClientNotification =
Infer<typeofClientNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:654
ClientRequest
ClientRequest =
Infer<typeofClientRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:653
ClientResult
ClientResult =
StripWireOnly<Infer<typeofClientResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:655
CompatibilityCallToolResult
CompatibilityCallToolResult =
StripWireOnly<Infer<typeofCompatibilityCallToolResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:421
CompleteRequest
CompleteRequest =
Infer<typeofCompleteRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:546
CompleteRequestParams
CompleteRequestParams =
Infer<typeofCompleteRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:545
CompleteRequestPrompt
CompleteRequestPrompt =
ExpandRecursively<CompleteRequest&object>
Defined in: packages/core-internal/src/types/types.ts:946
CompleteRequestResourceTemplate
CompleteRequestResourceTemplate =
ExpandRecursively<CompleteRequest&object>
Defined in: packages/core-internal/src/types/types.ts:943
CompleteResult
CompleteResult =
StripWireOnly<Infer<typeofCompleteResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:547
ContentBlock
ContentBlock =
Infer<typeofContentBlockSchema>
Defined in: packages/core-internal/src/types/types.ts:408
CreateMessageRequest
CreateMessageRequest =
Infer<typeofCreateMessageRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:505
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
CreateMessageRequestParams
CreateMessageRequestParams =
Infer<typeofCreateMessageRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:499
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
CreateMessageRequestParamsBase
CreateMessageRequestParamsBase =
Omit<CreateMessageRequestParams,"tools"|"toolChoice">
Defined in: packages/core-internal/src/types/types.ts:930
CreateMessageRequestParams without tools - for backwards-compatible overload. Excludes tools/toolChoice to indicate they should not be provided.
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
CreateMessageResult
CreateMessageResult =
StripWireOnly<Infer<typeofCreateMessageResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:511
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
CreateMessageResultWithTools
CreateMessageResultWithTools =
StripWireOnly<Infer<typeofCreateMessageResultWithToolsSchema>>
Defined in: packages/core-internal/src/types/types.ts:517
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
CreateTaskResult
CreateTaskResult =
StripWireOnly<Infer<typeofCreateTaskResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:325
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
Cursor
Cursor =
Infer<typeofCursorSchema>
Defined in: packages/core-internal/src/types/types.ts:222
DiscoverRequest
DiscoverRequest =
Infer<typeofDiscoverRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:294
DiscoverResult
DiscoverResult =
StripWireOnly<Infer<typeofDiscoverResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:295
ElicitationCompleteNotification
ElicitationCompleteNotification =
Infer<typeofElicitationCompleteNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:539
Deprecated
Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification.
ElicitationCompleteNotificationParams
ElicitationCompleteNotificationParams =
Infer<typeofElicitationCompleteNotificationParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:537
Deprecated
Removed from the spec by #2891 (2026-07-28). 2025-era only; the 2026-07-28 wire codec excludes this notification.
ElicitRequest
ElicitRequest =
Infer<typeofElicitRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:535
ElicitRequestFormParams
ElicitRequestFormParams =
Infer<typeofElicitRequestFormParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:533
ElicitRequestParams
ElicitRequestParams =
Infer<typeofElicitRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:532
ElicitRequestURLParams
ElicitRequestURLParams =
Infer<typeofElicitRequestURLParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:534
ElicitResult
ElicitResult =
StripWireOnly<Infer<typeofElicitResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:540
EmbeddedResource
EmbeddedResource =
Infer<typeofEmbeddedResourceSchema>
Defined in: packages/core-internal/src/types/types.ts:406
EmptyResult
EmptyResult =
StripWireOnly<Infer<typeofEmptyResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:257
EnumSchema
EnumSchema =
Infer<typeofEnumSchemaSchema>
Defined in: packages/core-internal/src/types/types.ts:523
FetchLike
FetchLike = (
url,init?) =>Promise<Response>
Defined in: packages/core-internal/src/shared/transport.ts:3
Parameters
url
string | URL
init?
RequestInit
Returns
Promise<Response>
GetPromptRequest
GetPromptRequest =
Infer<typeofGetPromptRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:390
GetPromptRequestParams
GetPromptRequestParams =
Infer<typeofGetPromptRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:389
GetPromptResult
GetPromptResult =
StripWireOnly<Infer<typeofGetPromptResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:410
GetTaskPayloadRequest
GetTaskPayloadRequest =
Infer<typeofGetTaskPayloadRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:335
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
GetTaskPayloadResult
GetTaskPayloadResult =
StripWireOnly<Infer<typeofGetTaskPayloadResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:345
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
GetTaskRequest
GetTaskRequest =
Infer<typeofGetTaskRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:331
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
GetTaskResult
GetTaskResult =
StripWireOnly<Infer<typeofGetTaskResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:333
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
HandlerResultTypeMap
HandlerResultTypeMap = { [M in keyof ResultTypeMap]: M extends "tools/call" | "prompts/get" | "resources/read" ? ResultTypeMap[M] | InputRequiredResult : ResultTypeMap[M] }
Defined in: packages/core-internal/src/types/types.ts:715
The handler-return counterpart of ResultTypeMap: what a registered request handler may RETURN for each method. Identical to ResultTypeMap except that the multi-round-trip methods (tools/call, prompts/get, resources/read) additionally accept an InputRequiredResult (protocol revision 2026-07-28).
ResultTypeMap itself — what a requester receives — is deliberately NOT widened: client.callTool() returns a plain CallToolResult on both protocol eras.
Icon
Icon =
Infer<typeofIconSchema>
Defined in: packages/core-internal/src/types/types.ts:264
Icons
Icons =
Infer<typeofIconsSchema>
Defined in: packages/core-internal/src/types/types.ts:265
IdJagTokenExchangeResponse
IdJagTokenExchangeResponse =
z.infer<typeofIdJagTokenExchangeResponseSchema>
Defined in: packages/core-internal/src/shared/auth.ts:163
ImageContent
ImageContent =
Infer<typeofImageContentSchema>
Defined in: packages/core-internal/src/types/types.ts:392
Implementation
Implementation =
Infer<typeofImplementationSchema>
Defined in: packages/core-internal/src/types/types.ts:271
InitializedNotification
InitializedNotification =
Infer<typeofInitializedNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:291
InitializeRequest
InitializeRequest =
Infer<typeofInitializeRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:281
InitializeRequestParams
InitializeRequestParams =
Infer<typeofInitializeRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:280
InitializeResult
InitializeResult =
StripWireOnly<Infer<typeofInitializeResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:290
InputRequest
InputRequest =
CreateMessageRequest|ListRootsRequest|ElicitRequest
Defined in: packages/core-internal/src/types/types.ts:592
A single embedded (de-JSON-RPC'd) input request inside an InputRequiredResult: an elicitation, sampling, or roots request object carried in-band rather than sent as a server→client JSON-RPC request.
InputResponse
InputResponse =
CreateMessageResult|ListRootsResult|ElicitResult
Defined in: packages/core-internal/src/types/types.ts:599
A single embedded (de-JSON-RPC'd) input response inside a retried request's inputResponses: the bare result object for the corresponding InputRequest (never wrapped in a {method, result} envelope).
JSONArray
JSONArray =
JSONValue[]
Defined in: packages/core-internal/src/types/types.ts:181
JSONObject
JSONObject =
object
Defined in: packages/core-internal/src/types/types.ts:180
Index Signature
[key: string]: JSONValue
JSONRPCErrorResponse
JSONRPCErrorResponse =
Infer<typeofJSONRPCErrorResponseSchema>
Defined in: packages/core-internal/src/types/types.ts:232
JSONRPCMessage
JSONRPCMessage =
JSONRPCRequest|JSONRPCNotification|JSONRPCResultResponse|JSONRPCErrorResponse
Defined in: packages/core-internal/src/types/types.ts:237
JSONRPCNotification
JSONRPCNotification =
Infer<typeofJSONRPCNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:231
JSONRPCRequest
JSONRPCRequest =
Infer<typeofJSONRPCRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:230
JSONRPCResponse
JSONRPCResponse =
JSONRPCResultResponse|JSONRPCErrorResponse
Defined in: packages/core-internal/src/types/types.ts:236
JSONRPCResultResponse
JSONRPCResultResponse =
Omit<Infer<typeofJSONRPCResultResponseSchema>,"result"> &object
Defined in: packages/core-internal/src/types/types.ts:235
Type Declaration
result
result:
Result
JsonSchemaType
JsonSchemaType =
JSONSchema.Interface
Defined in: packages/core-internal/src/validators/types.ts:14
JSON Schema type definition (JSON Schema Draft 2020-12)
This uses the object form of JSON Schema (excluding boolean schemas). While true and false are valid JSON Schemas, this SDK uses the object form for practical type safety.
Re-exported from json-schema-typed for convenience.
See
https://json-schema.org/draft/2020-12/json-schema-core.html
JsonSchemaValidator
JsonSchemaValidator<
T> = (input) =>JsonSchemaValidatorResult<T>
Defined in: packages/core-internal/src/validators/types.ts:26
A validator function that validates data against a JSON Schema
Type Parameters
T
T
Parameters
input
unknown
Returns
JsonSchemaValidatorResult
JsonSchemaValidatorResult<
T> = {data:T;errorMessage:undefined;valid:true; } | {data:undefined;errorMessage:string;valid:false; }
Defined in: packages/core-internal/src/validators/types.ts:19
Result of a JSON Schema validation operation
Type Parameters
T
T
JSONValue
JSONValue =
string|number|boolean|null|JSONObject|JSONArray
Defined in: packages/core-internal/src/types/types.ts:179
LegacyTitledEnumSchema
LegacyTitledEnumSchema =
Infer<typeofLegacyTitledEnumSchemaSchema>
Defined in: packages/core-internal/src/types/types.ts:526
ListChangedCallback
ListChangedCallback<
T> = (error,items) =>void
Defined in: packages/core-internal/src/types/types.ts:808
Callback type for list changed notifications.
Type Parameters
T
T
Parameters
error
Error | null
items
T[] | null
Returns
void
ListChangedHandlers
ListChangedHandlers =
object
Defined in: packages/core-internal/src/types/types.ts:845
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?
optionalprompts?:ListChangedOptions<Prompt>
Defined in: packages/core-internal/src/types/types.ts:853
Handler for prompt list changes.
resources?
optionalresources?:ListChangedOptions<Resource>
Defined in: packages/core-internal/src/types/types.ts:857
Handler for resource list changes.
tools?
optionaltools?:ListChangedOptions<Tool>
Defined in: packages/core-internal/src/types/types.ts:849
Handler for tool list changes.
ListChangedOptions
ListChangedOptions<
T> =object
Defined in: packages/core-internal/src/types/types.ts:815
Options for subscribing to list changed notifications.
Type Parameters
T
T
The type of items in the list (Tool, Prompt, or Resource)
Properties
autoRefresh?
optionalautoRefresh?:boolean
Defined in: packages/core-internal/src/types/types.ts:820
If true, the list will be refreshed automatically when a list changed notification is received.
Default
truedebounceMs?
optionaldebounceMs?:number
Defined in: packages/core-internal/src/types/types.ts:825
Debounce time in milliseconds. Set to 0 to disable.
Default
300onChanged
onChanged:
ListChangedCallback<T>
Defined in: packages/core-internal/src/types/types.ts:832
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<typeofListPromptsRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:387
ListPromptsResult
ListPromptsResult =
StripWireOnly<Infer<typeofListPromptsResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:388
ListResourcesRequest
ListResourcesRequest =
Infer<typeofListResourcesRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:359
ListResourcesResult
ListResourcesResult =
StripWireOnly<Infer<typeofListResourcesResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:360
ListResourceTemplatesRequest
ListResourceTemplatesRequest =
Infer<typeofListResourceTemplatesRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:361
ListResourceTemplatesResult
ListResourceTemplatesResult =
StripWireOnly<Infer<typeofListResourceTemplatesResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:362
ListRootsRequest
ListRootsRequest =
Infer<typeofListRootsRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:561
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to passing paths via tool parameters, resource URIs, or configuration.
ListRootsResult
ListRootsResult =
StripWireOnly<Infer<typeofListRootsResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:567
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to passing paths via tool parameters, resource URIs, or configuration.
ListTasksRequest
ListTasksRequest =
Infer<typeofListTasksRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:337
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
ListTasksResult
ListTasksResult =
StripWireOnly<Infer<typeofListTasksResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:339
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
ListToolsRequest
ListToolsRequest =
Infer<typeofListToolsRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:417
ListToolsResult
ListToolsResult =
StripWireOnly<Infer<typeofListToolsResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:418
LoggingLevel
LoggingLevel =
Infer<typeofLoggingLevelSchema>
Defined in: packages/core-internal/src/types/types.ts:431
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to stderr logging (STDIO servers) or OpenTelemetry.
LoggingMessageNotification
LoggingMessageNotification =
Infer<typeofLoggingMessageNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:455
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to stderr logging (STDIO servers) or OpenTelemetry.
LoggingMessageNotificationParams
LoggingMessageNotificationParams =
Infer<typeofLoggingMessageNotificationParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:449
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to stderr logging (STDIO servers) or OpenTelemetry.
MetaObject
MetaObject =
Record<string,unknown>
Defined in: packages/core-internal/src/types/types.ts:919
ModelHint
ModelHint =
Infer<typeofModelHintSchema>
Defined in: packages/core-internal/src/types/types.ts:469
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
ModelPreferences
ModelPreferences =
Infer<typeofModelPreferencesSchema>
Defined in: packages/core-internal/src/types/types.ts:475
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
MultiSelectEnumSchema
MultiSelectEnumSchema =
Infer<typeofMultiSelectEnumSchemaSchema>
Defined in: packages/core-internal/src/types/types.ts:530
Notification
Notification =
Infer<typeofNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:227
NotificationMethod
NotificationMethod =
Exclude<ClientNotification["method"] |ServerNotification["method"],TaskNotificationMethod>
Defined in: packages/core-internal/src/types/types.ts:676
NotificationOptions
NotificationOptions =
object
Defined in: packages/core-internal/src/shared/protocol.ts:172
Options that can be given per notification.
Properties
relatedRequestId?
optionalrelatedRequestId?:RequestId
Defined in: packages/core-internal/src/shared/protocol.ts:176
May be used to indicate to the transport which incoming request to associate this outgoing notification with.
NotificationParams
NotificationParams =
Infer<typeofNotificationsParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:239
NotificationTypeMap
NotificationTypeMap =
MethodToTypeMap<Exclude<ClientNotification|ServerNotification, {method:TaskNotificationMethod; }>>
Defined in: packages/core-internal/src/types/types.ts:678
NumberSchema
NumberSchema =
Infer<typeofNumberSchemaSchema>
Defined in: packages/core-internal/src/types/types.ts:522
OAuthClientInformation
OAuthClientInformation =
z.infer<typeofOAuthClientInformationSchema>
Defined in: packages/core-internal/src/shared/auth.ts:257
OAuthClientInformationFull
OAuthClientInformationFull =
z.infer<typeofOAuthClientInformationFullSchema>
Defined in: packages/core-internal/src/shared/auth.ts:258
OAuthClientInformationMixed
OAuthClientInformationMixed =
OAuthClientInformation|OAuthClientInformationFull
Defined in: packages/core-internal/src/shared/auth.ts:259
OAuthClientMetadata
OAuthClientMetadata =
z.infer<typeofOAuthClientMetadataSchema>
Defined in: packages/core-internal/src/shared/auth.ts:256
OAuthClientRegistrationError
OAuthClientRegistrationError =
z.infer<typeofOAuthClientRegistrationErrorSchema>
Defined in: packages/core-internal/src/shared/auth.ts:280
OAuthErrorResponse
OAuthErrorResponse =
z.infer<typeofOAuthErrorResponseSchema>
Defined in: packages/core-internal/src/shared/auth.ts:255
OAuthMetadata
OAuthMetadata =
z.infer<typeofOAuthMetadataSchema>
Defined in: packages/core-internal/src/shared/auth.ts:250
OAuthProtectedResourceMetadata
OAuthProtectedResourceMetadata =
z.infer<typeofOAuthProtectedResourceMetadataSchema>
Defined in: packages/core-internal/src/shared/auth.ts:282
OAuthTokenRevocationRequest
OAuthTokenRevocationRequest =
z.infer<typeofOAuthTokenRevocationRequestSchema>
Defined in: packages/core-internal/src/shared/auth.ts:281
OAuthTokens
OAuthTokens =
z.infer<typeofOAuthTokensSchema>
Defined in: packages/core-internal/src/shared/auth.ts:254
OpenIdProviderDiscoveryMetadata
OpenIdProviderDiscoveryMetadata =
z.infer<typeofOpenIdProviderDiscoveryMetadataSchema>
Defined in: packages/core-internal/src/shared/auth.ts:252
OpenIdProviderMetadata
OpenIdProviderMetadata =
z.infer<typeofOpenIdProviderMetadataSchema>
Defined in: packages/core-internal/src/shared/auth.ts:251
PaginatedRequest
PaginatedRequest =
Infer<typeofPaginatedRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:349
PaginatedRequestParams
PaginatedRequestParams =
Infer<typeofPaginatedRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:348
PaginatedResult
PaginatedResult =
StripWireOnly<Infer<typeofPaginatedResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:350
PingRequest
PingRequest =
Infer<typeofPingRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:298
PrimitiveSchemaDefinition
PrimitiveSchemaDefinition =
Infer<typeofPrimitiveSchemaDefinitionSchema>
Defined in: packages/core-internal/src/types/types.ts:531
Progress
Progress =
Infer<typeofProgressSchema>
Defined in: packages/core-internal/src/types/types.ts:301
ProgressCallback
ProgressCallback = (
progress) =>void
Defined in: packages/core-internal/src/shared/protocol.ts:59
Callback for progress notifications.
Parameters
progress
Returns
void
ProgressNotification
ProgressNotification =
Infer<typeofProgressNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:303
ProgressNotificationParams
ProgressNotificationParams =
Infer<typeofProgressNotificationParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:302
ProgressToken
ProgressToken =
Infer<typeofProgressTokenSchema>
Defined in: packages/core-internal/src/types/types.ts:221
Prompt
Prompt =
Infer<typeofPromptSchema>
Defined in: packages/core-internal/src/types/types.ts:386
PromptArgument
PromptArgument =
Infer<typeofPromptArgumentSchema>
Defined in: packages/core-internal/src/types/types.ts:385
PromptListChangedNotification
PromptListChangedNotification =
Infer<typeofPromptListChangedNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:411
PromptMessage
PromptMessage =
Infer<typeofPromptMessageSchema>
Defined in: packages/core-internal/src/types/types.ts:409
PromptReference
PromptReference =
Infer<typeofPromptReferenceSchema>
Defined in: packages/core-internal/src/types/types.ts:544
ProtocolEra
ProtocolEra =
"legacy"|"modern"
Defined in: packages/core-internal/src/shared/protocolEras.ts:19
The protocol era of a connection: 'legacy' for the 2025-11-25 family and earlier (negotiated via initialize), 'modern' for 2026-07-28 and later (negotiated via server/discover; every request carries a _meta envelope).
ProtocolOptions
ProtocolOptions =
object
Defined in: packages/core-internal/src/shared/protocol.ts:64
Additional initialization options.
Properties
debouncedNotificationMethods?
optionaldebouncedNotificationMethods?:string[]
Defined in: packages/core-internal/src/shared/protocol.ts:89
An array of notification method names that should be automatically debounced. Any notifications with a method in this list will be coalesced if they occur in the same tick of the event loop. e.g., ['notifications/tools/list_changed']
enforceStrictCapabilities?
optionalenforceStrictCapabilities?:boolean
Defined in: packages/core-internal/src/shared/protocol.ts:82
Whether to restrict emitted requests to only those that the remote side has indicated that they can handle, through their advertised capabilities.
Note that this DOES NOT affect checking of local side capabilities, as it is considered a logic error to mis-specify those.
Currently this defaults to false, for backwards compatibility with SDK versions that did not advertise capabilities correctly. In future, this will default to true.
supportedProtocolVersions?
optionalsupportedProtocolVersions?:string[]
Defined in: packages/core-internal/src/shared/protocol.ts:73
Protocol versions supported. The legacy initialize handshake offers and falls back to the first 2025-era entry in the list (the client sends it, the server counter-offers it); 2026-era entries are only ever selected via server/discover. Passed to transport during connect().
Default
ReadResourceRequest
ReadResourceRequest =
Infer<typeofReadResourceRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:365
ReadResourceRequestParams
ReadResourceRequestParams =
Infer<typeofReadResourceRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:364
ReadResourceResult
ReadResourceResult =
StripWireOnly<Infer<typeofReadResourceResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:366
RelatedTaskMetadata
RelatedTaskMetadata =
Infer<typeofRelatedTaskMetadataSchema>
Defined in: packages/core-internal/src/types/types.ts:323
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
Request
Request =
Infer<typeofRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:223
RequestId
RequestId =
Infer<typeofRequestIdSchema>
Defined in: packages/core-internal/src/types/types.ts:229
RequestMeta
RequestMeta =
Infer<typeofRequestMetaSchema>
Defined in: packages/core-internal/src/types/types.ts:226
RequestMetaEnvelope
RequestMetaEnvelope =
object
Defined in: packages/core-internal/src/types/types.ts:249
The per-request _meta envelope carried by every request under protocol revision 2026-07-28 (protocol version, client info, client capabilities, optional log level).
Neutral hand-written shape keyed by the public meta-key constants — never inferred from a wire-module schema (this neutral layer does not import from wire/rev*). A type alias rather than an interface so it stays assignable to _meta's string-indexed object slot.
Properties
io.modelcontextprotocol/clientCapabilities
io.modelcontextprotocol/clientCapabilities:
ClientCapabilities
Defined in: packages/core-internal/src/types/types.ts:252
io.modelcontextprotocol/clientInfo
io.modelcontextprotocol/clientInfo:
Implementation
Defined in: packages/core-internal/src/types/types.ts:251
io.modelcontextprotocol/logLevel?
optionalio.modelcontextprotocol/logLevel?:LoggingLevel
Defined in: packages/core-internal/src/types/types.ts:253
io.modelcontextprotocol/protocolVersion
io.modelcontextprotocol/protocolVersion:
string
Defined in: packages/core-internal/src/types/types.ts:250
RequestMetaObject
RequestMetaObject =
RequestMeta
Defined in: packages/core-internal/src/types/types.ts:920
RequestMethod
RequestMethod =
Exclude<ClientRequest["method"] |ServerRequest["method"],TaskRequestMethod>
Defined in: packages/core-internal/src/types/types.ts:675
RequestOptions
RequestOptions =
object&TransportSendOptions
Defined in: packages/core-internal/src/shared/protocol.ts:100
Options that can be given per request.
Type Declaration
allowInputRequired?
optionalallowInputRequired?:boolean
Manual multi-round-trip mode for this call (protocol revision 2026-07-28): when the response is an input_required result, hand it back to the caller instead of auto-fulfilling it (or raising a typed error). The resolved value is the neutral input-required shape (resultType: 'input_required', inputRequests?, requestState?); wrap the result schema with withInputRequired() on the explicit schema path to type both outcomes. The caller is then responsible for gathering the requested input and retrying the original request with inputResponses / requestState params and a fresh request.
Default: false.
maxTotalTimeout?
optionalmaxTotalTimeout?:number
Maximum total time (in milliseconds) to wait for a response. If exceeded, an SdkError with code SdkErrorCode.RequestTimeout will be raised, regardless of progress notifications. If not specified, there is no maximum total timeout.
For multi-round-trip requests fulfilled by the auto-fulfilment driver (protocol revision 2026-07-28), the budget bounds the WHOLE flow: every retry leg is given only the time remaining.
onprogress?
optionalonprogress?:ProgressCallback
If set, requests progress notifications from the remote end (if supported). When progress notifications are received, this callback will be invoked.
resetTimeoutOnProgress?
optionalresetTimeoutOnProgress?:boolean
If true, receiving a progress notification will reset the request timeout. This is useful for long-running operations that send periodic progress updates. Default: false
signal?
optionalsignal?:AbortSignal
Can be used to cancel an in-flight request. This will cause an AbortError to be raised from request().
timeout?
optionaltimeout?:number
A timeout (in milliseconds) for this request. If exceeded, an SdkError with code SdkErrorCode.RequestTimeout will be raised from request().
If not specified, DEFAULT_REQUEST_TIMEOUT_MSEC will be used as the timeout.
RequestParams
RequestParams =
Infer<typeofBaseRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:238
RequestStateAccessor
RequestStateAccessor = <
T>() =>T|undefined
Defined in: packages/core-internal/src/shared/protocol.ts:292
The type of ctx.mcpReq.requestState. The type parameter is caller-asserted (no validation, like the two-argument acceptedContent<T>) — pair with createRequestStateCodec<T> so the claim is backed by the codec's verification.
Type Parameters
T
T = unknown
Returns
T | undefined
RequestTypeMap
RequestTypeMap =
MethodToTypeMap<Exclude<ClientRequest|ServerRequest, {method:TaskRequestMethod; }>>
Defined in: packages/core-internal/src/types/types.ts:677
Resource
Resource =
Infer<typeofResourceSchema>
Defined in: packages/core-internal/src/types/types.ts:356
ResourceContents
ResourceContents =
Infer<typeofResourceContentsSchema>
Defined in: packages/core-internal/src/types/types.ts:353
ResourceLink
ResourceLink =
Infer<typeofResourceLinkSchema>
Defined in: packages/core-internal/src/types/types.ts:407
ResourceListChangedNotification
ResourceListChangedNotification =
Infer<typeofResourceListChangedNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:367
ResourceRequestParams
ResourceRequestParams =
Infer<typeofResourceRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:363
ResourceTemplateReference
ResourceTemplateReference =
Infer<typeofResourceTemplateReferenceSchema>
Defined in: packages/core-internal/src/types/types.ts:543
ResourceTemplateType
ResourceTemplateType =
Infer<typeofResourceTemplateSchema>
Defined in: packages/core-internal/src/types/types.ts:358
ResourceUpdatedNotification
ResourceUpdatedNotification =
Infer<typeofResourceUpdatedNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:373
ResourceUpdatedNotificationParams
ResourceUpdatedNotificationParams =
Infer<typeofResourceUpdatedNotificationParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:372
Result
Result =
StripWireOnly<Infer<typeofResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:228
ResultTypeMap
ResultTypeMap =
object
Defined in: packages/core-internal/src/types/types.ts:679
Properties
completion/complete
completion/complete:
CompleteResult
Defined in: packages/core-internal/src/types/types.ts:683
elicitation/create
elicitation/create:
ElicitResult
Defined in: packages/core-internal/src/types/types.ts:700
initialize
initialize:
InitializeResult
Defined in: packages/core-internal/src/types/types.ts:681
logging/setLevel
logging/setLevel:
EmptyResult
Defined in: packages/core-internal/src/types/types.ts:684
ping
ping:
EmptyResult
Defined in: packages/core-internal/src/types/types.ts:680
prompts/get
prompts/get:
GetPromptResult
Defined in: packages/core-internal/src/types/types.ts:685
prompts/list
prompts/list:
ListPromptsResult
Defined in: packages/core-internal/src/types/types.ts:686
resources/list
resources/list:
ListResourcesResult
Defined in: packages/core-internal/src/types/types.ts:687
resources/read
resources/read:
ReadResourceResult
Defined in: packages/core-internal/src/types/types.ts:689
resources/subscribe
resources/subscribe:
EmptyResult
Defined in: packages/core-internal/src/types/types.ts:690
resources/templates/list
resources/templates/list:
ListResourceTemplatesResult
Defined in: packages/core-internal/src/types/types.ts:688
resources/unsubscribe
resources/unsubscribe:
EmptyResult
Defined in: packages/core-internal/src/types/types.ts:691
roots/list
roots/list:
ListRootsResult
Defined in: packages/core-internal/src/types/types.ts:701
sampling/createMessage
sampling/createMessage:
CreateMessageResult|CreateMessageResultWithTools
Defined in: packages/core-internal/src/types/types.ts:699
server/discover
server/discover:
DiscoverResult
Defined in: packages/core-internal/src/types/types.ts:682
subscriptions/listen
subscriptions/listen:
SubscriptionsListenResult
Defined in: packages/core-internal/src/types/types.ts:696
tools/call
tools/call:
CallToolResult
Defined in: packages/core-internal/src/types/types.ts:697
tools/list
tools/list:
ListToolsResult
Defined in: packages/core-internal/src/types/types.ts:698
Role
Role =
Infer<typeofRoleSchema>
Defined in: packages/core-internal/src/types/types.ts:268
Root
Root =
Infer<typeofRootSchema>
Defined in: packages/core-internal/src/types/types.ts:555
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to passing paths via tool parameters, resource URIs, or configuration.
RootsListChangedNotification
RootsListChangedNotification =
Infer<typeofRootsListChangedNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:573
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to passing paths via tool parameters, resource URIs, or configuration.
SamplingContent
SamplingContent =
Infer<typeofSamplingContentSchema>
Defined in: packages/core-internal/src/types/types.ts:481
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
SamplingMessage
SamplingMessage =
Infer<typeofSamplingMessageSchema>
Defined in: packages/core-internal/src/types/types.ts:493
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
SamplingMessageContentBlock
SamplingMessageContentBlock =
Infer<typeofSamplingMessageContentBlockSchema>
Defined in: packages/core-internal/src/types/types.ts:487
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
ServerCapabilities
ServerCapabilities =
Infer<typeofServerCapabilitiesSchema>
Defined in: packages/core-internal/src/types/types.ts:289
Capabilities a server may support.
Note: the logging capability is deprecated as of protocol version 2026-07-28 (SEP-2577); it remains in the specification for at least twelve months. See ServerCapabilitiesSchema.
ServerContext
ServerContext =
BaseContext&object
Defined in: packages/core-internal/src/shared/protocol.ts:450
Context provided to server-side request handlers, extending BaseContext with server-specific fields.
Type Declaration
http?
optionalhttp?:object
http.closeSSE?
optionalcloseSSE?: () =>void
Closes the SSE stream for this request, triggering client reconnection. Only available when using a StreamableHTTPServerTransport with eventStore configured.
Returns
void
http.closeStandaloneSSE?
optionalcloseStandaloneSSE?: () =>void
Closes the standalone GET SSE stream, triggering client reconnection. Only available when using a StreamableHTTPServerTransport with eventStore configured.
Returns
void
http.req?
optionalreq?:globalThis.Request
The original HTTP request.
mcpReq
mcpReq:
object
mcpReq.elicitInput
elicitInput: (
params,options?) =>Promise<ElicitResult>
Send an elicitation request to the client, requesting user input.
Parameters
params
ElicitRequestFormParams | ElicitRequestURLParams
options?
Returns
Promise<ElicitResult>
Deprecated
Throws on a 2026-07-28-era request — return inputRequired(...) (multi-round-trip) from the handler instead. The 2025 push-style server-to-client request model is replaced by input_required results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.
mcpReq.log
log: (
level,data,logger?) =>Promise<void>
Send a log message notification to the client. Respects the client's log level filter set via logging/setLevel.
Parameters
level
data
unknown
logger?
string
Returns
Promise<void>
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577). Remains functional during the deprecation window (at least twelve months). Migrate to stderr logging (STDIO servers) or OpenTelemetry.
mcpReq.requestSampling
requestSampling: (
params,options?) =>Promise<CreateMessageResult|CreateMessageResultWithTools>
Request LLM sampling from the client.
Parameters
params
CreateMessageRequest["params"]
options?
Returns
Promise<CreateMessageResult | CreateMessageResultWithTools>
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577). Throws on a 2026-07-28-era request — return inputRequired(...) (multi-round-trip) from the handler instead, or migrate to calling LLM provider APIs directly. The 2025 push-style server-to-client request model is replaced by input_required results in the 2026-07-28 protocol. If your factory serves both eras, this only works on the legacy path.
ServerNotification
ServerNotification =
Infer<typeofServerNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:659
ServerRequest
ServerRequest =
Infer<typeofServerRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:658
ServerResult
ServerResult =
StripWireOnly<Infer<typeofServerResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:660
SetLevelRequest
SetLevelRequest =
Infer<typeofSetLevelRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:443
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to stderr logging (STDIO servers) or OpenTelemetry.
SetLevelRequestParams
SetLevelRequestParams =
Infer<typeofSetLevelRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:437
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to stderr logging (STDIO servers) or OpenTelemetry.
SingleSelectEnumSchema
SingleSelectEnumSchema =
Infer<typeofSingleSelectEnumSchemaSchema>
Defined in: packages/core-internal/src/types/types.ts:529
SpecTypeName
SpecTypeName =
StripSchemaSuffix<SchemaKey>
Defined in: packages/core-internal/src/types/specTypeSchema.ts:229
Union of every named type in the SDK's protocol and OAuth schemas (e.g. 'CallToolResult', 'ContentBlock', 'Tool', 'OAuthTokens'). Derived from the internal Zod schemas, so it stays in sync with the spec.
SpecTypes
SpecTypes =
{ [K in SchemaKey as StripSchemaSuffix<K>]: SchemaFor<K> extends z.ZodType ? z.output<SchemaFor<K>> : never }
Defined in: packages/core-internal/src/types/specTypeSchema.ts:241
Maps each SpecTypeName to its TypeScript type.
SpecTypes['Tool'] is equivalent to importing the Tool type directly. These validators cover the NEUTRAL model — the consumer-facing shapes with no wire-only members (resultType, the reserved _meta envelope keys). Per-revision WIRE validators are deliberately not public surface; they are planned to return as versioned zod-schemas/<revision> exports for consumers who validate raw wire traffic themselves.
StoredOAuthClientInformation
StoredOAuthClientInformation =
OAuthClientInformationMixed&object
Defined in: packages/core-internal/src/shared/auth.ts:278
OAuthClientInformationMixed as persisted by an OAuthClientProvider. Adds an SDK-stamped authorization-server issuer identifier so stored client credentials are bound to the AS that issued them. The issuer field is not part of the RFC 7591 wire response and is intentionally absent from the wire-response schema; the client SDK writes it before calling saveClientInformation.
Type Declaration
issuer?
optionalissuer?:string
StoredOAuthTokens
StoredOAuthTokens =
OAuthTokens&object
Defined in: packages/core-internal/src/shared/auth.ts:268
OAuthTokens as persisted by an OAuthClientProvider. Adds an SDK-stamped authorization-server issuer identifier so stored tokens are bound to the AS that issued them. The issuer field is not part of the RFC 6749 wire response and is intentionally absent from the wire-response schema; the client SDK writes it before calling saveTokens.
Type Declaration
issuer?
optionalissuer?:string
StringSchema
StringSchema =
Infer<typeofStringSchemaSchema>
Defined in: packages/core-internal/src/types/types.ts:521
SubscribeRequest
SubscribeRequest =
Infer<typeofSubscribeRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:369
SubscribeRequestParams
SubscribeRequestParams =
Infer<typeofSubscribeRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:368
SubscriptionFilter
SubscriptionFilter =
Infer<typeofSubscriptionFilterSchema>
Defined in: packages/core-internal/src/types/types.ts:376
SubscriptionsAcknowledgedNotification
SubscriptionsAcknowledgedNotification =
Infer<typeofSubscriptionsAcknowledgedNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:380
SubscriptionsAcknowledgedNotificationParams
SubscriptionsAcknowledgedNotificationParams =
Infer<typeofSubscriptionsAcknowledgedNotificationParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:379
SubscriptionsListenRequest
SubscriptionsListenRequest =
Infer<typeofSubscriptionsListenRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:378
SubscriptionsListenRequestParams
SubscriptionsListenRequestParams =
Infer<typeofSubscriptionsListenRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:377
SubscriptionsListenResult
SubscriptionsListenResult =
StripWireOnly<Infer<typeofSubscriptionsListenResultSchema>>
Defined in: packages/core-internal/src/types/types.ts:382
SubscriptionsListenResultMeta
SubscriptionsListenResultMeta =
Infer<typeofSubscriptionsListenResultMetaSchema>
Defined in: packages/core-internal/src/types/types.ts:381
Task
Task =
Infer<typeofTaskSchema>
Defined in: packages/core-internal/src/types/types.ts:315
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
TaskAugmentedRequestParams
TaskAugmentedRequestParams =
Infer<typeofTaskAugmentedRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:225
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
TaskCreationParams
TaskCreationParams =
Infer<typeofTaskCreationParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:319
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
TaskMetadata
TaskMetadata =
Infer<typeofTaskMetadataSchema>
Defined in: packages/core-internal/src/types/types.ts:321
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
TaskStatus
TaskStatus =
Infer<typeofTaskStatusSchema>
Defined in: packages/core-internal/src/types/types.ts:317
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
TaskStatusNotification
TaskStatusNotification =
Infer<typeofTaskStatusNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:329
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
TaskStatusNotificationParams
TaskStatusNotificationParams =
Infer<typeofTaskStatusNotificationParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:327
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
TextContent
TextContent =
Infer<typeofTextContentSchema>
Defined in: packages/core-internal/src/types/types.ts:391
TextResourceContents
TextResourceContents =
Infer<typeofTextResourceContentsSchema>
Defined in: packages/core-internal/src/types/types.ts:354
TitledMultiSelectEnumSchema
TitledMultiSelectEnumSchema =
Infer<typeofTitledMultiSelectEnumSchemaSchema>
Defined in: packages/core-internal/src/types/types.ts:528
TitledSingleSelectEnumSchema
TitledSingleSelectEnumSchema =
Infer<typeofTitledSingleSelectEnumSchemaSchema>
Defined in: packages/core-internal/src/types/types.ts:525
Tool
Tool =
Infer<typeofToolSchema>
Defined in: packages/core-internal/src/types/types.ts:416
ToolAnnotations
ToolAnnotations =
Infer<typeofToolAnnotationsSchema>
Defined in: packages/core-internal/src/types/types.ts:414
ToolChoice
ToolChoice =
Infer<typeofToolChoiceSchema>
Defined in: packages/core-internal/src/types/types.ts:463
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
ToolExecution
ToolExecution =
Infer<typeofToolExecutionSchema>
Defined in: packages/core-internal/src/types/types.ts:415
ToolListChangedNotification
ToolListChangedNotification =
Infer<typeofToolListChangedNotificationSchema>
Defined in: packages/core-internal/src/types/types.ts:423
ToolResultContent
ToolResultContent =
Infer<typeofToolResultContentSchema>
Defined in: packages/core-internal/src/types/types.ts:405
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
ToolUseContent
ToolUseContent =
Infer<typeofToolUseContentSchema>
Defined in: packages/core-internal/src/types/types.ts:399
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months. Migrate to calling LLM provider APIs directly.
TransportSendOptions
TransportSendOptions =
object
Defined in: packages/core-internal/src/shared/transport.ts:51
Options for sending a JSON-RPC message.
Properties
headers?
optionalheaders?:Readonly<Record<string,string>>
Defined in: packages/core-internal/src/shared/transport.ts:102
Additional HTTP headers to send with THIS outbound message, when the transport sends one outbound message per underlying HTTP request (the Streamable HTTP transport's POST-per-request model). Transports that share a single channel (stdio, in-memory) ignore it.
The Client uses this to attach SEP-2243 Mcp-Param-{Name} headers to a tools/call request on a 2026-07-28 connection. Values are sent verbatim — encode anything that is not a safe RFC 9110 field value before passing it here.
onRequestStreamEnd?
optionalonRequestStreamEnd?: () =>void
Defined in: packages/core-internal/src/shared/transport.ts:89
Fired by transports that open a per-request stream (the Streamable HTTP transport's POST-per-request SSE response) when that stream ends or errors for any reason OTHER than a deliberate requestSignal abort — i.e. the server closed the stream, the network dropped it, or reconnection was exhausted. Transports that share a single channel (stdio, in-memory) ignore it.
Returns
void
onresumptiontoken?
optionalonresumptiontoken?: (token) =>void
Defined in: packages/core-internal/src/shared/transport.ts:69
A callback that is invoked when the resumption token changes, if supported by the transport.
This allows clients to persist the latest token for potential reconnection.
Parameters
token
string
Returns
void
relatedRequestId?
optionalrelatedRequestId?:RequestId
Defined in: packages/core-internal/src/shared/transport.ts:55
If present, relatedRequestId is used to indicate to the transport which incoming request to associate this outgoing message with.
requestSignal?
optionalrequestSignal?:AbortSignal
Defined in: packages/core-internal/src/shared/transport.ts:79
An abort signal for THIS outbound message's underlying request, when the transport sends one outbound message per underlying request (the Streamable HTTP transport's POST-per-request model). Aborting it cancels the underlying request (and its SSE response stream) without closing the transport. Transports that share a single channel (stdio, in-memory) ignore it.
resumptionToken?
optionalresumptionToken?:string
Defined in: packages/core-internal/src/shared/transport.ts:62
The resumption token used to continue long-running requests that were interrupted.
This allows clients to reconnect and continue from where they left off, if supported by the transport.
UnsubscribeRequest
UnsubscribeRequest =
Infer<typeofUnsubscribeRequestSchema>
Defined in: packages/core-internal/src/types/types.ts:371
UnsubscribeRequestParams
UnsubscribeRequestParams =
Infer<typeofUnsubscribeRequestParamsSchema>
Defined in: packages/core-internal/src/types/types.ts:370
UntitledMultiSelectEnumSchema
UntitledMultiSelectEnumSchema =
Infer<typeofUntitledMultiSelectEnumSchemaSchema>
Defined in: packages/core-internal/src/types/types.ts:527
UntitledSingleSelectEnumSchema
UntitledSingleSelectEnumSchema =
Infer<typeofUntitledSingleSelectEnumSchemaSchema>
Defined in: packages/core-internal/src/types/types.ts:524
Variables
Variables =
Record<string,string|string[]>
Defined in: packages/core-internal/src/shared/uriTemplate.ts:3
Variables
BAGGAGE_META_KEY
constBAGGAGE_META_KEY:"baggage"='baggage'
Defined in: packages/core-internal/src/types/constants.ts:94
_meta key carrying cross-cutting propagation values for distributed tracing (SEP-414).
When present, the value MUST follow the W3C Baggage header format, e.g. userId=alice,serverRegion=us-east-1.
See
https://www.w3.org/TR/baggage/
CLIENT_CAPABILITIES_META_KEY
constCLIENT_CAPABILITIES_META_KEY:"io.modelcontextprotocol/clientCapabilities"='io.modelcontextprotocol/clientCapabilities'
Defined in: packages/core-internal/src/types/constants.ts:32
_meta key carrying the client's capabilities for a request.
Capabilities are declared per request rather than once at initialization; servers must not infer capabilities from prior requests.
CLIENT_INFO_META_KEY
constCLIENT_INFO_META_KEY:"io.modelcontextprotocol/clientInfo"='io.modelcontextprotocol/clientInfo'
Defined in: packages/core-internal/src/types/constants.ts:24
_meta key identifying the client software making a request.
DEFAULT_NEGOTIATED_PROTOCOL_VERSION
constDEFAULT_NEGOTIATED_PROTOCOL_VERSION:"2025-03-26"='2025-03-26'
Defined in: packages/core-internal/src/types/constants.ts:2
DEFAULT_REQUEST_TIMEOUT_MSEC
constDEFAULT_REQUEST_TIMEOUT_MSEC:60000=60_000
Defined in: packages/core-internal/src/shared/protocol.ts:95
The default request timeout, in milliseconds.
INTERNAL_ERROR
constINTERNAL_ERROR:-32603=-32_603
Defined in: packages/core-internal/src/types/constants.ts:104
INVALID_PARAMS
constINVALID_PARAMS:-32602=-32_602
Defined in: packages/core-internal/src/types/constants.ts:103
INVALID_REQUEST
constINVALID_REQUEST:-32600=-32_600
Defined in: packages/core-internal/src/types/constants.ts:101
isSpecType
constisSpecType:GuardRecord
Defined in: packages/core-internal/src/types/specTypeSchema.ts:312
Type predicates for every MCP spec type, keyed by type name.
Returns true if the value satisfies the schema's input type (z.input<>, before defaults and transforms are applied), and narrows to that input type. For schemas with .default() or .preprocess(), this may accept values that do not structurally match the named output type; for example isSpecType.CallToolResult({}) is true because content has a default. Use specTypeSchemas.X['~standard'].validate(value) when you need the validated output value.
Each guard is a standalone function, so it can be passed directly as a callback.
Example
if (isSpecType.ContentBlock(value)) {
// value is ContentBlock
}
const blocks = mixed.filter(isSpecType.ContentBlock);JSONRPC_VERSION
constJSONRPC_VERSION:"2.0"='2.0'
Defined in: packages/core-internal/src/types/constants.ts:97
LATEST_PROTOCOL_VERSION
constLATEST_PROTOCOL_VERSION:"2025-11-25"='2025-11-25'
Defined in: packages/core-internal/src/types/constants.ts:1
LOG_LEVEL_META_KEY
constLOG_LEVEL_META_KEY:"io.modelcontextprotocol/logLevel"='io.modelcontextprotocol/logLevel'
Defined in: packages/core-internal/src/types/constants.ts:56
_meta key carrying the desired log level for a request.
When absent, the server must not send notifications/message notifications for the request.
Deprecated
Deprecated as of protocol version 2026-07-28 (SEP-2577); remains in the specification for at least twelve months.
METHOD_NOT_FOUND
constMETHOD_NOT_FOUND:-32601=-32_601
Defined in: packages/core-internal/src/types/constants.ts:102
PARSE_ERROR
constPARSE_ERROR:-32700=-32_700
Defined in: packages/core-internal/src/types/constants.ts:100
PROTOCOL_VERSION_META_KEY
constPROTOCOL_VERSION_META_KEY:"io.modelcontextprotocol/protocolVersion"='io.modelcontextprotocol/protocolVersion'
Defined in: packages/core-internal/src/types/constants.ts:19
_meta key carrying the MCP protocol version governing a request.
For the HTTP transport, the value must match the MCP-Protocol-Version header.
RELATED_TASK_META_KEY
constRELATED_TASK_META_KEY:"io.modelcontextprotocol/related-task"='io.modelcontextprotocol/related-task'
Defined in: packages/core-internal/src/types/constants.ts:10
_meta key associating a message with a 2025-11-25 task.
Deprecated
2025-11-25 wire vocabulary with no SDK runtime; kept importable for interoperability only.
specTypeSchemas
constspecTypeSchemas:SchemaRecord
Defined in: packages/core-internal/src/types/specTypeSchema.ts:290
Runtime validators for every MCP spec type, keyed by type name.
Use this when you need to validate a spec-defined shape at a boundary the SDK does not own, for example an extension's custom-method payload that embeds a CallToolResult, or a value read from storage that should be a Tool.
Each entry implements the Standard Schema interface, so it composes with any Standard-Schema-aware library. For a simple boolean check, use isSpecType instead.
Example
const result = specTypeSchemas.CallToolResult['~standard'].validate(untrusted);
if (result.issues === undefined) {
// result.value is CallToolResult
}STDIO_DEFAULT_MAX_BUFFER_SIZE
constSTDIO_DEFAULT_MAX_BUFFER_SIZE:number
Defined in: packages/core-internal/src/shared/stdio.ts:4
SUBSCRIPTION_ID_META_KEY
constSUBSCRIPTION_ID_META_KEY:"io.modelcontextprotocol/subscriptionId"='io.modelcontextprotocol/subscriptionId'
Defined in: packages/core-internal/src/types/constants.ts:45
_meta key carrying the JSON-RPC ID of the subscriptions/listen request that opened the stream a notification was delivered on.
Stamped by the server on every notification delivered via a subscriptions/listen stream (including the leading notifications/subscriptions/acknowledged); on stdio, where all messages share one channel, clients use it to correlate notifications with their originating subscription. The value is the listen request's JSON-RPC ID verbatim.
SUPPORTED_PROTOCOL_VERSIONS
constSUPPORTED_PROTOCOL_VERSIONS:string[]
Defined in: packages/core-internal/src/types/constants.ts:3
TRACEPARENT_META_KEY
constTRACEPARENT_META_KEY:"traceparent"='traceparent'
Defined in: packages/core-internal/src/types/constants.ts:74
_meta key carrying W3C Trace Context for distributed tracing (SEP-414).
When present, the value MUST follow the W3C traceparent header format, e.g. 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01.
See
https://www.w3.org/TR/trace-context/#traceparent-header
TRACESTATE_META_KEY
constTRACESTATE_META_KEY:"tracestate"='tracestate'
Defined in: packages/core-internal/src/types/constants.ts:84
_meta key carrying vendor-specific trace state for distributed tracing (SEP-414).
When present, the value MUST follow the W3C tracestate header format, e.g. vendor1=value1,vendor2=value2.
See
https://www.w3.org/TR/trace-context/#tracestate-header
Functions
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: packages/core-internal/src/types/guards.ts:126
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: { type: "ref/resource"; uri: string; } | { name: string; type: "ref/prompt"; }; } = CompleteRequestParamsSchema
params._meta?
{[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; } = ...
See General fields: _meta for notes on _meta usage.
params._meta.io.modelcontextprotocol/related-task?
{ taskId: string; } = ...
If specified, this request is related to the provided task.
params._meta.io.modelcontextprotocol/related-task.taskId
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
{ type: "ref/resource"; uri: string; } | { name: string; type: "ref/prompt"; } = ...
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: packages/core-internal/src/types/guards.ts:133
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: { type: "ref/resource"; uri: string; } | { name: string; type: "ref/prompt"; }; } = CompleteRequestParamsSchema
params._meta?
{[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; } = ...
See General fields: _meta for notes on _meta usage.
params._meta.io.modelcontextprotocol/related-task?
{ taskId: string; } = ...
If specified, this request is related to the provided task.
params._meta.io.modelcontextprotocol/related-task.taskId
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
{ type: "ref/resource"; uri: string; } | { name: string; type: "ref/prompt"; } = ...
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 } } }
checkResourceAllowed()
checkResourceAllowed(
options):boolean
Defined in: packages/core-internal/src/shared/authUtils.ts:27
Checks if a requested resource URL matches a configured resource URL. A requested resource matches if it has the same scheme, domain, port, and its path starts with the configured resource's path.
Parameters
options
The options object
configuredResource
string | URL
The resource URL that has been configured
requestedResource
string | URL
The resource URL being requested
Returns
boolean
true if the requested resource matches the configured resource, false otherwise
createFetchWithInit()
createFetchWithInit(
baseFetch?,baseInit?):FetchLike
Defined in: packages/core-internal/src/shared/transport.ts:31
Creates a fetch function that includes base RequestInit options. This ensures requests inherit settings like credentials, mode, headers, etc. from the base init.
Parameters
baseFetch?
FetchLike = fetch
The base fetch function to wrap (defaults to global fetch)
baseInit?
RequestInit
The base RequestInit to merge with each request
Returns
A wrapped fetch function that merges base options with call-specific options
deserializeMessage()
deserializeMessage(
line):JSONRPCMessage
Defined in: packages/core-internal/src/shared/stdio.ts:56
Parameters
line
string
Returns
getDisplayName()
getDisplayName(
metadata):string
Defined in: packages/core-internal/src/shared/metadataUtils.ts:13
Gets the display name for an object with BaseMetadata. For tools, the precedence is: title → annotations.title → name For other objects: title → name This implements the spec requirement: "if no title is provided, name should be used for display purposes"
Parameters
metadata
{ name: string; title?: string; } | object & object
Type Literal
{ name: string; title?: string; }
name
string = ...
Intended for programmatic or logical use, but used as a display name in past specs or fallback
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).
object & object
Returns
string
isCallToolResult()
isCallToolResult(
value): value is { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; 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 }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number }; resource: { _meta?: { [key: string]: unknown }; mimeType?: string; text: string; uri: string } | { _meta?: { [key: string]: unknown }; blob: string; mimeType?: string; uri: string }; type: "resource" } | { _meta?: { [key: string]: unknown }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number }; description?: string; icons?: { mimeType?: string; sizes?: string[]; src: string; theme?: "light" | "dark" }[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string })[]; isError?: boolean; structuredContent?: unknown; [key: string]: unknown }
Defined in: packages/core-internal/src/types/guards.ts:86
Checks if a value is a valid CallToolResult.
This is a consumer-side VALUE check against the neutral model, not a wire validator: a raw wire object that additionally carries wire-only members (e.g. resultType) still passes through the loose index signature. Use a transport-level parse to validate raw wire traffic.
Parameters
value
unknown
The value to check.
Returns
value is { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown }; 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 }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number }; resource: { _meta?: { [key: string]: unknown }; mimeType?: string; text: string; uri: string } | { _meta?: { [key: string]: unknown }; blob: string; mimeType?: string; uri: string }; type: "resource" } | { _meta?: { [key: string]: unknown }; annotations?: { audience?: ("user" | "assistant")[]; lastModified?: string; priority?: number }; description?: string; icons?: { mimeType?: string; sizes?: string[]; src: string; theme?: "light" | "dark" }[]; mimeType?: string; name: string; size?: number; title?: string; type: "resource_link"; uri: string })[]; isError?: boolean; structuredContent?: unknown; [key: string]: unknown }
True if the value is a valid CallToolResult, false otherwise.
isInitializedNotification()
isInitializedNotification(
value): value is { method: "notifications/initialized"; params?: { _meta?: { io.modelcontextprotocol/related-task?: { taskId: string }; progressToken?: string | number; [key: string]: unknown } } }
Defined in: packages/core-internal/src/types/guards.ts:123
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]: string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null } | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null }; url?: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null }; [key: string]: string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null } | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null }; experimental?: { [key: string]: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null } }; extensions?: { [key: string]: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null } }; roots?: { listChanged?: boolean }; sampling?: { context?: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null }; tools?: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null } }; tasks?: { cancel?: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null }; list?: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null }; requests?: { elicitation?: { create?: { [key: ...]: ... }; [key: string]: unknown }; sampling?: { createMessage?: { [key: ...]: ... }; [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: packages/core-internal/src/types/guards.ts:121
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]: string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null } | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null }; url?: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null }; [key: string]: string | number | boolean | { [key: string]: string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null } | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null }; experimental?: { [key: string]: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null } }; extensions?: { [key: string]: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null } }; roots?: { listChanged?: boolean }; sampling?: { context?: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null }; tools?: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null } }; tasks?: { cancel?: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null }; list?: { [key: string]: string | number | boolean | ({ [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null)[] | null; }) | (string | number | boolean | { [x: string]: string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | number | boolean | ... | (string | ... 4 more ... | null)[] | null)[] | null)[] | null)[] | null; } | (string | ... 4 more ... | null)[] | null)[] | null }; requests?: { elicitation?: { create?: { [key: ...]: ... }; [key: string]: unknown }; sampling?: { createMessage?: { [key: ...]: ... }; [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 } }
isInputRequiredResult()
isInputRequiredResult(
value):value is InputRequiredResult
Defined in: packages/core-internal/src/types/guards.ts:103
Checks whether a value is an input-required result (protocol revision 2026-07-28): the multi-round-trip return shape discriminated by resultType: 'input_required'.
This is a discriminator check, not a full validator — the at-least-one rule (inputRequests or requestState) is enforced by the inputRequired() builder and re-checked by the server seam for hand-built values.
Parameters
value
unknown
The value to check.
Returns
value is InputRequiredResult
True if the value carries the input_required discriminator.
isJSONRPCErrorResponse()
isJSONRPCErrorResponse(
value): value is { error: { code: number; data?: unknown; message: string }; id?: string | number; jsonrpc: "2.0" }
Defined in: packages/core-internal/src/types/guards.ts:63
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: packages/core-internal/src/types/guards.ts:46
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: packages/core-internal/src/types/guards.ts:44
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 } }
isJSONRPCResponse()
isJSONRPCResponse(
value):value is JSONRPCResponse
Defined in: packages/core-internal/src/types/guards.ts:72
Checks if a value is a valid JSONRPCResponse (either a result or error response).
Parameters
value
unknown
The value to check.
Returns
value is JSONRPCResponse
True if the value is a valid JSONRPCResponse, false otherwise.
isJSONRPCResultResponse()
isJSONRPCResultResponse(
value):value is JSONRPCResultResponse
Defined in: packages/core-internal/src/types/guards.ts:54
Checks if a value is a valid JSONRPCResultResponse.
Parameters
value
unknown
The value to check.
Returns
value is JSONRPCResultResponse
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: packages/core-internal/src/types/guards.ts:118
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.
Deprecated
Recognizes 2025-11-25 task wire vocabulary, which has no SDK runtime; kept importable for interoperability only.
parseJSONRPCMessage()
parseJSONRPCMessage(
value):JSONRPCMessage
Defined in: packages/core-internal/src/types/guards.ts:40
Validates and parses an unknown value as a JSON-RPC message.
Use this to validate incoming messages in custom transport implementations. Throws if the value does not conform to the JSON-RPC message schema.
Parameters
value
unknown
The value to validate (typically a parsed JSON object).
Returns
The validated JSONRPCMessage.
Throws
If validation fails.
resourceUrlFromServerUrl()
resourceUrlFromServerUrl(
url):URL
Defined in: packages/core-internal/src/shared/authUtils.ts:11
Converts a server URL to a resource URL by removing the fragment. RFC 8707 section 2 states that resource URIs "MUST NOT include a fragment component". Keeps everything else unchanged (scheme, domain, port, path, query).
Parameters
url
string | URL
Returns
URL
serializeMessage()
serializeMessage(
message):string
Defined in: packages/core-internal/src/shared/stdio.ts:60
Parameters
message
Returns
string
withInputRequired()
withInputRequired<
S>(schema):StandardSchemaV1<unknown,InputRequiredResult|InferOutput<S>>
Defined in: packages/core-internal/src/shared/inputRequired.ts:245
Wraps a result schema so a request issued through client.request() / ctx.mcpReq.send() with allowInputRequired: true is typed as either the schema's result or an InputRequiredResult.
The manual multi-round-trip path: pass { allowInputRequired: true } in the request options so an input_required response is handed back to the caller instead of being auto-fulfilled (or rejected), and wrap the result schema with withInputRequired() so the returned value is typed and validated correctly for both outcomes — input_required values pass through as-is, complete results validate against the wrapped schema.
Type Parameters
S
S extends StandardSchemaV1<unknown, unknown>
Parameters
schema
S
Returns
StandardSchemaV1<unknown, InputRequiredResult | InferOutput<S>>
References
AddClientAuthentication
Re-exports AddClientAuthentication
applyMiddlewares
Re-exports applyMiddlewares
AssertionCallback
Re-exports AssertionCallback
assertSecureTokenEndpoint
Re-exports assertSecureTokenEndpoint
auth
Re-exports auth
AuthOptions
Re-exports AuthOptions
AuthorizationServerMismatchError
Re-exports AuthorizationServerMismatchError
AuthProvider
Re-exports AuthProvider
AuthResult
Re-exports AuthResult
buildDiscoveryUrls
Re-exports buildDiscoveryUrls
CacheableRequestOptions
Re-exports CacheableRequestOptions
CacheEntry
Re-exports CacheEntry
CacheKey
Re-exports CacheKey
CacheMode
Re-exports CacheMode
CacheScope
Re-exports CacheScope
CallToolRequestOptions
Re-exports CallToolRequestOptions
Client
Re-exports Client
ClientAuthMethod
Re-exports ClientAuthMethod
ClientCredentialsProvider
Re-exports ClientCredentialsProvider
ClientCredentialsProviderOptions
Re-exports ClientCredentialsProviderOptions
ClientOptions
Re-exports ClientOptions
computeScopeUnion
Re-exports computeScopeUnion
ConnectOptions
Re-exports ConnectOptions
createMiddleware
Re-exports createMiddleware
createPrivateKeyJwtAuth
Re-exports createPrivateKeyJwtAuth
CrossAppAccessContext
Re-exports CrossAppAccessContext
CrossAppAccessProvider
Re-exports CrossAppAccessProvider
CrossAppAccessProviderOptions
Re-exports CrossAppAccessProviderOptions
discoverAndRequestJwtAuthGrant
Re-exports discoverAndRequestJwtAuthGrant
DiscoverAndRequestJwtAuthGrantOptions
Re-exports DiscoverAndRequestJwtAuthGrantOptions
discoverAuthorizationServerMetadata
Re-exports discoverAuthorizationServerMetadata
discoverOAuthMetadata
Re-exports discoverOAuthMetadata
discoverOAuthProtectedResourceMetadata
Re-exports discoverOAuthProtectedResourceMetadata
discoverOAuthServerInfo
Re-exports discoverOAuthServerInfo
exchangeAuthorization
Re-exports exchangeAuthorization
exchangeJwtAuthGrant
Re-exports exchangeJwtAuthGrant
extractResourceMetadataUrl
Re-exports extractResourceMetadataUrl
extractWWWAuthenticateParams
Re-exports extractWWWAuthenticateParams
fetchToken
Re-exports fetchToken
fromJsonSchema
Re-exports fromJsonSchema
getSupportedElicitationModes
Re-exports getSupportedElicitationModes
InMemoryResponseCacheStore
Re-exports InMemoryResponseCacheStore
InMemoryResponseCacheStoreOptions
Re-exports InMemoryResponseCacheStoreOptions
InsecureTokenEndpointError
Re-exports InsecureTokenEndpointError
InsufficientScopeError
Re-exports InsufficientScopeError
isHttpsUrl
Re-exports isHttpsUrl
isStrictScopeSuperset
Re-exports isStrictScopeSuperset
IssuerMismatchError
Re-exports IssuerMismatchError
JwtAuthGrantResult
Re-exports JwtAuthGrantResult
LoggingOptions
Re-exports LoggingOptions
MAX_CACHE_TTL_MS
Re-exports MAX_CACHE_TTL_MS
MaybePromise
Re-exports MaybePromise
McpSubscription
Re-exports McpSubscription
Middleware
Re-exports Middleware
OAuthClientFlowError
Re-exports OAuthClientFlowError
OAuthClientInformationContext
Re-exports OAuthClientInformationContext
OAuthClientProvider
Re-exports OAuthClientProvider
OAuthDiscoveryState
Re-exports OAuthDiscoveryState
OAuthServerInfo
Re-exports OAuthServerInfo
parseErrorResponse
Re-exports parseErrorResponse
prepareAuthorizationCodeRequest
Re-exports prepareAuthorizationCodeRequest
PrivateKeyJwtProvider
Re-exports PrivateKeyJwtProvider
PrivateKeyJwtProviderOptions
Re-exports PrivateKeyJwtProviderOptions
ReconnectionScheduler
Re-exports ReconnectionScheduler
refreshAuthorization
Re-exports refreshAuthorization
registerClient
Re-exports registerClient
RegistrationRejectedError
Re-exports RegistrationRejectedError
RequestJwtAuthGrantOptions
Re-exports RequestJwtAuthGrantOptions
requestJwtAuthorizationGrant
Re-exports requestJwtAuthorizationGrant
RequestLogger
Re-exports RequestLogger
resolveClientMetadata
Re-exports resolveClientMetadata
ResponseCacheStore
Re-exports ResponseCacheStore
selectClientAuthMethod
Re-exports selectClientAuthMethod
selectResourceURL
Re-exports selectResourceURL
SSEClientTransport
Re-exports SSEClientTransport
SSEClientTransportOptions
Re-exports SSEClientTransportOptions
SseError
Re-exports SseError
startAuthorization
Re-exports startAuthorization
StartSSEOptions
Re-exports StartSSEOptions
StaticPrivateKeyJwtProvider
Re-exports StaticPrivateKeyJwtProvider
StaticPrivateKeyJwtProviderOptions
Re-exports StaticPrivateKeyJwtProviderOptions
StreamableHTTPClientTransport
Re-exports StreamableHTTPClientTransport
StreamableHTTPClientTransportOptions
Re-exports StreamableHTTPClientTransportOptions
StreamableHTTPReconnectionOptions
Re-exports StreamableHTTPReconnectionOptions
UnauthorizedError
Re-exports UnauthorizedError
validateAuthorizationResponseIssuer
Re-exports validateAuthorizationResponseIssuer
validateClientMetadataUrl
Re-exports validateClientMetadataUrl
VersionNegotiationMode
Re-exports VersionNegotiationMode
VersionNegotiationOptions
Re-exports VersionNegotiationOptions
VersionNegotiationProbeOptions
Re-exports VersionNegotiationProbeOptions
withLogging
Re-exports withLogging
withOAuth
Re-exports withOAuth