notifyProgress method

void notifyProgress(
  1. dynamic progressToken,
  2. double progress, {
  3. double? total,
  4. String? message,
})

Report progress on an in-flight server-initiated request (spec notifications/progress). progressToken is the token the server sent in the original request's _meta.progressToken.

Implementation

void notifyProgress(
  dynamic progressToken,
  double progress, {
  double? total,
  String? message,
}) {
  if (!_initialized) {
    throw McpError('Client is not initialized');
  }
  _sendNotification('notifications/progress', {
    'progressToken': progressToken,
    'progress': progress,
    if (total != null) 'total': total,
    if (message != null) 'message': message,
  });
}