Skip to content
Effect Days 2026 Get your ticket

McpSchema

117 exports Added in v1.0.0 Source

Autocomplete

Complete

Added in v1.0.0 Source

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

Signature

declare class Complete extends any {
constructor();
}

The server's response to a completion/complete request

Signature

declare class CompleteResult extends {
readonly completion: {
readonly hasMore?: boolean;
readonly total?: number;
readonly values: readonly Array<string>;
};
} {
constructor(...args: [props: {
readonly completion: {
readonly hasMore?: boolean;
readonly total?: number;
readonly values: readonly Array<string>;
};
}, options?: MakeOptions]);
static readonly empty: CompleteResult;
}

Identifies a prompt.

Signature

declare class PromptReference extends {} {
constructor(_: never);
}

A reference to a resource or resource template definition.

Signature

declare class ResourceReference extends {} {
constructor(_: never);
}

Cancellation

Signature

declare class CancelledNotification extends any {
constructor();
}

Common

Annotations

Added in v1.0.0 Source

Optional annotations for the client. The client can use annotations to inform how objects are used or displayed

Signature

declare class Annotations extends {} {
constructor(_: never);
}

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

Signature

declare class ClientCapabilities extends {
readonly elicitation?: {};
readonly experimental?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly roots?: {
readonly listChanged?: boolean;
};
readonly sampling?: {};
} {
constructor(...args: [props?: {
readonly elicitation?: {};
readonly experimental?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly roots?: {
readonly listChanged?: boolean;
};
readonly sampling?: {};
}, options?: MakeOptions]);
}

Cursor

Added in v1.0.0 Source

An opaque token used to represent a cursor for pagination.

Signature

declare const Cursor: typeof Schema.String

Cursor type

Added in v1.0.0 Source

Signature

type Cursor = typeof Cursor.Type

Describes the name and version of an MCP implementation.

Signature

declare class Implementation extends {} {
constructor(_: never);
}

Signature

declare class NotificationMeta extends {} {
constructor(_: never);
}

Signature

declare class PaginatedRequestMeta extends {} {
constructor(_: never);
}

Signature

declare class PaginatedResultMeta extends {} {
constructor(_: never);
}

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

Signature

declare const ProgressToken: Schema.Union<[typeof Schema.String, typeof Schema.Number]>

ProgressToken type

Added in v1.0.0 Source

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

Signature

type ProgressToken = typeof ProgressToken.Type

RequestId

Added in v1.0.0 Source

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

Signature

declare const RequestId: Schema.Union<[typeof Schema.String, typeof Schema.Number]>

RequestId type

Added in v1.0.0 Source

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

Signature

type RequestId = typeof RequestId.Type

RequestMeta

Added in v1.0.0 Source

Signature

declare class RequestMeta extends {} {
constructor(_: never);
}

ResultMeta

Added in v1.0.0 Source

Signature

declare class ResultMeta extends {} {
constructor(_: never);
}

Role

Added in v1.0.0 Source

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

Signature

declare const Role: Schema.Literal<["user", "assistant"]>

Role type

Added in v1.0.0 Source

Signature

type Role = typeof Role.Type

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

Signature

declare class ServerCapabilities extends {} {
constructor(_: never);
}

Elicitation

Elicit

Added in v1.0.0 Source

Signature

declare class Elicit extends any {
constructor();
}

The client's response to an elicitation request

Signature

declare class ElicitAcceptResult extends {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly action: "accept";
readonly content: unknown;
} {
constructor(...args: [props: {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly action: "accept";
readonly content: unknown;
}, options?: MakeOptions]);
}

Signature

declare class ElicitationDeclined extends {
[key: string]: any;
} & YieldableError<this> {
[key: string]: any;
constructor(...args: [props?: {
[key: string]: any;
}, options?: MakeOptions]);
}

The client's response to an elicitation request

Signature

declare class ElicitDeclineResult extends {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly action: "cancel";
} {
constructor(...args: [props: {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly action: "cancel";
}, options?: MakeOptions]);
}

