Struct ActivatedToolSet
pub struct ActivatedToolSet { /* private fields */ }Expand description
Per-conversation MCP activation and built-in schema selection.
Built-in specs are a metadata projection of the scoped registry. The registry remains their executable owner and refreshes this catalog when admitted tools change. Selecting a built-in schema grants no capability.
Implementations§
Source§impl ActivatedToolSet
impl ActivatedToolSet
pub fn new() -> Self
Sourcepub fn set_deferred_builtin_specs(&mut self, specs: Vec<ToolSpec>)
pub fn set_deferred_builtin_specs(&mut self, specs: Vec<ToolSpec>)
Install the initial metadata-only catalog of admitted deferred built-ins.
Sourcepub fn refresh_deferred_builtin_specs(&mut self, specs: Vec<ToolSpec>)
pub fn refresh_deferred_builtin_specs(&mut self, specs: Vec<ToolSpec>)
Refresh previously deferred names from the canonical scoped registry. New names stay eager; removed names lose their schema and selection.
Sourcepub fn deferred_builtin_prompt_section(&self) -> String
pub fn deferred_builtin_prompt_section(&self) -> String
Render the current unselected built-in catalog after registry refresh or principal narrowing, rather than retaining a startup prompt snapshot.
Sourcepub fn deferred_builtin_prompt_section_filtered(
&self,
is_allowed: impl Fn(&str) -> bool,
) -> String
pub fn deferred_builtin_prompt_section_filtered( &self, is_allowed: impl Fn(&str) -> bool, ) -> String
Render discovery for one request without narrowing shared schema metadata.
pub fn has_deferred_builtin_schemas(&self) -> bool
pub fn is_builtin_schema_exposed(&self, name: &str) -> bool
pub fn activate(&mut self, name: String, tool: Arc<dyn Tool>)
pub fn is_activated(&self, name: &str) -> bool
Sourcepub fn get(&self, name: &str) -> Option<Arc<dyn Tool>>
pub fn get(&self, name: &str) -> Option<Arc<dyn Tool>>
Clone the Arc so the caller can drop the mutex guard before awaiting.
pub fn get_resolved(&self, name: &str) -> Option<Arc<dyn Tool>>
pub fn tool_specs(&self) -> Vec<ToolSpec>
pub fn tool_names(&self) -> Vec<&str>
Sourcepub fn retain_allowed(&mut self, allowed: &[String])
pub fn retain_allowed(&mut self, allowed: &[String])
Remove MCP executables and built-in schema metadata outside a narrowed principal’s ceiling. Callers resolve policy from its canonical source; this set retains no independent policy.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ActivatedToolSet
impl !UnwindSafe for ActivatedToolSet
impl Freeze for ActivatedToolSet
impl Send for ActivatedToolSet
impl Sync for ActivatedToolSet
impl Unpin for ActivatedToolSet
impl UnsafeUnpin for ActivatedToolSet
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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