Interface ContextNotifications
- All Superinterfaces:
Notifications
Notifications logging surface with progress and keep-alive operations.-
Method Summary
Modifier and TypeMethodDescriptiondefault voidcomment()Sends empty SSE comment line (:\r\n).voidSends a raw SSE comment line (: message) on the response stream, upgrading a buffered POST response totext/event-streamif it has not started yet.voidprogress(@Nullable ProgressToken progressToken, double progress, double total, String message) Sends a progress notification.
-
Method Details
-
progress
Sends a progress notification.The first server→client message on a POST also upgrades its response to an SSE stream and arms the heartbeat, keeping the connection alive past
readerIdleTimeout— so emitting an earlyprogress(...)is the keep-alive mechanism for long-running tools.progressTokenshould be the client's request_meta.progressToken(e.g.ToolRequest.progressToken()). When it isnullthe client did not opt into progress, so the notification is silently dropped per the MCP spec — handlers may emit progress unconditionally without null-checking the token. -
comment
Sends a raw SSE comment line (: message) on the response stream, upgrading a buffered POST response totext/event-streamif it has not started yet.Unlike
progress(dev.tachyonmcp.api.server.domain.ProgressToken, double, double, java.lang.String), this needs no progress token — it carries no MCP message, only transport-level bytes the client ignores. Use it to keep a long-running request's connection alive when no progress token is available. Anullor blank message emits a bare:heartbeat comment. No-op when no outbound stream is bound to the context. -
comment
Sends empty SSE comment line (:\r\n).- See Also:
-