pub struct DeferredMcpToolSet {
pub stubs: Vec<DeferredMcpToolStub>,
pub registry: Arc<McpRegistry>,
}Expand description
Collection of all deferred MCP tool stubs discovered at startup.
Provides keyword search for tool_search.
Fields§
§stubs: Vec<DeferredMcpToolStub>All stubs — exposed for test construction.
registry: Arc<McpRegistry>Shared registry — exposed for test construction.
Implementations§
Source§impl DeferredMcpToolSet
impl DeferredMcpToolSet
Sourcepub async fn from_registry(registry: Arc<McpRegistry>) -> Self
pub async fn from_registry(registry: Arc<McpRegistry>) -> Self
Build the set from a connected McpRegistry.
Sourcepub async fn from_registry_filtered<F>(
registry: Arc<McpRegistry>,
filter: F,
) -> Self
pub async fn from_registry_filtered<F>( registry: Arc<McpRegistry>, filter: F, ) -> Self
Build the set from a connected McpRegistry, including only tools
whose prefixed name passes the given filter predicate.
Sourcepub fn stub_names(&self) -> Vec<&str>
pub fn stub_names(&self) -> Vec<&str>
All stub names (for rendering in the system prompt).
Sourcepub fn get_by_name(&self, name: &str) -> Option<&DeferredMcpToolStub>
pub fn get_by_name(&self, name: &str) -> Option<&DeferredMcpToolStub>
Look up stubs by exact name, falling back to unique suffix match.
Some providers (or prompt instructions) reference MCP tools without the
<server>__ prefix. When the suffix maps to exactly one stub, allow
the lookup to succeed — same pattern as ActivatedToolSet::get_resolved.
Sourcepub fn search(
&self,
query: &str,
max_results: usize,
) -> Vec<&DeferredMcpToolStub>
pub fn search( &self, query: &str, max_results: usize, ) -> Vec<&DeferredMcpToolStub>
Keyword search — returns stubs whose name or description contains any of the query terms (case-insensitive). Results are ranked by number of matching terms (descending).
Trait Implementations§
Source§impl Clone for DeferredMcpToolSet
impl Clone for DeferredMcpToolSet
Source§fn clone(&self) -> DeferredMcpToolSet
fn clone(&self) -> DeferredMcpToolSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DeferredMcpToolSet
impl !RefUnwindSafe for DeferredMcpToolSet
impl Send for DeferredMcpToolSet
impl Sync for DeferredMcpToolSet
impl Unpin for DeferredMcpToolSet
impl UnsafeUnpin for DeferredMcpToolSet
impl !UnwindSafe for DeferredMcpToolSet
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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