Method SendNotificationAsync
SendNotificationAsync(string, object, CancellationToken)
Sends a JSON-RPC notification (fire-and-forget, no response expected).
public Task SendNotificationAsync(string method, object parameters, CancellationToken cancellationToken = default)
Parameters
methodstringThe notification method name (e.g., "notifications/initialized").
parametersobjectThe notification parameters, or
nullif none.cancellationTokenCancellationTokenA token to cancel the send operation.
Returns
- Task
A task representing the asynchronous send operation.
Exceptions
- McpTransportException
Thrown on transport-level failures.
- InvalidOperationException
Thrown when the transport is not connected.