add access to server instructions (#148)
This commit is contained in:
parent
f348a83e5a
commit
8068854227
2 changed files with 24 additions and 0 deletions
|
|
@ -112,6 +112,11 @@ public class McpAsyncClient {
|
||||||
*/
|
*/
|
||||||
private McpSchema.ServerCapabilities serverCapabilities;
|
private McpSchema.ServerCapabilities serverCapabilities;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Server instructions.
|
||||||
|
*/
|
||||||
|
private String serverInstructions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Server implementation information.
|
* Server implementation information.
|
||||||
*/
|
*/
|
||||||
|
|
@ -240,6 +245,15 @@ public class McpAsyncClient {
|
||||||
return this.serverCapabilities;
|
return this.serverCapabilities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the server instructions that provide guidance to the client on how to interact
|
||||||
|
* with this server.
|
||||||
|
* @return The server instructions
|
||||||
|
*/
|
||||||
|
public String getServerInstructions() {
|
||||||
|
return this.serverInstructions;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the server implementation information.
|
* Get the server implementation information.
|
||||||
* @return The server implementation details
|
* @return The server implementation details
|
||||||
|
|
@ -328,6 +342,7 @@ public class McpAsyncClient {
|
||||||
return result.flatMap(initializeResult -> {
|
return result.flatMap(initializeResult -> {
|
||||||
|
|
||||||
this.serverCapabilities = initializeResult.capabilities();
|
this.serverCapabilities = initializeResult.capabilities();
|
||||||
|
this.serverInstructions = initializeResult.instructions();
|
||||||
this.serverInfo = initializeResult.serverInfo();
|
this.serverInfo = initializeResult.serverInfo();
|
||||||
|
|
||||||
logger.info("Server response with Protocol: {}, Capabilities: {}, Info: {} and Instructions {}",
|
logger.info("Server response with Protocol: {}, Capabilities: {}, Info: {} and Instructions {}",
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,15 @@ public class McpSyncClient implements AutoCloseable {
|
||||||
return this.delegate.getServerCapabilities();
|
return this.delegate.getServerCapabilities();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the server instructions that provide guidance to the client on how to interact
|
||||||
|
* with this server.
|
||||||
|
* @return The instructions
|
||||||
|
*/
|
||||||
|
public String getServerInstructions() {
|
||||||
|
return this.delegate.getServerInstructions();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the server implementation information.
|
* Get the server implementation information.
|
||||||
* @return The server implementation details
|
* @return The server implementation details
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue