File tree 1 file changed +3
-2
lines changed
mcp/src/main/java/io/modelcontextprotocol/server
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import java .time .Duration ;
8
8
import java .util .HashMap ;
9
+ import java .util .Collections ;
9
10
import java .util .List ;
10
11
import java .util .Map ;
11
12
import java .util .Optional ;
@@ -403,7 +404,7 @@ private static class AsyncServerImpl extends McpAsyncServer {
403
404
// Initialize request handlers for standard MCP methods
404
405
405
406
// Ping MUST respond with an empty data, but not NULL response.
406
- requestHandlers .put (McpSchema .METHOD_PING , (exchange , params ) -> Mono .just ("" ));
407
+ requestHandlers .put (McpSchema .METHOD_PING , (exchange , params ) -> Mono .just (Map . of () ));
407
408
408
409
// Add tools API handlers if the tool capability is enabled
409
410
if (this .serverCapabilities .tools () != null ) {
@@ -926,7 +927,7 @@ private static final class LegacyAsyncServer extends McpAsyncServer {
926
927
requestHandlers .put (McpSchema .METHOD_INITIALIZE , asyncInitializeRequestHandler ());
927
928
928
929
// Ping MUST respond with an empty data, but not NULL response.
929
- requestHandlers .put (McpSchema .METHOD_PING , (params ) -> Mono .just ("" ));
930
+ requestHandlers .put (McpSchema .METHOD_PING , (params ) -> Mono .just (Map . of () ));
930
931
931
932
// Add tools API handlers if the tool capability is enabled
932
933
if (this .serverCapabilities .tools () != null ) {
You can’t perform that action at this time.
0 commit comments