ElicitResult

Added in v1.0.0 Source

The client's response to an elicitation request

Signature

declare const ElicitResult: Union<readonly Array<Constraint>>

Errors

Signature

declare const INTERNAL_ERROR_CODE: -32603

Signature

declare class InternalError extends {
readonly _tag: "InternalError";
readonly code: -32603;
readonly data?: unknown;
readonly message: string;
} & YieldableError<this> {
constructor(...args: [props: {
readonly _tag?: "InternalError";
readonly code?: -32603;
readonly data?: unknown;
readonly message: string;
}, options?: MakeOptions]);
static readonly notImplemented: InternalError;
}

Signature

declare const INVALID_PARAMS_ERROR_CODE: -32602

Signature

declare const INVALID_REQUEST_ERROR_CODE: -32600

Signature

declare class InvalidParams extends {
readonly _tag: "InvalidParams";
readonly code: -32602;
readonly data?: unknown;
readonly message: string;
} & YieldableError<this> {
constructor(...args: [props: {
readonly _tag?: "InvalidParams";
readonly code?: -32602;
readonly data?: unknown;
readonly message: string;
}, options?: MakeOptions]);
}

Signature

declare class InvalidRequest extends {
readonly _tag: "InvalidRequest";
readonly code: -32600;
readonly data?: unknown;
readonly message: string;
} & YieldableError<this> {
constructor(...args: [props: {
readonly _tag?: "InvalidRequest";
readonly code?: -32600;
readonly data?: unknown;
readonly message: string;
}, options?: MakeOptions]);
}

McpError

Added in v1.0.0 Source

Signature

declare class McpError extends {
readonly code: number;
readonly data?: unknown;
readonly message: string;
} {
constructor(...args: [props: {
readonly code: number;
readonly data?: unknown;
readonly message: string;
}, options?: MakeOptions]);
}

Signature

declare const METHOD_NOT_FOUND_ERROR_CODE: -32601

Signature

declare class MethodNotFound extends {
readonly _tag: "MethodNotFound";
readonly code: -32601;
readonly data?: unknown;
readonly message: string;
} & YieldableError<this> {
constructor(...args: [props: {
readonly _tag?: "MethodNotFound";
readonly code?: -32601;
readonly data?: unknown;
readonly message: string;
}, options?: MakeOptions]);
}

Signature

declare const PARSE_ERROR_CODE: -32700

ParseError

Added in v1.0.0 Source

Signature

declare class ParseError extends {
readonly _tag: "ParseError";
readonly code: -32700;
readonly data?: unknown;
readonly message: string;
} & YieldableError<this> {
constructor(...args: [props: {
readonly _tag?: "ParseError";
readonly code?: -32700;
readonly data?: unknown;
readonly message: string;
}, options?: MakeOptions]);
}

Initialization

Initialize

Added in v1.0.0 Source

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

Signature

declare class Initialize extends any {
constructor();
}

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

Signature

declare class InitializedNotification extends any {
constructor();
}

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

Signature

declare class InitializeResult extends {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly capabilities: {
readonly completions?: {};
readonly experimental?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly logging?: {};
readonly prompts?: {
readonly listChanged?: boolean;
};
readonly resources?: {
readonly listChanged?: boolean;
readonly subscribe?: boolean;
};
readonly tools?: {
readonly listChanged?: boolean;
};
};
readonly instructions?: string;
readonly protocolVersion: string;
readonly serverInfo: {
readonly name: string;
readonly title?: string;
readonly version: string;
};
} {
constructor(...args: [props: {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly capabilities: {
readonly completions?: {};
readonly experimental?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly logging?: {};
readonly prompts?: {
readonly listChanged?: boolean;
};
readonly resources?: {
readonly listChanged?: boolean;
readonly subscribe?: boolean;
};
readonly tools?: {
readonly listChanged?: boolean;
};
};
readonly instructions?: string;
readonly protocolVersion: string;
readonly serverInfo: {
readonly name: string;
readonly title?: string;
readonly version: string;
};
}, options?: MakeOptions]);
}

