pub struct Unadvertised<S> { /* private fields */ }Expand description
A ToolSource wrapper that dispatches tools without advertising them.
specs() is always empty and the inner source’s catalog events are
drained but not forwarded; get() delegates unchanged, so every inner
tool remains invocable by exact name.
Constructed via ToolSource::unadvertised or directly.
Implementations§
Source§impl<S> Unadvertised<S>
impl<S> Unadvertised<S>
Trait Implementations§
Source§impl<S> ToolSource for Unadvertised<S>where
S: ToolSource,
impl<S> ToolSource for Unadvertised<S>where
S: ToolSource,
Source§fn get(&self, name: &ToolName) -> Option<Arc<dyn Tool>>
fn get(&self, name: &ToolName) -> Option<Arc<dyn Tool>>
Looks up a tool by name, returning
None if not present.Source§fn drain_catalog_events(&self) -> Vec<ToolCatalogEvent>
fn drain_catalog_events(&self) -> Vec<ToolCatalogEvent>
Drains pending catalog change events. Static sources return an empty
list; dynamic sources surface added/removed/changed batches that the
loop forwards to the model on the next turn.
Source§fn prefixed(self, prefix: impl Into<String>) -> Prefixed<Self>where
Self: Sized,
fn prefixed(self, prefix: impl Into<String>) -> Prefixed<Self>where
Self: Sized,
Wraps this source so every advertised tool name is prefixed with
<prefix>_. Useful for mounting the same source under multiple
namespaces, or for avoiding collisions between MCP catalogs. Read moreSource§fn filtered<F>(self, predicate: F) -> Filtered<Self, F>
fn filtered<F>(self, predicate: F) -> Filtered<Self, F>
Wraps this source so only tools whose name passes
predicate are
advertised and resolvable. Tools rejected by the predicate are
invisible to the model and return None on lookup. Read moreSource§fn renamed<I>(self, mapping: I) -> Renamed<Self>
fn renamed<I>(self, mapping: I) -> Renamed<Self>
Wraps this source with a name remapping. Each
(original, new) pair
in mapping causes the tool to be advertised as new and resolved
from new back to original on lookup. Tools not in the mapping
pass through unchanged. Read moreSource§fn unadvertised(self) -> Unadvertised<Self>where
Self: Sized,
fn unadvertised(self) -> Unadvertised<Self>where
Self: Sized,
Wraps this source so its tools stay resolvable by name but are never
advertised:
specs() is empty and catalog events are swallowed, while
get() passes through. Use this for dispatch-only catalogs — e.g.
children of a composition tool that the model should invoke through a
script rather than see individually. Read moreAuto Trait Implementations§
impl<S> Freeze for Unadvertised<S>where
S: Freeze,
impl<S> RefUnwindSafe for Unadvertised<S>where
S: RefUnwindSafe,
impl<S> Send for Unadvertised<S>where
S: Send,
impl<S> Sync for Unadvertised<S>where
S: Sync,
impl<S> Unpin for Unadvertised<S>where
S: Unpin,
impl<S> UnsafeUnpin for Unadvertised<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Unadvertised<S>where
S: UnwindSafe,
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
Mutably borrows from an owned value. Read more