pub struct Notifier { /* private fields */ }Expand description
Client-side handle for sending notifies to a running agent completion (or any other streaming endpoint) over the same WS that carries the chunk stream.
Multiple in-flight notifies are supported; each gets a unique id and parks its own oneshot. Calls are independent and can run concurrently from multiple tasks.
Implementations§
Source§impl Notifier
impl Notifier
Sourcepub async fn notify_list_changed(
&self,
change: McpListChanged,
) -> Result<(), HttpError>
pub async fn notify_list_changed( &self, change: McpListChanged, ) -> Result<(), HttpError>
Forward a notifications/{tools,resources}/list_changed
observation from an upstream mcp::Connection up to the API,
which will fan it out as an SSE event on every matching
per-MCP GET stream — /objectiveai or
/{owner}/{name}/{ver}/{mcp}, subscribed under the
per-agent response_id + matching McpKind.
Returns Ok(()) if the server accepted the notify. Returns
the server-supplied code + message if the server replied
with an Error variant. Returns
super::HttpError::NotifyChannelClosed if the WS was torn
down before the reply arrived.
Sourcepub async fn list_tools(
&self,
response_id: String,
name: Option<String>,
params: ListToolsRequest,
) -> Result<JsonRpcResult<ListToolsResult>, HttpError>
pub async fn list_tools( &self, response_id: String, name: Option<String>, params: ListToolsRequest, ) -> Result<JsonRpcResult<ListToolsResult>, HttpError>
Run the proxy’s aggregated tools/list for response_id over
this WS and return the proxy’s verbatim
JsonRpcResult.
A server-level rejection (unknown / banned response_id) is
folded into JsonRpcResult::Err so callers see a single
MCP-shaped outcome; only transport failures surface as Err.
Sourcepub async fn call_tool(
&self,
response_id: String,
params: CallToolRequestParams,
) -> Result<JsonRpcResult<CallToolResult>, HttpError>
pub async fn call_tool( &self, response_id: String, params: CallToolRequestParams, ) -> Result<JsonRpcResult<CallToolResult>, HttpError>
Run the proxy’s aggregated tools/call for response_id over
this WS (routes by tool-name prefix to the owning upstream;
does NOT consult the queue delegate). See Self::list_tools
for the error-folding contract.
Sourcepub async fn list_resources(
&self,
response_id: String,
name: Option<String>,
params: ListResourcesRequest,
) -> Result<JsonRpcResult<ListResourcesResult>, HttpError>
pub async fn list_resources( &self, response_id: String, name: Option<String>, params: ListResourcesRequest, ) -> Result<JsonRpcResult<ListResourcesResult>, HttpError>
Run the proxy’s aggregated resources/list for response_id
over this WS. See Self::list_tools for the error contract.
Sourcepub async fn list_servers(
&self,
response_id: String,
) -> Result<JsonRpcResult<ListServersResult>, HttpError>
pub async fn list_servers( &self, response_id: String, ) -> Result<JsonRpcResult<ListServersResult>, HttpError>
List the proxy’s connected upstream MCP servers for response_id
over this WS (a proxy-local aggregate). See Self::list_tools
for the error contract.
Sourcepub async fn read_resource(
&self,
response_id: String,
params: ReadResourceRequestParams,
) -> Result<JsonRpcResult<ReadResourceResult>, HttpError>
pub async fn read_resource( &self, response_id: String, params: ReadResourceRequestParams, ) -> Result<JsonRpcResult<ReadResourceResult>, HttpError>
Run the proxy’s resources/read for response_id over this WS
(routes by URI prefix). See Self::list_tools for the error
contract.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Notifier
impl !UnwindSafe for Notifier
impl Freeze for Notifier
impl Send for Notifier
impl Sync for Notifier
impl Unpin for Notifier
impl UnsafeUnpin for Notifier
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more