Logging

LoggingLevel

Added in v1.0.0 Source

The severity of a log message.

These map to syslog message severities, as specified in RFC-5424: https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1

Signature

declare const LoggingLevel: Schema.Literal<["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"]>

LoggingLevel type

Added in v1.0.0 Source

The severity of a log message.

These map to syslog message severities, as specified in RFC-5424: https://datatracker.ietf.org/doc/html/rfc5424#section-6.2.1

Signature

type LoggingLevel = typeof LoggingLevel.Type

Signature

declare class LoggingMessageNotification extends any {
constructor();
}

SetLevel

Added in v1.0.0 Source

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

Signature

declare class SetLevel extends any {
constructor();
}

McpServerClient

Signature

declare class McpServerClient extends any {
constructor();
}

Signature

declare class McpServerClientMiddleware extends any {
constructor();
}

Parameters

param

Added in v1.0.0 Source

Helper to create a param for a resource URI template.

Signature

declare function param<Id extends string, S extends Any>(id: Id, schema: S): Param<Id, S>

Param interface

Added in v1.0.0 Source

Signature

interface Param<Id extends string, S extends Schema.Schema.Any> extends Schema<S["Type"], S["Encoded"], S["Context"]> {
readonly [ParamAnnotation]: Id;
}

Signature

declare const ParamAnnotation: unique symbol

Ping

Ping

Added in v1.0.0 Source

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

Signature

declare class Ping extends any {
constructor();
}

Progress

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

Signature

declare class ProgressNotification extends any {
constructor();
}

Prompts

AudioContent

Added in v1.0.0 Source

Audio provided to or from an LLM.

Signature

declare class AudioContent extends {} {
constructor(_: never);
}

ContentBlock

Added in v1.0.0 Source

Signature

declare class ContentBlock extends {} {
constructor(_: never);
}

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

It is up to the client how best to render embedded resources for the benefit of the LLM and/or the user.

Signature

declare class EmbeddedResource extends {} {
constructor(_: never);
}

GetPrompt

Added in v1.0.0 Source

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

Signature

declare class GetPrompt extends any {
constructor();
}

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

Signature

declare class GetPromptResult extends {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly description?: string;
readonly messages: readonly Array<{
readonly content: unknown;
readonly role: ["user", "assistant"];
}>;
} {
constructor(...args: [props: {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly description?: string;
readonly messages: readonly Array<{
readonly content: unknown;
readonly role: ["user", "assistant"];
}>;
}, options?: MakeOptions]);
}

ImageContent

Added in v1.0.0 Source

An image provided to or from an LLM.

Signature

declare class ImageContent extends {} {
constructor(_: never);
}

ListPrompts

Added in v1.0.0 Source

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

Signature

declare class ListPrompts extends any {
constructor();
}

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

Signature

declare class ListPromptsResult extends {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly nextCursor?: string;
readonly prompts: readonly Array<Prompt>;
} {
constructor(...args: [props: {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly nextCursor?: string;
readonly prompts: readonly Array<Prompt>;
}, options?: MakeOptions]);
}

Prompt

Added in v1.0.0 Source

A prompt or prompt template that the server offers.

Signature

declare class Prompt extends {
readonly arguments?: readonly Array<{
readonly description?: string;
readonly name: string;
readonly required?: boolean;
readonly title?: string;
}>;
readonly description?: string;
readonly name: string;
readonly title?: string;
} {
constructor(...args: [props: {
readonly arguments?: readonly Array<{
readonly description?: string;
readonly name: string;
readonly required?: boolean;
readonly title?: string;
}>;
readonly description?: string;
readonly name: string;
readonly title?: string;
}, options?: MakeOptions]);
}

Describes an argument that a prompt can accept.

Signature

