pub struct ToolsConfig {Show 16 fields
pub profile: ToolProfile,
pub default_policy: ToolPolicy,
pub policies: IndexMap<String, ToolPolicy>,
pub max_tool_loops: usize,
pub max_repeated_tool_calls: usize,
pub max_consecutive_blocked_tool_calls_per_turn: usize,
pub max_total_blocked_tool_calls_per_turn: Option<usize>,
pub blocked_tool_thresholds: IndexMap<String, usize>,
pub max_tool_rate_per_second: Option<usize>,
pub max_sequential_spool_chunk_reads: usize,
pub web_fetch: WebFetchConfig,
pub web_search: WebSearchConfig,
pub plugins: PluginRuntimeConfig,
pub editor: EditorToolConfig,
pub loop_thresholds: IndexMap<String, usize>,
pub client_tool_search: bool,
}Expand description
Tools configuration
Fields§
§profile: ToolProfileModel-facing tool profile.
default_policy: ToolPolicyDefault policy for tools not explicitly listed
policies: IndexMap<String, ToolPolicy>Specific tool policies
max_tool_loops: usizeMaximum inner tool-call loops per user turn. Set to 0 to disable the limit.
Prevents infinite tool-calling cycles in interactive chat. This limits how many back-and-forths the agent will perform executing tools and re-asking the model before returning a final answer.
max_repeated_tool_calls: usizeMaximum number of times the same tool invocation can be retried with the identical arguments within a single turn.
max_consecutive_blocked_tool_calls_per_turn: usizeMaximum consecutive blocked tool calls allowed per turn before forcing a
turn break. The total fuse is 2x this value in normal mode, 4x in Plan
Mode, and this value in recovery mode, unless overridden by
max_total_blocked_tool_calls_per_turn.
max_total_blocked_tool_calls_per_turn: Option<usize>Optional explicit cap for total blocked tool calls per turn. When unset, the runtime derives it from the consecutive cap (2x normal, 4x plan, 1x recovery) so existing configs keep their behavior.
blocked_tool_thresholds: IndexMap<String, usize>Per-tool consecutive blocked-call cap overrides keyed by tool name.
Allows read-only tools (e.g. code_search) to tolerate more denies
than mutating tools (e.g. exec_command) before tripping the fuse.
max_tool_rate_per_second: Option<usize>Optional per-second rate limit for tool calls to smooth bursty retries. When unset, the runtime defaults apply.
max_sequential_spool_chunk_reads: usizeMaximum sequential spool-chunk read_file calls allowed per turn before
nudging the agent to switch to targeted extraction/summarization.
web_fetch: WebFetchConfigWeb Fetch tool security configuration
web_search: WebSearchConfigWeb Search tool configuration (provider selection, result caps, timeouts).
plugins: PluginRuntimeConfigDynamic plugin runtime configuration
editor: EditorToolConfigExternal editor integration settings used by /edit and keyboard shortcuts
loop_thresholds: IndexMap<String, usize>Tool-specific loop thresholds (Adaptive Loop Detection) Allows setting higher loop limits for read-only tools (e.g., ls, grep) and lower limits for mutating tools.
client_tool_search: boolEnables client-local deferred tool loading for providers without a
hosted tool search (e.g. Gemini). When enabled, tools flagged
defer_loading: true are omitted from the request payload instead
of being sent eagerly, and a compact summary of what is discoverable
is appended to the system prompt; the model loads them via the
local MCP discovery tools. Enabled by default because
eager MCP schemas are the dominant source of token inflation.
Implementations§
Source§impl ToolsConfig
impl ToolsConfig
pub fn tool_call_delay(&self) -> Option<Duration>
Trait Implementations§
Source§impl Clone for ToolsConfig
impl Clone for ToolsConfig
Source§impl Debug for ToolsConfig
impl Debug for ToolsConfig
Source§impl Default for ToolsConfig
impl Default for 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