Address review comments

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
This commit is contained in:
Christian Tzolov 2025-03-19 10:04:37 +01:00 • committed by Christian Tzolov
commit 264a0c9041
2 changed files with 13 additions and 10 deletions

View file

@ -369,13 +369,12 @@ public class McpAsyncClient {
/**
* Sends a ping request to the server.
* @return A Mono that completes when the server responds to the ping
* @return A Mono that completes with the server's ping response
*/
public Mono<Void> ping() {
public Mono<Object> ping() {
return this.withInitializationCheck("pinging the server", initializedResult -> this.mcpSession
.sendRequest(McpSchema.METHOD_PING, null, new TypeReference<Object>() {
})
.then());
}));
}
// --------------------------

View file

@ -179,10 +179,11 @@ public class McpSyncClient implements AutoCloseable {
}
/**
* Send a synchronous ping request to the server.
* Send a synchronous ping request.
* @return
*/
public void ping() {
this.delegate.ping().block();
public Object ping() {
return this.delegate.ping().block();
}
// --------------------------