Progress reporting lets your server send progress updates to the client while a tool is running. Clients can use these updates to show spinners, progress bars, and “still working” UI during slow operations.
Note: ctx.report_progress(...) only sends a notification if the client provided a progress token for this request. If the client didn’t request progress, it’s a no-op.
Basic usage
Parameters
Example: File download
Example: Data processing pipeline
Example: Indeterminate progress
If you don’t know the total up front, omit total and send periodic updates:
Tips
- Prefer async work: progress updates are most useful when your tool is doing I/O (
async def). If you do CPU-heavy or blocking work, consider offloading it so progress notifications can still flow.
- Use
message sparingly: short messages like “Downloading…”, “Transforming…”, “Saving…” are easiest for clients to display.
- Don’t spam updates: sending progress on every tiny step can be noisy. For very large loops, you may want to report every N items.
Last modified on June 30, 2026