declare class PromptArgument extends {} {
constructor(_: never);
}

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

Signature

declare class PromptListChangedNotification extends any {
constructor();
}

Describes a message returned as part of a prompt.

This is similar to SamplingMessage, but also supports the embedding of resources from the MCP server.

Signature

declare class PromptMessage extends {} {
constructor(_: never);
}

TextContent

Added in v1.0.0 Source

Text provided to or from an LLM.

Signature

declare class TextContent extends {} {
constructor(_: never);
}

Protocol

ClientFailureEncoded type

Added in v1.0.0 Source

Signature

type ClientFailureEncoded = FailureEncoded<typeof ServerRequestRpcs>

Signature

type ClientNotificationEncoded = NotificationEncoded<typeof ClientNotificationRpcs>

Signature

declare class ClientNotificationRpcs extends any {
constructor();
}

ClientRequestEncoded type

Added in v1.0.0 Source

Signature

type ClientRequestEncoded = RequestEncoded<typeof ClientRequestRpcs>

Signature

declare class ClientRequestRpcs extends any {
constructor();
}

ClientRpcs

Added in v1.0.0 Source

Signature

declare class ClientRpcs extends any {
constructor();
}

ClientSuccessEncoded type

Added in v1.0.0 Source

Signature

type ClientSuccessEncoded = SuccessEncoded<typeof ServerRequestRpcs>

FailureEncoded type

Added in v1.0.0 Source

Signature

type FailureEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> extends infer Rpc ? Rpc extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware> ? {
readonly _tag: "Failure";
readonly error: _Error["Encoded"];
readonly id: string | number;
} : never : never

FromClientEncoded type

Added in v1.0.0 Source

Signature

type FromClientEncoded = ClientRequestEncoded | ClientNotificationEncoded

FromServerEncoded type

Added in v1.0.0 Source

Signature

type FromServerEncoded = ServerResultEncoded | ServerNotificationEncoded

NotificationEncoded type

Added in v1.0.0 Source

Signature

type NotificationEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> extends infer Rpc ? Rpc extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware> ? {
readonly _tag: "Notification";
readonly method: _Tag;
readonly payload: _Payload["Encoded"];
} : never : never

RequestEncoded type

Added in v1.0.0 Source

Signature

type RequestEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> extends infer Rpc ? Rpc extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware> ? {
readonly _tag: "Request";
readonly id: string | number;
readonly method: _Tag;
readonly payload: _Payload["Encoded"];
} : never : never

ServerFailureEncoded type

Added in v1.0.0 Source

Signature

type ServerFailureEncoded = FailureEncoded<typeof ClientRequestRpcs>

Signature

type ServerNotificationEncoded = NotificationEncoded<typeof ServerNotificationRpcs>

Signature

declare class ServerNotificationRpcs extends any {
constructor();
}

ServerRequestEncoded type

Added in v1.0.0 Source

Signature

type ServerRequestEncoded = RequestEncoded<typeof ServerRequestRpcs>

Signature

declare class ServerRequestRpcs extends any {
constructor();
}

ServerResultEncoded type

Added in v1.0.0 Source

Signature

type ServerResultEncoded = ServerSuccessEncoded | ServerFailureEncoded

ServerSuccessEncoded type

Added in v1.0.0 Source

Signature

type ServerSuccessEncoded = SuccessEncoded<typeof ClientRequestRpcs>

SuccessEncoded type

Added in v1.0.0 Source

Signature

type SuccessEncoded<Group extends RpcGroup.Any> = RpcGroup.Rpcs<Group> extends infer Rpc ? Rpc extends Rpc.Rpc<infer _Tag, infer _Payload, infer _Success, infer _Error, infer _Middleware> ? {
readonly _tag: "Success";
readonly id: string | number;
readonly result: _Success["Encoded"];
} : never : never

Resources

The contents of a binary resource, which can be represented as an Uint8Array

Signature

declare class BlobResourceContents extends {} {
constructor(_: never);
}

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

