public class McpSyncServerExchange
extends java.lang.Object
构造器和说明 |
---|
McpSyncServerExchange(McpAsyncServerExchange exchange)
Create a new synchronous exchange with the client using the provided asynchronous
implementation as a delegate.
|
限定符和类型 | 方法和说明 |
---|---|
McpSchema.ElicitResult |
createElicitation(McpSchema.ElicitRequest elicitRequest)
Creates a new elicitation.
|
McpSchema.CreateMessageResult |
createMessage(McpSchema.CreateMessageRequest createMessageRequest)
Create a new message using the sampling capabilities of the client.
|
McpSchema.ClientCapabilities |
getClientCapabilities()
Get the client capabilities that define the supported features and functionality.
|
McpSchema.Implementation |
getClientInfo()
Get the client implementation information.
|
McpSchema.ListRootsResult |
listRoots()
Retrieves the list of all roots provided by the client.
|
McpSchema.ListRootsResult |
listRoots(java.lang.String cursor)
Retrieves a paginated list of roots provided by the client.
|
void |
loggingNotification(McpSchema.LoggingMessageNotification loggingMessageNotification)
Send a logging message notification to the client.
|
java.lang.Object |
ping()
Sends a synchronous ping request to the client.
|
void |
progressNotification(McpSchema.ProgressNotification progressNotification)
Sends a notification to the client that the current progress status has changed for
long-running operations.
|
java.lang.String |
sessionId()
Provides the Session ID
|
McpTransportContext |
transportContext()
Provides the
McpTransportContext associated with the transport layer. |
public McpSyncServerExchange(McpAsyncServerExchange exchange)
exchange
- The asynchronous exchange to delegate to.public java.lang.String sessionId()
public McpSchema.ClientCapabilities getClientCapabilities()
public McpSchema.Implementation getClientInfo()
public McpTransportContext transportContext()
McpTransportContext
associated with the transport layer. For
HTTP transports it can contain the metadata associated with the HTTP request that
triggered the processing.public McpSchema.CreateMessageResult createMessage(McpSchema.CreateMessageRequest createMessageRequest)
createMessageRequest
- The request to create a new messageMcpSchema.CreateMessageRequest
,
McpSchema.CreateMessageResult
,
Sampling
Specificationpublic McpSchema.ElicitResult createElicitation(McpSchema.ElicitRequest elicitRequest)
elicitRequest
- The request to create a new elicitationMcpSchema.ElicitRequest
,
McpSchema.ElicitResult
,
Elicitation
Specificationpublic McpSchema.ListRootsResult listRoots()
public McpSchema.ListRootsResult listRoots(java.lang.String cursor)
cursor
- Optional pagination cursor from a previous list requestpublic void loggingNotification(McpSchema.LoggingMessageNotification loggingMessageNotification)
loggingMessageNotification
- The logging message to sendpublic void progressNotification(McpSchema.ProgressNotification progressNotification)
progressNotification
- The progress notification to sendpublic java.lang.Object ping()