Skip to contents

Sends a progress notification to the MCP client while a tool, a resource, a prompt or a completion function runs, when the client asked for the progress of that call. Outside a server, or when the client did not ask, it only checks its arguments, so the function stays callable anywhere. The server sends at most ten notifications per second for a call and drops the others, and stops once the call has answered.

Usage

report_progress(progress, total = NULL, message = NULL)

Arguments

progress

Progress so far: a number, greater at each call.

total

Total that progress reaches at the end, or NULL when it is not known.

message

A sentence for the user about what is happening, or NULL.

Value

NULL, invisibly.

Examples

# Outside a server, it only checks its arguments.
report_progress(
  1,
  total = 3,
  message = "Reading the runs of 2025."
)