Struct ToolSearchTool
pub struct ToolSearchTool { /* private fields */ }Expand description
Fetches full schemas for admitted deferred built-ins and MCP tools.
Implementations§
Source§impl ToolSearchTool
impl ToolSearchTool
Sourcepub const NAME: &'static str = "tool_search"
pub const NAME: &'static str = "tool_search"
The native creator’s callable name; ownership is claimed on creation.
pub fn new( deferred: DeferredMcpToolSet, activated: Arc<Mutex<ActivatedToolSet>>, ) -> ToolSearchTool
Sourcepub fn for_builtin_schemas(
activated: Arc<Mutex<ActivatedToolSet>>,
) -> ToolSearchTool
pub fn for_builtin_schemas( activated: Arc<Mutex<ActivatedToolSet>>, ) -> ToolSearchTool
Built-in schema discovery requires no MCP registry or executable wrapper.
pub fn with_access_policy(self, policy: ToolAccessPolicy) -> ToolSearchTool
pub fn with_activation_hook( self, hook: Arc<dyn Fn(Arc<dyn Tool>) + Send + Sync>, ) -> ToolSearchTool
Sourcepub fn narrow_to_caller(&self, allowed: &[String])
pub fn narrow_to_caller(&self, allowed: &[String])
Remove revoked schemas and activated tools together. Recovering a poisoned guard is safe here because every surviving entry is checked against the current ceiling before execution can resume.
Sourcepub fn deferred_prompt_section(&self) -> String
pub fn deferred_prompt_section(&self) -> String
Advertise only still-loadable, not-yet-activated tools, from the same registry used by both keyword search and exact selection.
Trait Implementations§
Source§impl Attributable for ToolSearchTool
impl Attributable for ToolSearchTool
fn role(&self) -> Role
fn alias(&self) -> &str
Source§fn tool_provenance(&self) -> ToolProvenance
fn tool_provenance(&self) -> ToolProvenance
Classifies whether a tool implementation is first-party native code or
an extension. The conservative default prevents a new wrapper from
inheriting native presentation privileges accidentally.
Source§impl Tool for ToolSearchTool
impl Tool for ToolSearchTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description
Source§fn parameters_schema(&self) -> Value
fn parameters_schema(&self) -> Value
JSON schema for parameters
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ToolSearchTool: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
ToolSearchTool: 'async_trait,
Execute the tool with given arguments
Source§fn requires_unrestricted_principal(&self) -> bool
fn requires_unrestricted_principal(&self) -> bool
True when this tool starts nested execution without carrying the RPC
principal’s current tool and agent ceilings. Constrained RPC sessions
must omit it. Wrappers forward the target’s value so a renamed skill
cannot bypass that restriction. This describes implementation support,
not a stored authorization decision.
Source§fn output_schema(&self) -> Option<Value>
fn output_schema(&self) -> Option<Value>
JSON schema describing the structured output this tool attaches to
ToolOutput::data, when it declares one. None means the tool
emits display text only; authoring surfaces fall back to
sample-derived shapes from captured runs.Source§fn param_domains(&self) -> Vec<(&'static str, OptionDomain)>
fn param_domains(&self) -> Vec<(&'static str, OptionDomain)>
Option domains for parameters whose value sets live in runtime
config rather than the static schema (channel refs, peer targets,
…). Surfaces resolve these through the runtime to render real
selectable choices. Default: no domain-typed parameters.
Source§fn invocation_triggers(&self) -> Vec<String>
fn invocation_triggers(&self) -> Vec<String>
Lowercase phrases that suggest an inbound message wants this tool —
e.g. routing wording or configured destination names for a delivery
tool. A pre-turn prefilter may scan the message against these and
nudge the model to consider the tool; the tool itself is never called
by the prefilter. Read more
Source§fn execute_with_context<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
context: &'life1 ToolExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn execute_with_context<'life0, 'life1, 'async_trait>(
&'life0 self,
args: Value,
context: &'life1 ToolExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Execute with turn-scoped cancellation while preserving legacy tools.
Tools that start child work can override this method to pass the
context or a child token explicitly, and use
ToolExecutionContext::run
to scope and cancel their execution future.Source§fn spec(&self) -> ToolSpec
fn spec(&self) -> ToolSpec
Assemble this tool’s spec. The default recomposes it from
parameters_schema() and allocates a fresh Arc per call, so tools
with large stored schemas override it to hand out Arc::clone
instead (see McpToolWrapper). Delegating wrappers around a
dyn Tool MUST forward spec() to the inner tool — relying on this
default silently reintroduces a per-iteration deep clone of the
inner schema and breaks Arc identity for downstream sharing.Auto Trait Implementations§
impl !Freeze for ToolSearchTool
impl !RefUnwindSafe for ToolSearchTool
impl !UnwindSafe for ToolSearchTool
impl Send for ToolSearchTool
impl Sync for ToolSearchTool
impl Unpin for ToolSearchTool
impl UnsafeUnpin for ToolSearchTool
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
Mutably borrows from an owned value. Read more
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> ⓘ
Converts
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> ⓘ
Converts
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