pub struct ExternalToolConfig {Show 19 fields
pub id: String,
pub transport: ExternalToolTransport,
pub command: Vec<String>,
pub url: Option<String>,
pub env_from_env: BTreeMap<String, String>,
pub headers_from_env: BTreeMap<String, String>,
pub timeout_ms: u64,
pub max_result_bytes: usize,
pub max_stderr_bytes: usize,
pub modes: Vec<ExternalToolMode>,
pub roots: Vec<McpRootConfig>,
pub sampling: bool,
pub elicitation: bool,
pub subscriptions: bool,
pub resource_subscriptions: Vec<String>,
pub tasks: bool,
pub max_task_wait_ms: u64,
pub max_sampling_tokens: u32,
pub tools: BTreeMap<String, ExternalToolPolicy>,
}Expand description
One [[external_tools]] server. Secret values are never stored here:
environment maps contain destination/header names and source variable names.
Fields§
§id: String§transport: ExternalToolTransport§command: Vec<String>Direct argv. Element zero is the program; no shell parsing occurs.
url: Option<String>§env_from_env: BTreeMap<String, String>Child variable -> source environment variable, for stdio servers.
headers_from_env: BTreeMap<String, String>HTTP header -> source environment variable.
timeout_ms: u64§max_result_bytes: usize§max_stderr_bytes: usize§modes: Vec<ExternalToolMode>§roots: Vec<McpRootConfig>Explicit roots returned to server-initiated roots/list requests.
An empty list means that the roots capability is not advertised.
sampling: boolAllow server-initiated model sampling. This is opt-in because it spends the configured provider’s model budget.
elicitation: boolAllow server-initiated elicitation. A product surface must also install an interactive handler; otherwise connection fails closed.
subscriptions: boolOpen the MCP 2026-07-28 subscriptions/listen stream for advertised
list-change notifications and the resource URIs below.
resource_subscriptions: Vec<String>§tasks: boolAdvertise and drive the official tasks extension for long-running calls.
max_task_wait_ms: u64Overall deadline for one asynchronous MCP task, across every poll and
input-required round. Individual requests still use timeout_ms.
max_sampling_tokens: u32Local upper bound on a server sampling request.
tools: BTreeMap<String, ExternalToolPolicy>Implementations§
Source§impl ExternalToolConfig
impl ExternalToolConfig
pub fn supports(&self, mode: ExternalToolMode) -> bool
Trait Implementations§
Source§impl Clone for ExternalToolConfig
impl Clone for ExternalToolConfig
Source§fn clone(&self) -> ExternalToolConfig
fn clone(&self) -> ExternalToolConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ExternalToolConfig
impl Debug for ExternalToolConfig
Source§impl Default for ExternalToolConfig
impl Default for ExternalToolConfig
Source§impl<'de> Deserialize<'de> for ExternalToolConfigwhere
ExternalToolConfig: Default,
impl<'de> Deserialize<'de> for ExternalToolConfigwhere
ExternalToolConfig: Default,
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>,
Auto Trait Implementations§
impl Freeze for ExternalToolConfig
impl RefUnwindSafe for ExternalToolConfig
impl Send for ExternalToolConfig
impl Sync for ExternalToolConfig
impl Unpin for ExternalToolConfig
impl UnsafeUnpin for ExternalToolConfig
impl UnwindSafe for ExternalToolConfig
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.