Signature

declare class ListResources extends any {
constructor();
}

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

Signature

declare class ListResourcesResult extends {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly nextCursor?: string;
readonly resources: readonly Array<Resource>;
} {
constructor(...args: [props: {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly nextCursor?: string;
readonly resources: readonly Array<Resource>;
}, options?: MakeOptions]);
}

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

Signature

declare class ListResourceTemplates extends any {
constructor();
}

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

Signature

declare class ListResourceTemplatesResult extends {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly nextCursor?: string;
readonly resourceTemplates: readonly Array<ResourceTemplate>;
} {
constructor(...args: [props: {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly nextCursor?: string;
readonly resourceTemplates: readonly Array<ResourceTemplate>;
}, options?: MakeOptions]);
}

ReadResource

Added in v1.0.0 Source

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

Signature

declare class ReadResource extends any {
constructor();
}

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

Signature

declare class ReadResourceResult extends {} {
constructor(_: never);
}

Resource

Added in v1.0.0 Source

A known resource that the server is capable of reading.

Signature

declare class Resource extends {
readonly annotations?: {
readonly audience?: readonly Array<["user", "assistant"]>;
readonly priority?: undefined;
};
readonly description?: string;
readonly mimeType?: string;
readonly name: string;
readonly size?: number;
readonly title?: string;
readonly uri: string;
} {
constructor(...args: [props: {
readonly annotations?: {
readonly audience?: readonly Array<["user", "assistant"]>;
readonly priority?: undefined;
};
readonly description?: string;
readonly mimeType?: string;
readonly name: string;
readonly size?: number;
readonly title?: string;
readonly uri: string;
}, options?: MakeOptions]);
}

The contents of a specific resource or sub-resource.

Signature

declare class ResourceContents extends {} {
constructor(_: never);
}

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

Signature

declare class ResourceListChangedNotification extends any {
constructor();
}

A template description for resources available on the server.

Signature

declare class ResourceTemplate extends {
readonly annotations?: {
readonly audience?: readonly Array<["user", "assistant"]>;
readonly priority?: undefined;
};
readonly description?: string;
readonly mimeType?: string;
readonly name: string;
readonly title?: string;
readonly uriTemplate: string;
} {
constructor(...args: [props: {
readonly annotations?: {
readonly audience?: readonly Array<["user", "assistant"]>;
readonly priority?: undefined;
};
readonly description?: string;
readonly mimeType?: string;
readonly name: string;
readonly title?: string;
readonly uriTemplate: string;
}, options?: MakeOptions]);
}

Signature

declare class ResourceUpdatedNotification extends any {
constructor();
}

Subscribe

Added in v1.0.0 Source

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

Signature

declare class Subscribe extends any {
constructor();
}

The contents of a text resource, which can be represented as a string.

Signature

declare class TextResourceContents extends {} {
constructor(_: never);
}

Unsubscribe

Added in v1.0.0 Source

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

Signature

declare class Unsubscribe extends any {
constructor();
}

Roots

ListRoots

Added in v1.0.0 Source

Sent from the server to request a list of root URIs from the client. Roots allow servers to ask for specific directories or files to operate on. A common example for roots is providing a set of repositories or directories a server should operate on.

This request is typically used when the server needs to understand the file system structure or access specific locations that the client has permission to read from.

Signature

declare class ListRoots extends any {
constructor();
}

The client's response to a roots/list request from the server. This result contains an array of Root objects, each representing a root directory or file that the server can operate on.

Signature

declare class ListRootsResult extends {
readonly roots: readonly Array<Root>;
} {
constructor(...args: [props: {
readonly roots: readonly Array<Root>;
}, options?: MakeOptions]);
}

Root

Added in v1.0.0 Source

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

Signature

declare class Root extends {
readonly name?: string;
readonly uri: string;
} {
constructor(...args: [props: {
readonly name?: string;
readonly uri: string;
}, options?: MakeOptions]);
}

