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.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.
|
McpServerSession |
getSession() |
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.
|
public McpSyncServerExchange(McpAsyncServerExchange exchange)
exchange
- The asynchronous exchange to delegate to.public McpServerSession getSession()
public McpSchema.ClientCapabilities getClientCapabilities()
public McpSchema.Implementation getClientInfo()
public McpSchema.CreateMessageResult createMessage(McpSchema.CreateMessageRequest createMessageRequest)
createMessageRequest
- The request to create a new messageMcpSchema.CreateMessageRequest
,
McpSchema.CreateMessageResult
,
Sampling
Specificationpublic McpSchema.ListRootsResult listRoots()
public McpSchema.ListRootsResult listRoots(java.lang.String cursor)
cursor
- Optional pagination cursor from a previous list request