notification method

Future<void> notification(
  1. String method, {
  2. McpJsonMap? params,
  3. bool streamable = true,
  4. bool includeSession = true,
  5. String? protocolVersion,
  6. Map<String, String> headers = const <String, String>{},
})

Sends an arbitrary JSON-RPC notification through the MCP session.

Implementation

Future<void> notification(
  String method, {
  McpJsonMap? params,
  bool streamable = true,
  bool includeSession = true,
  String? protocolVersion,
  Map<String, String> headers = const <String, String>{},
}) async {
  await post(
    <String, Object?>{'jsonrpc': '2.0', 'method': method, 'params': ?params},
    streamable: streamable,
    includeSession: includeSession,
    protocolVersion: protocolVersion,
    headers: headers,
  );
}