pub struct ToolDiscoveryConfig {
pub strategy: ToolDiscoveryStrategyConfig,
pub top_k: usize,
pub min_similarity: f32,
pub embedding_provider: ProviderName,
pub always_include: Vec<String>,
pub min_tools_to_filter: usize,
pub strict: bool,
}Expand description
MCP tool discovery configuration (#2321).
Nested under [mcp.tool_discovery]. When strategy = "embedding", the
mcp.pruning section is ignored for this session — the embedding path
supersedes LLM pruning entirely.
Fields§
§strategy: ToolDiscoveryStrategyConfigDiscovery strategy. Default: none (all tools, safe default).
top_k: usizeNumber of top-scoring tools to include per turn (embedding strategy only).
min_similarity: f32Minimum cosine similarity for a tool to be included (embedding strategy only).
embedding_provider: ProviderNameProvider name from [[llm.providers]] for embedding computation.
Should reference a fast/cheap embedding model. Empty = use the agent’s
default embedding provider.
always_include: Vec<String>Tool names always included regardless of similarity score.
min_tools_to_filter: usizeMinimum tool count below which discovery is skipped (all tools passed through).
strict: boolWhen true, treat any embedding failure as a hard error instead of silently
falling back to all tools. Default: false (soft fallback).
Trait Implementations§
Source§impl Clone for ToolDiscoveryConfig
impl Clone for ToolDiscoveryConfig
Source§fn clone(&self) -> ToolDiscoveryConfig
fn clone(&self) -> ToolDiscoveryConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolDiscoveryConfig
impl Debug for ToolDiscoveryConfig
Source§impl Default for ToolDiscoveryConfig
impl Default for ToolDiscoveryConfig
Source§fn default() -> ToolDiscoveryConfig
fn default() -> ToolDiscoveryConfig
Source§impl<'de> Deserialize<'de> for ToolDiscoveryConfigwhere
ToolDiscoveryConfig: Default,
impl<'de> Deserialize<'de> for ToolDiscoveryConfigwhere
ToolDiscoveryConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolDiscoveryConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolDiscoveryConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for ToolDiscoveryConfig
impl Serialize for ToolDiscoveryConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for ToolDiscoveryConfig
impl RefUnwindSafe for ToolDiscoveryConfig
impl Send for ToolDiscoveryConfig
impl Sync for ToolDiscoveryConfig
impl Unpin for ToolDiscoveryConfig
impl UnsafeUnpin for ToolDiscoveryConfig
impl UnwindSafe for ToolDiscoveryConfig
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request