pub struct ToolsConfig {
pub builtin: Vec<String>,
pub dynamic: Vec<DynamicToolFactory>,
pub mcp: Vec<McpToolConfig>,
pub external: Option<Vec<String>>,
pub delivery_mode: ToolDeliveryMode,
pub deferred_threshold: Option<usize>,
pub always_full_schema: Vec<String>,
}Fields§
§builtin: Vec<String>Built-in tools to include (e.g., [“final”, “transfer_to_agent”])
dynamic: Vec<DynamicToolFactory>Dynamic tool factories — each creates a named tool at runtime.
mcp: Vec<McpToolConfig>MCP server tool configurations
external: Option<Vec<String>>External tools to include from client
delivery_mode: ToolDeliveryModeHow tools are delivered to the model. Defaults to Full.
When set to Deferred, only core tools get full schemas;
others appear as name+description and must be fetched via tool_search.
deferred_threshold: Option<usize>Tool count threshold for automatic deferral.
When delivery_mode is Deferred and total tools exceed this,
non-core tools are deferred. Default: 15.
always_full_schema: Vec<String>Additional tool names to always include with full schemas (beyond CORE_TOOLS). Useful for agent-specific tools that should never be deferred.
Implementations§
Source§impl ToolsConfig
impl ToolsConfig
Sourcepub fn invalid_builtin_tools(&self) -> Vec<String>
pub fn invalid_builtin_tools(&self) -> Vec<String>
Validate that all builtin tool names are recognized. Returns a list of invalid tool names, or empty if all are valid.
Sourcepub fn is_core_tool(&self, name: &str) -> bool
pub fn is_core_tool(&self, name: &str) -> bool
Whether a tool should always get a full schema (never deferred).
Sourcepub fn effective_threshold(&self) -> usize
pub fn effective_threshold(&self) -> usize
Effective threshold for automatic tool deferral.
Sourcepub fn effective_delivery_mode(&self, _total_tools: usize) -> ToolDeliveryMode
pub fn effective_delivery_mode(&self, _total_tools: usize) -> ToolDeliveryMode
Determine the effective delivery mode given the total tool count.
If mode is Full but tool count exceeds threshold, stays Full
Deferred always stays Deferred — context efficiency is the default.
Source§impl ToolsConfig
impl ToolsConfig
Trait Implementations§
Source§impl Clone for ToolsConfig
impl Clone for ToolsConfig
Source§fn clone(&self) -> ToolsConfig
fn clone(&self) -> ToolsConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ToolsConfig
impl Debug for ToolsConfig
Source§impl Default for ToolsConfig
impl Default for ToolsConfig
Source§fn default() -> ToolsConfig
fn default() -> ToolsConfig
Source§impl<'de> Deserialize<'de> for ToolsConfig
impl<'de> Deserialize<'de> for ToolsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ToolsConfig
impl JsonSchema for ToolsConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more