public final class McpSchema
extends java.lang.Object
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
McpSchema.Annotated
Base for objects that include optional annotations for the client.
|
static class |
McpSchema.Annotations
Optional annotations for the client.
|
static class |
McpSchema.AudioContent
Audio provided to or from an LLM.
|
static class |
McpSchema.BlobResourceContents
Binary contents of a resource.
|
static class |
McpSchema.CallToolRequest
Used by the client to call a tool provided by the server.
|
static class |
McpSchema.CallToolResult
The server's response to a tools/call request from the client.
|
static class |
McpSchema.ClientCapabilities
Capabilities a client may support.
|
static interface |
McpSchema.CompleteReference
permits PromptReference, ResourceReference
|
static class |
McpSchema.CompleteRequest
A request from the client to the server, to ask for completion options.
|
static class |
McpSchema.CompleteResult
The server's response to a completion/complete request.
|
static interface |
McpSchema.Content
permits TextContent, ImageContent, AudioContent, EmbeddedResource, ResourceLink
|
static class |
McpSchema.CreateMessageRequest
A request from the server to sample an LLM via the client.
|
static class |
McpSchema.CreateMessageResult
The client's response to a sampling/create_message request from the server.
|
static class |
McpSchema.ElicitRequest
A request from the server to elicit additional information from the user via the
client.
|
static class |
McpSchema.ElicitResult
The client's response to an elicitation request.
|
static class |
McpSchema.EmbeddedResource
The contents of a resource, embedded into a prompt or tool call result.
|
static class |
McpSchema.ErrorCodes
Standard error codes used in MCP JSON-RPC responses.
|
static class |
McpSchema.GetPromptRequest
Used by the client to get a prompt provided by the server.
|
static class |
McpSchema.GetPromptResult
The server's response to a prompts/get request from the client.
|
static interface |
McpSchema.Identifier
Base interface with name (identifier) and title (display name) properties.
|
static class |
McpSchema.ImageContent
An image provided to or from an LLM.
|
static class |
McpSchema.Implementation
Describes the name and version of an MCP implementation, with an optional title for
UI representation.
|
static class |
McpSchema.InitializeRequest
This request is sent from the client to the server when it first connects, asking
it to begin initialization.
|
static class |
McpSchema.InitializeResult
After receiving an initialize request from the client, the server sends this
response.
|
static interface |
McpSchema.JSONRPCMessage
permits JSONRPCRequest, JSONRPCNotification, JSONRPCResponse
|
static class |
McpSchema.JSONRPCNotification
A notification which does not expect a response.
|
static class |
McpSchema.JSONRPCRequest
A request that expects a response.
|
static class |
McpSchema.JSONRPCResponse
A response to a request (successful, or error).
|
static class |
McpSchema.JsonSchema
A JSON Schema object that describes the expected structure of arguments or output.
|
static class |
McpSchema.ListPromptsResult
The server's response to a prompts/list request from the client.
|
static class |
McpSchema.ListResourcesResult
The server's response to a resources/list request from the client.
|
static class |
McpSchema.ListResourceTemplatesResult
The server's response to a resources/templates/list request from the client.
|
static class |
McpSchema.ListRootsResult
The client's response to a roots/list request from the server.
|
static class |
McpSchema.ListToolsResult
The server's response to a tools/list request from the client.
|
static class |
McpSchema.LoggingLevel |
static class |
McpSchema.LoggingMessageNotification
The Model Context Protocol (MCP) provides a standardized way for servers to send
structured log messages to clients.
|
static interface |
McpSchema.Meta
Base interface for MCP objects that include optional metadata in the `_meta` field.
|
static class |
McpSchema.ModelHint
Hints to use for model selection.
|
static class |
McpSchema.ModelPreferences
The server's preferences for model selection, requested of the client during
sampling.
|
static interface |
McpSchema.Notification
permits ProgressNotification, LoggingMessageNotification, ResourcesUpdatedNotification
|
static class |
McpSchema.PaginatedRequest
A request that supports pagination using cursors.
|
static class |
McpSchema.PaginatedResult
An opaque token representing the pagination position after the last returned
result.
|
static class |
McpSchema.ProgressNotification
The Model Context Protocol (MCP) supports optional progress tracking for
long-running operations through notification messages.
|
static class |
McpSchema.Prompt
A prompt or prompt template that the server offers.
|
static class |
McpSchema.PromptArgument
Describes an argument that a prompt can accept.
|
static class |
McpSchema.PromptMessage
Describes a message returned as part of a prompt.
|
static class |
McpSchema.PromptReference
Identifies a prompt for completion requests.
|
static class |
McpSchema.ReadResourceRequest
Sent from the client to the server, to read a specific resource URI.
|
static class |
McpSchema.ReadResourceResult
The server's response to a resources/read request from the client.
|
static interface |
McpSchema.Request
permits InitializeRequest, CallToolRequest, CreateMessageRequest, ElicitRequest, CompleteRequest,
GetPromptRequest, ReadResourceRequest, SubscribeRequest, UnsubscribeRequest, PaginatedRequest
|
static class |
McpSchema.Resource
A known resource that the server is capable of reading.
|
static interface |
McpSchema.ResourceContent
A common interface for resource content, which includes metadata about the resource
such as its URI, name, description, MIME type, size, and annotations.
|
static interface |
McpSchema.ResourceContents
The contents of a specific resource or sub-resource.
|
static class |
McpSchema.ResourceLink
A known resource that the server is capable of reading.
|
static class |
McpSchema.ResourceReference
A reference to a resource or resource template definition for completion requests.
|
static class |
McpSchema.ResourcesUpdatedNotification
The Model Context Protocol (MCP) provides a standardized way for servers to send
resources update message to clients.
|
static class |
McpSchema.ResourceTemplate
Resource templates allow servers to expose parameterized resources using URI
|
static interface |
McpSchema.Result
permits InitializeResult, ListResourcesResult,
ListResourceTemplatesResult, ReadResourceResult, ListPromptsResult, GetPromptResult, ListToolsResult,
CallToolResult, CreateMessageResult, ElicitResult, CompleteResult, ListRootsResult
|
static class |
McpSchema.Role |
static class |
McpSchema.Root
Represents a root directory or file that the server can operate on.
|
static class |
McpSchema.SamplingMessage
Describes a message issued to or received from an LLM API.
|
static class |
McpSchema.ServerCapabilities
Capabilities that a server may support.
|
static class |
McpSchema.SetLevelRequest
A request from the client to the server, to enable or adjust logging.
|
static class |
McpSchema.SubscribeRequest
Sent from the client to request resources/updated notifications from the server
whenever a particular resource changes.
|
static class |
McpSchema.TextContent
Text provided to or from an LLM.
|
static class |
McpSchema.TextResourceContents
Text contents of a resource.
|
static class |
McpSchema.Tool
Represents a tool that the server provides.
|
static class |
McpSchema.ToolAnnotations
Additional properties describing a Tool to clients.
|
static class |
McpSchema.UnsubscribeRequest
Sent from the client to request cancellation of resources/updated notifications
from the server.
|
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
FIRST_PAGE |
static java.lang.String |
JSONRPC_VERSION |
static java.lang.String |
LATEST_PROTOCOL_VERSION
已过时。
|
static java.lang.String |
METHOD_COMPLETION_COMPLETE |
static java.lang.String |
METHOD_ELICITATION_CREATE |
static java.lang.String |
METHOD_INITIALIZE |
static java.lang.String |
METHOD_LOGGING_SET_LEVEL |
static java.lang.String |
METHOD_NOTIFICATION_INITIALIZED |
static java.lang.String |
METHOD_NOTIFICATION_MESSAGE |
static java.lang.String |
METHOD_NOTIFICATION_PROGRESS |
static java.lang.String |
METHOD_NOTIFICATION_PROMPTS_LIST_CHANGED |
static java.lang.String |
METHOD_NOTIFICATION_RESOURCES_LIST_CHANGED |
static java.lang.String |
METHOD_NOTIFICATION_RESOURCES_UPDATED |
static java.lang.String |
METHOD_NOTIFICATION_ROOTS_LIST_CHANGED |
static java.lang.String |
METHOD_NOTIFICATION_TOOLS_LIST_CHANGED |
static java.lang.String |
METHOD_PING |
static java.lang.String |
METHOD_PROMPT_GET |
static java.lang.String |
METHOD_PROMPT_LIST |
static java.lang.String |
METHOD_RESOURCES_LIST |
static java.lang.String |
METHOD_RESOURCES_READ |
static java.lang.String |
METHOD_RESOURCES_SUBSCRIBE |
static java.lang.String |
METHOD_RESOURCES_TEMPLATES_LIST |
static java.lang.String |
METHOD_RESOURCES_UNSUBSCRIBE |
static java.lang.String |
METHOD_ROOTS_LIST |
static java.lang.String |
METHOD_SAMPLING_CREATE_MESSAGE |
static java.lang.String |
METHOD_TOOLS_CALL |
static java.lang.String |
METHOD_TOOLS_LIST |
| 限定符和类型 | 方法和说明 |
|---|---|
static McpSchema.JSONRPCMessage |
deserializeJsonRpcMessage(McpJsonMapper jsonMapper,
java.lang.String jsonText)
Deserializes a JSON string into a JSONRPCMessage object.
|
@Deprecated public static final java.lang.String LATEST_PROTOCOL_VERSION
public static final java.lang.String JSONRPC_VERSION
public static final java.lang.String FIRST_PAGE
public static final java.lang.String METHOD_INITIALIZE
public static final java.lang.String METHOD_NOTIFICATION_INITIALIZED
public static final java.lang.String METHOD_PING
public static final java.lang.String METHOD_NOTIFICATION_PROGRESS
public static final java.lang.String METHOD_TOOLS_LIST
public static final java.lang.String METHOD_TOOLS_CALL
public static final java.lang.String METHOD_NOTIFICATION_TOOLS_LIST_CHANGED
public static final java.lang.String METHOD_RESOURCES_LIST
public static final java.lang.String METHOD_RESOURCES_READ
public static final java.lang.String METHOD_NOTIFICATION_RESOURCES_LIST_CHANGED
public static final java.lang.String METHOD_NOTIFICATION_RESOURCES_UPDATED
public static final java.lang.String METHOD_RESOURCES_TEMPLATES_LIST
public static final java.lang.String METHOD_RESOURCES_SUBSCRIBE
public static final java.lang.String METHOD_RESOURCES_UNSUBSCRIBE
public static final java.lang.String METHOD_PROMPT_LIST
public static final java.lang.String METHOD_PROMPT_GET
public static final java.lang.String METHOD_NOTIFICATION_PROMPTS_LIST_CHANGED
public static final java.lang.String METHOD_COMPLETION_COMPLETE
public static final java.lang.String METHOD_LOGGING_SET_LEVEL
public static final java.lang.String METHOD_NOTIFICATION_MESSAGE
public static final java.lang.String METHOD_ROOTS_LIST
public static final java.lang.String METHOD_NOTIFICATION_ROOTS_LIST_CHANGED
public static final java.lang.String METHOD_SAMPLING_CREATE_MESSAGE
public static final java.lang.String METHOD_ELICITATION_CREATE
public static McpSchema.JSONRPCMessage deserializeJsonRpcMessage(McpJsonMapper jsonMapper, java.lang.String jsonText) throws java.io.IOException
jsonMapper - The JsonMapper instance to use for deserializationjsonText - The JSON string to deserializeMcpSchema.JSONRPCRequest,
McpSchema.JSONRPCNotification, or McpSchema.JSONRPCResponse classes.java.io.IOException - If there's an error during deserializationjava.lang.IllegalArgumentException - If the JSON structure doesn't match any known
message type