Skip to main content

ExternalToolConfig

Struct ExternalToolConfig 

Source
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: bool

Allow server-initiated model sampling. This is opt-in because it spends the configured provider’s model budget.

§elicitation: bool

Allow server-initiated elicitation. A product surface must also install an interactive handler; otherwise connection fails closed.

§subscriptions: bool

Open the MCP 2026-07-28 subscriptions/listen stream for advertised list-change notifications and the resource URIs below.

§resource_subscriptions: Vec<String>§tasks: bool

Advertise and drive the official tasks extension for long-running calls.

§max_task_wait_ms: u64

Overall deadline for one asynchronous MCP task, across every poll and input-required round. Individual requests still use timeout_ms.

§max_sampling_tokens: u32

Local upper bound on a server sampling request.

§tools: BTreeMap<String, ExternalToolPolicy>

Implementations§

Trait Implementations§

Source§

impl Clone for ExternalToolConfig

Source§

fn clone(&self) -> ExternalToolConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ExternalToolConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ExternalToolConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ExternalToolConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ExternalToolConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,