Struct DeferredMcpToolSet
pub struct DeferredMcpToolSet {
pub stubs: Vec<DeferredMcpToolStub>,
pub registry: Arc<McpRegistry>,
pub security: Arc<SecurityPolicy>,
}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.
security: Arc<SecurityPolicy>Security policy handle for activated wrappers (workspace at use time).
Implementations§
Source§impl DeferredMcpToolSet
impl DeferredMcpToolSet
Sourcepub async fn from_registry(
registry: Arc<McpRegistry>,
security: Arc<SecurityPolicy>,
) -> DeferredMcpToolSet
pub async fn from_registry( registry: Arc<McpRegistry>, security: Arc<SecurityPolicy>, ) -> DeferredMcpToolSet
Build the set from a connected McpRegistry.
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 filter_by_policy(
&self,
policy: Option<&ToolAccessPolicy>,
) -> DeferredMcpToolSet
pub fn filter_by_policy( &self, policy: Option<&ToolAccessPolicy>, ) -> DeferredMcpToolSet
Return a copy of this set with stubs whose prefixed_name is
not allowed by policy removed. policy == None is a no-op
(the set is returned unchanged) — this matches the
if let Some(policy) = ... pattern at every production
call site. Centralizes the per-stub filter logic so the
prompt-side claim and the ToolSearchTool constructor see
exactly the same tool set.
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. Used for select:name1,name2 queries.
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) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for DeferredMcpToolSet
impl !UnwindSafe for DeferredMcpToolSet
impl Freeze for DeferredMcpToolSet
impl Send for DeferredMcpToolSet
impl Sync for DeferredMcpToolSet
impl Unpin for DeferredMcpToolSet
impl UnsafeUnpin for DeferredMcpToolSet
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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