notifyProgress sends a progress notification to the MCP client if the request includes a progress token. The req, req.Params, and req.Session fields are checked for nil before use. Errors are silently ignored because progress notifications are best-effort; the tool result is not affected. If the cli
(ctx context.Context, req *mcp.CallToolRequest, progress, total float64, message string)
| 620 | // has disconnected or the notification fails for any reason, the tool continues |
| 621 | // executing normally. |
| 622 | func notifyProgress(ctx context.Context, req *mcp.CallToolRequest, progress, total float64, message string) { |
| 623 | if req == nil || req.Session == nil { |
| 624 | return |
| 625 | } |
| 626 | if token := req.Params.GetProgressToken(); token != nil { |
| 627 | _ = req.Session.NotifyProgress(ctx, &mcp.ProgressNotificationParams{ |
| 628 | ProgressToken: token, |
| 629 | Progress: progress, |
| 630 | Total: total, |
| 631 | Message: message, |
| 632 | }) |
| 633 | } |
| 634 | } |
| 635 | |
| 636 | // filtering out debug log lines (e.g. "workflow:script_registry Creating... +151ns"). |
| 637 | // Console messages are identified by their prefix symbols (✗, ✓, ℹ, ⚠, etc.). |
no outgoing calls
no test coverage detected