ping method

Future<McpJsonMap> ping({
  1. Object? id,
  2. bool streamable = true,
  3. bool directJson = false,
  4. String? protocolVersion,
  5. Map<String, String> headers = const <String, String>{},
})

Pings the active MCP session.

Implementation

Future<McpJsonMap> ping({
  Object? id,
  bool streamable = true,
  bool directJson = false,
  String? protocolVersion,
  Map<String, String> headers = const <String, String>{},
}) async {
  final response = await request(
    'ping',
    id: id,
    streamable: directJson ? false : streamable,
    includeSession: !directJson,
    protocolVersion: protocolVersion,
    headers: headers,
  );
  return _jsonRpcResultFrom(response, method: 'ping');
}