cancelTask method

Future<void> cancelTask(
  1. String taskId
)

Cancel a task (tasks/cancel, cooperative + eventually consistent).

Implementation

Future<void> cancelTask(String taskId) async {
  if (!isConnected) throw McpError('Client is not connected to a transport');
  await _sendRequest('tasks/cancel', {'taskId': taskId});
}