MCP TypeScript SDK (V2) / @modelcontextprotocol/server / server/legacyInputRequiredShim
server/legacyInputRequiredShim
Classes
LegacyInputRequiredShim
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:160
The fulfilment loop — see the module doc for the contract.
Constructors
Constructor
new LegacyInputRequiredShim(
_host):LegacyInputRequiredShim
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:161
Parameters
_host
Returns
Methods
fulfill()
fulfill(
method,handler,request,ctx,firstResult):Promise<{[key:string]:unknown;_meta?: {[key:string]:unknown;io.modelcontextprotocol/related-task?: {taskId:string; };progressToken?:string|number; }; }>
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:163
Parameters
method
string
handler
(request, ctx) => Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; }>
request
id
string | number = RequestIdSchema
jsonrpc
"2.0" = ...
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.
ctx
firstResult
_meta?
{[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; } = ...
See MCP specification for notes on _meta usage.
_meta.io.modelcontextprotocol/related-task?
{ taskId: string; } = ...
If specified, this request is related to the provided task.
_meta.io.modelcontextprotocol/related-task.taskId
string = ...
_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.
Returns
Promise<{[key: string]: unknown; _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; }>
Interfaces
CoercedEmbeddedInputRequest
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:81
A coerced inputRequests entry: the kind-narrowed embedded request.
Properties
method
method:
EmbeddedInputRequestMethod
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:82
params?
optionalparams?:Record<string,unknown>
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:83
LegacyInputRequiredShimHost
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:149
Everything the shim needs from Server: the knobs, the per-request resolved capability view (initialize state on sessionful legacy; empty on per-request stateless instances), the requestState verify runner (deny-on-error → the frozen -32602), and the 2025-era senders. The shim's own gate is authoritative; elicitation accepted content passes through UNVALIDATED for parity with the modern client driver.
Properties
maxRounds
readonlymaxRounds:number
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:150
roundTimeoutMs
readonlyroundTimeoutMs:number
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:151
Methods
listRoots()
listRoots(
params,options):Promise<unknown>
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:156
Parameters
params
Record<string, unknown> | undefined
options
Returns
Promise<unknown>
resolvedClientCapabilities()
resolvedClientCapabilities(
ctx): {elicitation?: {[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;form?: {[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;applyDefaults?:boolean; };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; }; };experimental?: {[key:string]:object; };extensions?: {[key:string]:object; };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?: {[key:string]:unknown;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?: {[key:string]:unknown;elicitation?: {[key:string]:unknown;create?: {[key:string]: ... | ... | ... | ... | ... | ... | ...; }; };sampling?: {[key:string]:unknown;createMessage?: {[key:string]: ... | ... | ... | ... | ... | ... | ...; }; }; }; }; } |undefined
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:152
Parameters
ctx
Returns
Type Literal
{ elicitation?: {[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; form?: {[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; applyDefaults?: boolean; }; 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; }; }; experimental?: {[key: string]: object; }; extensions?: {[key: string]: object; }; 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?: {[key: string]: unknown; 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?: {[key: string]: unknown; elicitation?: {[key: string]: unknown; create?: {[key: string]: ... | ... | ... | ... | ... | ... | ...; }; }; sampling?: {[key: string]: unknown; createMessage?: {[key: string]: ... | ... | ... | ... | ... | ... | ...; }; }; }; }; }
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]: ... | ... | ... | ... | ... | ... | ...
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]: ... | ... | ... | ... | ... | ... | ...
undefined
sendElicitation()
sendElicitation(
params,options):Promise<unknown>
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:154
Parameters
params
{ _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; message: string; mode?: "form"; requestedSchema: {[key: string]: unknown; properties: {[key: string]: { default?: boolean; description?: string; title?: string; type: "boolean"; } | { default?: string; description?: string; format?: "date" | "uri" | "email" | "date-time"; maxLength?: number; minLength?: number; title?: string; type: "string"; } | { default?: number; description?: string; maximum?: number; minimum?: number; title?: string; type: "number" | "integer"; } | { default?: string; description?: string; enum: string[]; enumNames?: string[]; title?: string; type: "string"; } | { default?: string; description?: string; enum: string[]; title?: string; type: "string"; } | { default?: string; description?: string; oneOf: object[]; title?: string; type: "string"; } | { default?: string[]; description?: string; items: { enum: string[]; type: "string"; }; maxItems?: number; minItems?: number; title?: string; type: "array"; } | { default?: string[]; description?: string; items: { anyOf: object[]; }; maxItems?: number; minItems?: number; title?: string; type: "array"; }; }; required?: string[]; type: "object"; }; task?: { ttl?: number; }; } | { _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; elicitationId: string; message: string; mode: "url"; task?: { ttl?: number; }; url: string; }
Type Literal
{ _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; message: string; mode?: "form"; requestedSchema: {[key: string]: unknown; properties: {[key: string]: { default?: boolean; description?: string; title?: string; type: "boolean"; } | { default?: string; description?: string; format?: "date" | "uri" | "email" | "date-time"; maxLength?: number; minLength?: number; title?: string; type: "string"; } | { default?: number; description?: string; maximum?: number; minimum?: number; title?: string; type: "number" | "integer"; } | { default?: string; description?: string; enum: string[]; enumNames?: string[]; title?: string; type: "string"; } | { default?: string; description?: string; enum: string[]; title?: string; type: "string"; } | { default?: string; description?: string; oneOf: object[]; title?: string; type: "string"; } | { default?: string[]; description?: string; items: { enum: string[]; type: "string"; }; maxItems?: number; minItems?: number; title?: string; type: "array"; } | { default?: string[]; description?: string; items: { anyOf: object[]; }; maxItems?: number; minItems?: number; title?: string; type: "array"; }; }; required?: string[]; type: "object"; }; task?: { ttl?: number; }; }
_meta?
{[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; } = ...
See General fields: _meta for notes on _meta usage.
_meta.io.modelcontextprotocol/related-task?
{ taskId: string; } = ...
If specified, this request is related to the provided task.
_meta.io.modelcontextprotocol/related-task.taskId
string = ...
_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.
message
string = ...
The message to present to the user describing what information is being requested.
mode?
"form" = ...
The elicitation mode.
Optional for backward compatibility. Clients MUST treat missing mode as "form".
requestedSchema
{[key: string]: unknown; properties: {[key: string]: { default?: boolean; description?: string; title?: string; type: "boolean"; } | { default?: string; description?: string; format?: "date" | "uri" | "email" | "date-time"; maxLength?: number; minLength?: number; title?: string; type: "string"; } | { default?: number; description?: string; maximum?: number; minimum?: number; title?: string; type: "number" | "integer"; } | { default?: string; description?: string; enum: string[]; enumNames?: string[]; title?: string; type: "string"; } | { default?: string; description?: string; enum: string[]; title?: string; type: "string"; } | { default?: string; description?: string; oneOf: object[]; title?: string; type: "string"; } | { default?: string[]; description?: string; items: { enum: string[]; type: "string"; }; maxItems?: number; minItems?: number; title?: string; type: "array"; } | { default?: string[]; description?: string; items: { anyOf: object[]; }; maxItems?: number; minItems?: number; title?: string; type: "array"; }; }; required?: string[]; type: "object"; } = ...
A restricted subset of JSON Schema. Only top-level properties are allowed, without nesting.
requestedSchema.properties
{[key: string]: { default?: boolean; description?: string; title?: string; type: "boolean"; } | { default?: string; description?: string; format?: "date" | "uri" | "email" | "date-time"; maxLength?: number; minLength?: number; title?: string; type: "string"; } | { default?: number; description?: string; maximum?: number; minimum?: number; title?: string; type: "number" | "integer"; } | { default?: string; description?: string; enum: string[]; enumNames?: string[]; title?: string; type: "string"; } | { default?: string; description?: string; enum: string[]; title?: string; type: "string"; } | { default?: string; description?: string; oneOf: object[]; title?: string; type: "string"; } | { default?: string[]; description?: string; items: { enum: string[]; type: "string"; }; maxItems?: number; minItems?: number; title?: string; type: "array"; } | { default?: string[]; description?: string; items: { anyOf: object[]; }; maxItems?: number; minItems?: number; title?: string; type: "array"; }; } = ...
requestedSchema.required?
string[] = ...
requestedSchema.type
"object" = ...
task?
{ ttl?: number; } = ...
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.
task.ttl?
number = ...
Type Literal
{ _meta?: {[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; }; elicitationId: string; message: string; mode: "url"; task?: { ttl?: number; }; url: string; }
_meta?
{[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; } = ...
See General fields: _meta for notes on _meta usage.
_meta.io.modelcontextprotocol/related-task?
{ taskId: string; } = ...
If specified, this request is related to the provided task.
_meta.io.modelcontextprotocol/related-task.taskId
string = ...
_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.
elicitationId
string = ...
The ID of the elicitation, which must be unique within the context of the server. The client MUST treat this ID as an opaque value.
Deprecated
Removed from the spec by #2891 (2026-07-28). The client learns the outcome of an out-of-band interaction by retrying the original request; no server-initiated completion signal exists in the 2026-07-28 revision. Kept here for the 2025-era URL-mode flow only.
message
string = ...
The message to present to the user explaining why the interaction is needed.
mode
"url" = ...
The elicitation mode.
task?
{ ttl?: number; } = ...
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.
task.ttl?
number = ...
url
string = ...
The URL that the user should navigate to.
options
Returns
Promise<unknown>
sendSampling()
sendSampling(
params,options):Promise<unknown>
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:155
Parameters
params
_meta?
{[key: string]: unknown; io.modelcontextprotocol/related-task?: { taskId: string; }; progressToken?: string | number; } = ...
See General fields: _meta for notes on _meta usage.
_meta.io.modelcontextprotocol/related-task?
{ taskId: string; } = ...
If specified, this request is related to the provided task.
_meta.io.modelcontextprotocol/related-task.taskId
string = ...
_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.
includeContext?
"none" | "thisServer" | "allServers" = ...
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".
maxTokens
number = ...
The requested maximum number of tokens to sample (to prevent runaway completions).
The client MAY choose to sample fewer tokens than the requested maximum.
messages
object[] = ...
metadata?
{[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; } = ...
Optional metadata to pass through to the LLM provider. The format of this metadata is provider-specific.
modelPreferences?
{ costPriority?: number; hints?: object[]; intelligencePriority?: number; speedPriority?: number; } = ...
The server's preferences for which model to select. The client MAY modify or omit this request.
modelPreferences.costPriority?
number = ...
How much to prioritize cost when selecting a model.
modelPreferences.hints?
object[] = ...
Optional hints to use for model selection.
modelPreferences.intelligencePriority?
number = ...
How much to prioritize intelligence and capabilities when selecting a model.
modelPreferences.speedPriority?
number = ...
How much to prioritize sampling speed (latency) when selecting a model.
stopSequences?
string[] = ...
systemPrompt?
string = ...
An optional system prompt the server wants to use for sampling. The client MAY modify or omit this prompt.
task?
{ ttl?: number; } = ...
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.
task.ttl?
number = ...
temperature?
number = ...
toolChoice?
{ mode?: "required" | "auto" | "none"; } = ...
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" }.
toolChoice.mode?
"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
tools?
object[] = ...
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.
options
Returns
Promise<unknown>
verifyRequestState()
verifyRequestState(
state,ctx,method):Promise<unknown>
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:153
Parameters
state
string
ctx
method
string
Returns
Promise<unknown>
ResolvedLegacyShimOptions
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:54
The ServerOptions.inputRequired bag with defaults applied.
Properties
legacyShim
legacyShim:
boolean
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:57
maxRounds
maxRounds:
number
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:55
roundTimeoutMs
roundTimeoutMs:
number
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:56
Type Aliases
EmbeddedInputRequestMethod
EmbeddedInputRequestMethod =
"elicitation/create"|"sampling/createMessage"|"roots/list"
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:78
The embedded input-request kinds the 2026-07-28 revision defines.
Functions
coerceEmbeddedInputRequest()
coerceEmbeddedInputRequest(
method,key,entry):object
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:91
Validates one inputRequests entry: malformed or unknown kinds are server bugs and fail loudly on both eras. Shared by the modern seam's capability check and the shim's gate.
Parameters
method
string
key
string
entry
unknown
Returns
object
embedded
embedded:
CoercedEmbeddedInputRequest
required
required:
object
required.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
required.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
required.elicitation.form.applyDefaults?
optionalapplyDefaults?:boolean
required.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
required.experimental?
optionalexperimental?:object
Experimental, non-standard capabilities that the client supports.
Index Signature
[key: string]: object
required.extensions?
optionalextensions?:object
Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
Index Signature
[key: string]: object
required.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.
required.roots.listChanged?
optionallistChanged?:boolean
Whether the client supports issuing notifications for changes to the roots list.
required.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.
required.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
required.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
required.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.
required.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
required.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
required.tasks.requests?
optionalrequests?:object
Capabilities for task creation on specific request types.
Index Signature
[key: string]: unknown
required.tasks.requests.elicitation?
optionalelicitation?:object
Task support for elicitation requests.
Index Signature
[key: string]: unknown
required.tasks.requests.elicitation.create?
optionalcreate?:object
Index Signature
[key: string]: ... | ... | ... | ... | ... | ... | ...
required.tasks.requests.sampling?
optionalsampling?:object
Task support for sampling requests.
Index Signature
[key: string]: unknown
required.tasks.requests.sampling.createMessage?
optionalcreateMessage?:object
Index Signature
[key: string]: ... | ... | ... | ... | ... | ... | ...
resolveLegacyShimOptions()
resolveLegacyShimOptions(
options):ResolvedLegacyShimOptions
Defined in: packages/server/src/server/legacyInputRequiredShim.ts:61
Resolves and validates ServerOptions.inputRequired, failing loudly at construction time.
Parameters
options
{ legacyShim?: boolean; maxRounds?: number; roundTimeoutMs?: number; } | undefined