File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
mcp/src/main/java/io/modelcontextprotocol/server Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 66
77import java .time .Duration ;
88import java .util .HashMap ;
9+ import java .util .Collections ;
910import java .util .List ;
1011import java .util .Map ;
1112import java .util .Optional ;
@@ -403,7 +404,7 @@ private static class AsyncServerImpl extends McpAsyncServer {
403404 // Initialize request handlers for standard MCP methods
404405
405406 // 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 () ));
407408
408409 // Add tools API handlers if the tool capability is enabled
409410 if (this .serverCapabilities .tools () != null ) {
@@ -926,7 +927,7 @@ private static final class LegacyAsyncServer extends McpAsyncServer {
926927 requestHandlers .put (McpSchema .METHOD_INITIALIZE , asyncInitializeRequestHandler ());
927928
928929 // 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 () ));
930931
931932 // Add tools API handlers if the tool capability is enabled
932933 if (this .serverCapabilities .tools () != null ) {
You can’t perform that action at this time.
0 commit comments