Schema Reference - Model Context Protocol (original) (raw)
JSON-RPC
JSONRPCErrorResponse
interface JSONRPCErrorResponse {
jsonrpc: “2.0”;
id?: RequestId;
error: Error;
}
JSONRPCMessage
JSONRPCMessage: JSONRPCRequest | JSONRPCNotification | JSONRPCResponse
JSONRPCNotification
interface JSONRPCNotification {
method: string;
params?: { [key: string]: any };
jsonrpc: “2.0”;
}
params?: { [key: string]: any }
JSONRPCRequest
interface JSONRPCRequest {
method: string;
params?: { [key: string]: any };
jsonrpc: “2.0”;
id: RequestId;
}
params?: { [key: string]: any }
JSONRPCResponse
JSONRPCResponse: JSONRPCResultResponse | JSONRPCErrorResponse
JSONRPCResultResponse
interface JSONRPCResultResponse {
jsonrpc: “2.0”;
id: RequestId;
result: Result;
}
Common Types
Annotations
interface Annotations {
audience?: Role[];
priority?: number;
lastModified?: string;
}
EmptyResult
EmptyResult: Result
Error
interface Error {
code: number;
message: string;
data?: unknown;
}
Icon
interface Icon {
src: string;
mimeType?: string;
sizes?: string[];
theme?: “light” | “dark”;
}
LoggingLevel
LoggingLevel:
| “debug”
| “info”
| “notice”
| “warning”
| “error”
| “critical”
| “alert”
| “emergency”
ProgressToken
ProgressToken: string | number
RequestId
RequestId: string | number
Result
interface Result {
_meta?: { [key: string]: unknown };
[key: string]: unknown;
}
Role
Role: “user” | “assistant”
Content
AudioContent
interface AudioContent {
type: “audio”;
data: string;
mimeType: string;
annotations?: Annotations;
_meta?: { [key: string]: unknown };
}
annotations?: Annotations
_meta?: { [key: string]: unknown }
BlobResourceContents
interface BlobResourceContents {
uri: string;
mimeType?: string;
_meta?: { [key: string]: unknown };
blob: string;
}
_meta?: { [key: string]: unknown }
ContentBlock
ContentBlock:
| TextContent
| ImageContent
| AudioContent
| ResourceLink
| EmbeddedResource
EmbeddedResource
interface EmbeddedResource {
type: “resource”;
resource: TextResourceContents | BlobResourceContents;
annotations?: Annotations;
_meta?: { [key: string]: unknown };
}
resource: TextResourceContents | BlobResourceContents
annotations?: Annotations
ImageContent
interface ImageContent {
type: “image”;
data: string;
mimeType: string;
annotations?: Annotations;
_meta?: { [key: string]: unknown };
}
annotations?: Annotations
_meta?: { [key: string]: unknown }
ResourceLink
interface ResourceLink {
icons?: Icon[];
name: string;
title?: string;
uri: string;
description?: string;
mimeType?: string;
annotations?: Annotations;
size?: number;
_meta?: { [key: string]: unknown };
type: “resource_link”;
}
annotations?: Annotations
TextContent
interface TextContent {
type: “text”;
text: string;
annotations?: Annotations;
_meta?: { [key: string]: unknown };
}
annotations?: Annotations
_meta?: { [key: string]: unknown }
TextResourceContents
interface TextResourceContents {
uri: string;
mimeType?: string;
_meta?: { [key: string]: unknown };
text: string;
}
_meta?: { [key: string]: unknown }
completion/complete
CompleteRequest
interface CompleteRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “completion/complete”;
params: CompleteRequestParams;
}
method: “completion/complete”
params: CompleteRequestParams
CompleteRequestParams
interface CompleteRequestParams {
_meta?: { progressToken?: ProgressToken; [key: string]: unknown };
ref: PromptReference | ResourceTemplateReference;
argument: { name: string; value: string };
context?: { arguments?: { [key: string]: string } };
}
Type Declaration
- [key: string]: unknown
OptionalprogressToken?: ProgressToken
ref: PromptReference | ResourceTemplateReference
argument: { name: string; value: string }
Type Declaration
- name: string
- value: string
context?: { arguments?: { [key: string]: string } }
Type Declaration
Optionalarguments?: { [key: string]: string }
CompleteResult
interface CompleteResult {
_meta?: { [key: string]: unknown };
completion: { values: string[]; total?: number; hasMore?: boolean };
[key: string]: unknown;
}
completion: { values: string[]; total?: number; hasMore?: boolean }
Type Declaration
- values: string[]
Optionaltotal?: numberOptionalhasMore?: boolean
PromptReference
interface PromptReference {
name: string;
title?: string;
type: “ref/prompt”;
}
ResourceTemplateReference
interface ResourceTemplateReference {
type: “ref/resource”;
uri: string;
}
elicitation/create
ElicitRequest
interface ElicitRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “elicitation/create”;
params: ElicitRequestParams;
}
method: “elicitation/create”
params: ElicitRequestParams
ElicitRequestParams
ElicitRequestParams: ElicitRequestFormParams | ElicitRequestURLParams
ElicitResult
interface ElicitResult {
_meta?: { [key: string]: unknown };
action: “accept” | “decline” | “cancel”;
content?: { [key: string]: string | number | boolean | string[] };
[key: string]: unknown;
}
action: “accept” | “decline” | “cancel”
content?: { [key: string]: string | number | boolean | string[] }
BooleanSchema
interface BooleanSchema {
type: “boolean”;
title?: string;
description?: string;
default?: boolean;
}
ElicitRequestFormParams
interface ElicitRequestFormParams {
task?: TaskMetadata;
_meta?: { progressToken?: ProgressToken; [key: string]: unknown };
mode?: “form”;
message: string;
requestedSchema: {
$schema?: string;
type: “object”;
properties: { [key: string]: PrimitiveSchemaDefinition };
required?: string[];
};
}
Type Declaration
- [key: string]: unknown
OptionalprogressToken?: ProgressToken
requestedSchema: { $schema?: string; type: “object”; properties: { [key: string]: PrimitiveSchemaDefinition }; required?: string[]; }
ElicitRequestURLParams
interface ElicitRequestURLParams {
task?: TaskMetadata;
_meta?: { progressToken?: ProgressToken; [key: string]: unknown };
mode: “url”;
message: string;
elicitationId: string;
url: string;
}
Type Declaration
- [key: string]: unknown
OptionalprogressToken?: ProgressToken
LegacyTitledEnumSchema
interface LegacyTitledEnumSchema {
type: “string”;
title?: string;
description?: string;
enum: string[];
enumNames?: string[];
default?: string;
}
MultiSelectEnumSchema
MultiSelectEnumSchema:
| UntitledMultiSelectEnumSchema
| TitledMultiSelectEnumSchema
NumberSchema
interface NumberSchema {
type: “number” | “integer”;
title?: string;
description?: string;
minimum?: number;
maximum?: number;
default?: number;
}
type: “number” | “integer”
PrimitiveSchemaDefinition
PrimitiveSchemaDefinition:
| StringSchema
| NumberSchema
| BooleanSchema
| EnumSchema
SingleSelectEnumSchema
SingleSelectEnumSchema:
| UntitledSingleSelectEnumSchema
| TitledSingleSelectEnumSchema
StringSchema
interface StringSchema {
type: “string”;
title?: string;
description?: string;
minLength?: number;
maxLength?: number;
format?: “uri” | “email” | “date” | “date-time”;
default?: string;
}
format?: “uri” | “email” | “date” | “date-time”
TitledMultiSelectEnumSchema
interface TitledMultiSelectEnumSchema {
type: “array”;
title?: string;
description?: string;
minItems?: number;
maxItems?: number;
items: { anyOf: { const: string; title: string }[] };
default?: string[];
}
items: { anyOf: { const: string; title: string }[] }
Type Declaration
- anyOf: { const: string; title: string }[]
TitledSingleSelectEnumSchema
interface TitledSingleSelectEnumSchema {
type: “string”;
title?: string;
description?: string;
oneOf: { const: string; title: string }[];
default?: string;
}
oneOf: { const: string; title: string }[]
Type Declaration
- const: string
- title: string
UntitledMultiSelectEnumSchema
interface UntitledMultiSelectEnumSchema {
type: “array”;
title?: string;
description?: string;
minItems?: number;
maxItems?: number;
items: { type: “string”; enum: string[] };
default?: string[];
}
items: { type: “string”; enum: string[] }
Type Declaration
- type: “string”
- enum: string[]
UntitledSingleSelectEnumSchema
interface UntitledSingleSelectEnumSchema {
type: “string”;
title?: string;
description?: string;
enum: string[];
default?: string;
}
initialize
InitializeRequest
interface InitializeRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “initialize”;
params: InitializeRequestParams;
}
params: InitializeRequestParams
InitializeRequestParams
interface InitializeRequestParams {
_meta?: { progressToken?: ProgressToken; [key: string]: unknown };
protocolVersion: string;
capabilities: ClientCapabilities;
clientInfo: Implementation;
}
Type Declaration
- [key: string]: unknown
OptionalprogressToken?: ProgressToken
capabilities: ClientCapabilities
clientInfo: Implementation
InitializeResult
interface InitializeResult {
_meta?: { [key: string]: unknown };
protocolVersion: string;
capabilities: ServerCapabilities;
serverInfo: Implementation;
instructions?: string;
[key: string]: unknown;
}
capabilities: ServerCapabilities
serverInfo: Implementation
ClientCapabilities
interface ClientCapabilities {
experimental?: { [key: string]: object };
roots?: { listChanged?: boolean };
sampling?: { context?: object; tools?: object };
elicitation?: { form?: object; url?: object };
tasks?: {
list?: object;
cancel?: object;
requests?: {
sampling?: { createMessage?: object };
elicitation?: { create?: object };
};
};
}
experimental?: { [key: string]: object }
roots?: { listChanged?: boolean }
Type Declaration
OptionallistChanged?: boolean
sampling?: { context?: object; tools?: object }
Type Declaration
Optionalcontext?: objectOptionaltools?: object
elicitation?: { form?: object; url?: object }
tasks?: { list?: object; cancel?: object; requests?: { sampling?: { createMessage?: object }; elicitation?: { create?: object }; }; }
Type Declaration
Optionallist?: objectOptionalcancel?: objectOptionalrequests?: { sampling?: { createMessage?: object }; elicitation?: { create?: object } }Optionalsampling?: { createMessage?: object }
*OptionalcreateMessage?: objectOptionalelicitation?: { create?: object }
*Optionalcreate?: object
Implementation
interface Implementation {
icons?: Icon[];
name: string;
title?: string;
version: string;
description?: string;
websiteUrl?: string;
}
ServerCapabilities
interface ServerCapabilities {
experimental?: { [key: string]: object };
logging?: object;
completions?: object;
prompts?: { listChanged?: boolean };
resources?: { subscribe?: boolean; listChanged?: boolean };
tools?: { listChanged?: boolean };
tasks?: {
list?: object;
cancel?: object;
requests?: { tools?: { call?: object } };
};
}
experimental?: { [key: string]: object }
prompts?: { listChanged?: boolean }
Type Declaration
OptionallistChanged?: boolean
resources?: { subscribe?: boolean; listChanged?: boolean }
Type Declaration
Optionalsubscribe?: booleanOptionallistChanged?: boolean
Type Declaration
OptionallistChanged?: boolean
tasks?: { list?: object; cancel?: object; requests?: { tools?: { call?: object } }; }
Type Declaration
Optionallist?: objectOptionalcancel?: objectOptionalrequests?: { tools?: { call?: object } }Optionaltools?: { call?: object }
*Optionalcall?: object
logging/setLevel
SetLevelRequest
interface SetLevelRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “logging/setLevel”;
params: SetLevelRequestParams;
}
method: “logging/setLevel”
params: SetLevelRequestParams
SetLevelRequestParams
interface SetLevelRequestParams {
_meta?: { progressToken?: ProgressToken; [key: string]: unknown };
level: LoggingLevel;
}
Type Declaration
- [key: string]: unknown
OptionalprogressToken?: ProgressToken
notifications/cancelled
CancelledNotification
interface CancelledNotification {
jsonrpc: “2.0”;
method: “notifications/cancelled”;
params: CancelledNotificationParams;
}
method: “notifications/cancelled”
params: CancelledNotificationParams
CancelledNotificationParams
interface CancelledNotificationParams {
_meta?: { [key: string]: unknown };
requestId?: RequestId;
reason?: string;
}
notifications/initialized
InitializedNotification
interface InitializedNotification {
jsonrpc: “2.0”;
method: “notifications/initialized”;
params?: NotificationParams;
}
method: “notifications/initialized”
params?: NotificationParams
notifications/tasks/status
TaskStatusNotification
interface TaskStatusNotification {
jsonrpc: “2.0”;
method: “notifications/tasks/status”;
params: TaskStatusNotificationParams;
}
method: “notifications/tasks/status”
params: TaskStatusNotificationParams
TaskStatusNotificationParams
TaskStatusNotificationParams: NotificationParams & Task
notifications/message
LoggingMessageNotification
interface LoggingMessageNotification {
jsonrpc: “2.0”;
method: “notifications/message”;
params: LoggingMessageNotificationParams;
}
method: “notifications/message”
params: LoggingMessageNotificationParams
LoggingMessageNotificationParams
interface LoggingMessageNotificationParams {
_meta?: { [key: string]: unknown };
level: LoggingLevel;
logger?: string;
data: unknown;
}
notifications/progress
ProgressNotification
interface ProgressNotification {
jsonrpc: “2.0”;
method: “notifications/progress”;
params: ProgressNotificationParams;
}
method: “notifications/progress”
params: ProgressNotificationParams
ProgressNotificationParams
interface ProgressNotificationParams {
_meta?: { [key: string]: unknown };
progressToken: ProgressToken;
progress: number;
total?: number;
message?: string;
}
progressToken: ProgressToken
notifications/prompts/list_changed
PromptListChangedNotification
interface PromptListChangedNotification {
jsonrpc: “2.0”;
method: “notifications/prompts/list_changed”;
params?: NotificationParams;
}
method: “notifications/prompts/list_changed”
params?: NotificationParams
notifications/resources/list_changed
ResourceListChangedNotification
interface ResourceListChangedNotification {
jsonrpc: “2.0”;
method: “notifications/resources/list_changed”;
params?: NotificationParams;
}
method: “notifications/resources/list_changed”
params?: NotificationParams
notifications/resources/updated
ResourceUpdatedNotification
interface ResourceUpdatedNotification {
jsonrpc: “2.0”;
method: “notifications/resources/updated”;
params: ResourceUpdatedNotificationParams;
}
method: “notifications/resources/updated”
params: ResourceUpdatedNotificationParams
ResourceUpdatedNotificationParams
interface ResourceUpdatedNotificationParams {
_meta?: { [key: string]: unknown };
uri: string;
}
notifications/roots/list_changed
RootsListChangedNotification
interface RootsListChangedNotification {
jsonrpc: “2.0”;
method: “notifications/roots/list_changed”;
params?: NotificationParams;
}
method: “notifications/roots/list_changed”
params?: NotificationParams
ToolListChangedNotification
interface ToolListChangedNotification {
jsonrpc: “2.0”;
method: “notifications/tools/list_changed”;
params?: NotificationParams;
}
notifications/elicitation/complete
ElicitationCompleteNotification
interface ElicitationCompleteNotification {
jsonrpc: “2.0”;
method: “notifications/elicitation/complete”;
params: { elicitationId: string };
}
method: “notifications/elicitation/complete”
params: { elicitationId: string }
Type Declaration
- elicitationId: string
ping
PingRequest
interface PingRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “ping”;
params?: RequestParams;
}
tasks
CreateTaskResult
interface CreateTaskResult {
_meta?: { [key: string]: unknown };
task: Task;
[key: string]: unknown;
}
interface RelatedTaskMetadata {
taskId: string;
}
Task
interface Task {
taskId: string;
status: TaskStatus;
statusMessage?: string;
createdAt: string;
lastUpdatedAt: string;
ttl: number | null;
pollInterval?: number;
}
TaskMetadata
interface TaskMetadata {
ttl?: number;
}
TaskStatus
TaskStatus: “working” | “input_required” | “completed” | “failed” | “cancelled”
tasks/get
GetTaskRequest
interface GetTaskRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “tasks/get”;
params: { taskId: string };
}
params: { taskId: string }
Type Declaration
- taskId: string
GetTaskResult
tasks/result
GetTaskPayloadRequest
interface GetTaskPayloadRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “tasks/result”;
params: { taskId: string };
}
params: { taskId: string }
Type Declaration
- taskId: string
GetTaskPayloadResult
interface GetTaskPayloadResult {
_meta?: { [key: string]: unknown };
[key: string]: unknown;
}
tasks/list
ListTasksRequest
interface ListTasksRequest {
jsonrpc: “2.0”;
id: RequestId;
params?: PaginatedRequestParams;
method: “tasks/list”;
}
params?: PaginatedRequestParams
ListTasksResult
interface ListTasksResult {
_meta?: { [key: string]: unknown };
nextCursor?: string;
tasks: Task[];
[key: string]: unknown;
}
tasks/cancel
CancelTaskRequest
interface CancelTaskRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “tasks/cancel”;
params: { taskId: string };
}
params: { taskId: string }
Type Declaration
- taskId: string
CancelTaskResult
CancelTaskResult: Result & Task
prompts/get
GetPromptRequest
interface GetPromptRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “prompts/get”;
params: GetPromptRequestParams;
}
params: GetPromptRequestParams
GetPromptRequestParams
interface GetPromptRequestParams {
_meta?: { progressToken?: ProgressToken; [key: string]: unknown };
name: string;
arguments?: { [key: string]: string };
}
Type Declaration
- [key: string]: unknown
OptionalprogressToken?: ProgressToken
arguments?: { [key: string]: string }
GetPromptResult
interface GetPromptResult {
_meta?: { [key: string]: unknown };
description?: string;
messages: PromptMessage[];
[key: string]: unknown;
}
messages: PromptMessage[]
PromptMessage
interface PromptMessage {
role: Role;
content: ContentBlock;
}
prompts/list
ListPromptsRequest
interface ListPromptsRequest {
jsonrpc: “2.0”;
id: RequestId;
params?: PaginatedRequestParams;
method: “prompts/list”;
}
params?: PaginatedRequestParams
ListPromptsResult
interface ListPromptsResult {
_meta?: { [key: string]: unknown };
nextCursor?: string;
prompts: Prompt[];
[key: string]: unknown;
}
Prompt
interface Prompt {
icons?: Icon[];
name: string;
title?: string;
description?: string;
arguments?: PromptArgument[];
_meta?: { [key: string]: unknown };
}
arguments?: PromptArgument[]
PromptArgument
interface PromptArgument {
name: string;
title?: string;
description?: string;
required?: boolean;
}
resources/list
ListResourcesRequest
interface ListResourcesRequest {
jsonrpc: “2.0”;
id: RequestId;
params?: PaginatedRequestParams;
method: “resources/list”;
}
params?: PaginatedRequestParams
ListResourcesResult
interface ListResourcesResult {
_meta?: { [key: string]: unknown };
nextCursor?: string;
resources: Resource[];
[key: string]: unknown;
}
Resource
interface Resource {
icons?: Icon[];
name: string;
title?: string;
uri: string;
description?: string;
mimeType?: string;
annotations?: Annotations;
size?: number;
_meta?: { [key: string]: unknown };
}
annotations?: Annotations
resources/read
ReadResourceRequest
interface ReadResourceRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “resources/read”;
params: ReadResourceRequestParams;
}
params: ReadResourceRequestParams
ReadResourceRequestParams
interface ReadResourceRequestParams {
_meta?: { progressToken?: ProgressToken; [key: string]: unknown };
uri: string;
}
Type Declaration
- [key: string]: unknown
OptionalprogressToken?: ProgressToken
ReadResourceResult
interface ReadResourceResult {
_meta?: { [key: string]: unknown };
contents: (TextResourceContents | BlobResourceContents)[];
[key: string]: unknown;
}
contents: (TextResourceContents | BlobResourceContents)[]
resources/subscribe
SubscribeRequest
interface SubscribeRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “resources/subscribe”;
params: SubscribeRequestParams;
}
method: “resources/subscribe”
params: SubscribeRequestParams
SubscribeRequestParams
interface SubscribeRequestParams {
_meta?: { progressToken?: ProgressToken; [key: string]: unknown };
uri: string;
}
Type Declaration
- [key: string]: unknown
OptionalprogressToken?: ProgressToken
resources/templates/list
ListResourceTemplatesRequest
interface ListResourceTemplatesRequest {
jsonrpc: “2.0”;
id: RequestId;
params?: PaginatedRequestParams;
method: “resources/templates/list”;
}
params?: PaginatedRequestParams
method: “resources/templates/list”
ListResourceTemplatesResult
interface ListResourceTemplatesResult {
_meta?: { [key: string]: unknown };
nextCursor?: string;
resourceTemplates: ResourceTemplate[];
[key: string]: unknown;
}
resourceTemplates: ResourceTemplate[]
ResourceTemplate
interface ResourceTemplate {
icons?: Icon[];
name: string;
title?: string;
uriTemplate: string;
description?: string;
mimeType?: string;
annotations?: Annotations;
_meta?: { [key: string]: unknown };
}
annotations?: Annotations
resources/unsubscribe
UnsubscribeRequest
interface UnsubscribeRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “resources/unsubscribe”;
params: UnsubscribeRequestParams;
}
method: “resources/unsubscribe”
params: UnsubscribeRequestParams
UnsubscribeRequestParams
interface UnsubscribeRequestParams {
_meta?: { progressToken?: ProgressToken; [key: string]: unknown };
uri: string;
}
Type Declaration
- [key: string]: unknown
OptionalprogressToken?: ProgressToken
roots/list
ListRootsRequest
interface ListRootsRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “roots/list”;
params?: RequestParams;
}
ListRootsResult
interface ListRootsResult {
_meta?: { [key: string]: unknown };
roots: Root[];
[key: string]: unknown;
}
Root
interface Root {
uri: string;
name?: string;
_meta?: { [key: string]: unknown };
}
sampling/createMessage
CreateMessageRequest
interface CreateMessageRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “sampling/createMessage”;
params: CreateMessageRequestParams;
}
method: “sampling/createMessage”
params: CreateMessageRequestParams
CreateMessageRequestParams
interface CreateMessageRequestParams {
task?: TaskMetadata;
_meta?: { progressToken?: ProgressToken; [key: string]: unknown };
messages: SamplingMessage[];
modelPreferences?: ModelPreferences;
systemPrompt?: string;
includeContext?: “none” | “thisServer” | “allServers”;
temperature?: number;
maxTokens: number;
stopSequences?: string[];
metadata?: object;
tools?: Tool[];
toolChoice?: ToolChoice;
}
Type Declaration
- [key: string]: unknown
OptionalprogressToken?: ProgressToken
messages: SamplingMessage[]
modelPreferences?: ModelPreferences
includeContext?: “none” | “thisServer” | “allServers”
CreateMessageResult
interface CreateMessageResult {
_meta?: { [key: string]: unknown };
model: string;
stopReason?: string;
role: Role;
content: SamplingMessageContentBlock | SamplingMessageContentBlock[];
[key: string]: unknown;
}
content: SamplingMessageContentBlock | SamplingMessageContentBlock[]
ModelHint
interface ModelHint {
name?: string;
}
ModelPreferences
interface ModelPreferences {
hints?: ModelHint[];
costPriority?: number;
speedPriority?: number;
intelligencePriority?: number;
}
intelligencePriority?: number
SamplingMessage
interface SamplingMessage {
role: Role;
content: SamplingMessageContentBlock | SamplingMessageContentBlock[];
_meta?: { [key: string]: unknown };
}
content: SamplingMessageContentBlock | SamplingMessageContentBlock[]
SamplingMessageContentBlock
SamplingMessageContentBlock:
| TextContent
| ImageContent
| AudioContent
| ToolUseContent
| ToolResultContent
ToolChoice
interface ToolChoice {
mode?: “none” | “required” | “auto”;
}
ToolResultContent
interface ToolResultContent {
type: “tool_result”;
toolUseId: string;
content: ContentBlock[];
structuredContent?: { [key: string]: unknown };
isError?: boolean;
_meta?: { [key: string]: unknown };
}
structuredContent?: { [key: string]: unknown }
_meta?: { [key: string]: unknown }
ToolUseContent
interface ToolUseContent {
type: “tool_use”;
id: string;
name: string;
input: { [key: string]: unknown };
_meta?: { [key: string]: unknown };
}
input: { [key: string]: unknown }
_meta?: { [key: string]: unknown }
CallToolRequest
interface CallToolRequest {
jsonrpc: “2.0”;
id: RequestId;
method: “tools/call”;
params: CallToolRequestParams;
}
CallToolRequestParams
interface CallToolRequestParams {
task?: TaskMetadata;
_meta?: { progressToken?: ProgressToken; [key: string]: unknown };
name: string;
arguments?: { [key: string]: unknown };
}
Type Declaration
- [key: string]: unknown
OptionalprogressToken?: ProgressToken
CallToolResult
interface CallToolResult {
_meta?: { [key: string]: unknown };
content: ContentBlock[];
structuredContent?: { [key: string]: unknown };
isError?: boolean;
[key: string]: unknown;
}
structuredContent?: { [key: string]: unknown }
ListToolsRequest
interface ListToolsRequest {
jsonrpc: “2.0”;
id: RequestId;
params?: PaginatedRequestParams;
method: “tools/list”;
}
ListToolsResult
interface ListToolsResult {
_meta?: { [key: string]: unknown };
nextCursor?: string;
tools: Tool[];
[key: string]: unknown;
}
Tool
interface Tool {
icons?: Icon[];
name: string;
title?: string;
description?: string;
inputSchema: {
$schema?: string;
type: “object”;
properties?: { [key: string]: object };
required?: string[];
};
execution?: ToolExecution;
outputSchema?: {
$schema?: string;
type: “object”;
properties?: { [key: string]: object };
required?: string[];
};
annotations?: ToolAnnotations;
_meta?: { [key: string]: unknown };
}
ToolAnnotations
interface ToolAnnotations {
title?: string;
readOnlyHint?: boolean;
destructiveHint?: boolean;
idempotentHint?: boolean;
openWorldHint?: boolean;
}
ToolExecution
interface ToolExecution {
taskSupport?: “forbidden” | “optional” | “required”;
}