A notification from the client to the server, informing it that the list of roots has changed. This notification should be sent whenever the client adds, removes, or modifies any root. The server should then request an updated list of roots using the ListRootsRequest.

Signature

declare class RootsListChangedNotification extends any {
constructor();
}

Sampling

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

Signature

declare class CreateMessage extends any {
constructor();
}

The client's response to a sampling/create_message request from the server. The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.

Signature

declare class CreateMessageResult extends {
readonly model: string;
readonly stopReason?: string;
} {
constructor(...args: [props: {
readonly model: string;
readonly stopReason?: string;
}, options?: MakeOptions]);
}

ModelHint

Added in v1.0.0 Source

Hints to use for model selection.

Keys not declared here are currently left unspecified by the spec and are up to the client to interpret.

Signature

declare class ModelHint extends {} {
constructor(_: never);
}

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

Because LLMs can vary along multiple dimensions, choosing the "best" model is rarely straightforward. Different models excel in different areas—some are faster but less capable, others are more capable but more expensive, and so on. This interface allows servers to express their priorities across multiple dimensions to help clients make an appropriate selection for their use case.

These preferences are always advisory. The client MAY ignore them. It is also up to the client to decide how to interpret these preferences and how to balance them against other considerations.

Signature

declare class ModelPreferences extends {
readonly costPriority?: undefined;
readonly hints?: readonly Array<{
readonly name?: string;
}>;
readonly intelligencePriority?: undefined;
readonly speedPriority?: undefined;
} {
constructor(...args: [props?: {
readonly costPriority?: undefined;
readonly hints?: readonly Array<{
readonly name?: string;
}>;
readonly intelligencePriority?: undefined;
readonly speedPriority?: undefined;
}, options?: MakeOptions]);
}

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

Signature

declare class SamplingMessage extends {} {
constructor(_: never);
}

Tools

CallTool

Added in v1.0.0 Source

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

Signature

declare class CallTool extends any {
constructor();
}

The server's response to a tool call.

Any errors that originate from the tool SHOULD be reported inside the result object, with isError set to true, not as an MCP protocol-level error response. Otherwise, the LLM would not be able to see that an error occurred and self-correct.

However, any errors in finding the tool, an error indicating that the server does not support tool calls, or any other exceptional conditions, should be reported as an MCP error response.

Signature

declare class CallToolResult extends {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly content: readonly Array<unknown>;
readonly isError?: boolean;
readonly structuredContent?: unknown;
} {
constructor(...args: [props: {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly content: readonly Array<unknown>;
readonly isError?: boolean;
readonly structuredContent?: unknown;
}, options?: MakeOptions]);
}

ListTools

Added in v1.0.0 Source

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

Signature

declare class ListTools extends any {
constructor();
}

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

Signature

declare class ListToolsResult extends {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly nextCursor?: string;
readonly tools: readonly Array<Tool>;
} {
constructor(...args: [props: {
readonly _meta?: {
[key: string]: unknown;
[key: number]: unknown;
[key: symbol]: unknown;
};
readonly nextCursor?: string;
readonly tools: readonly Array<Tool>;
}, options?: MakeOptions]);
}

Tool

Added in v1.0.0 Source

Definition for a tool the client can call.

Signature

declare class Tool extends {
readonly annotations?: ToolAnnotations;
readonly description?: string;
readonly inputSchema: unknown;
readonly name: string;
readonly title?: string;
} {
constructor(...args: [props: {
readonly annotations?: ToolAnnotations;
readonly description?: string;
readonly inputSchema: unknown;
readonly name: string;
readonly title?: string;
}, options?: MakeOptions]);
}

Additional properties describing a Tool to clients.

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

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

Signature

declare class ToolAnnotations extends {
[key: string]: any;
} {
[key: string]: any;
constructor(...args: [props?: {
[key: string]: any;
}, options?: MakeOptions]);
}

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

Signature

declare class ToolListChangedNotification extends any {
constructor();
}