pub struct SamplingCapabilities {
pub context: Option<HashMap<String, Value>>,
pub tools: Option<HashMap<String, Value>>,
pub extra: HashMap<String, Value>,
}Deprecated per SEP-2577 (2026-07-28). Replacement: integrate directly with LLM provider APIs. Earliest removal: first release on/after 2027-07-28.
http and protocol-2026-07-28 only.Expand description
Capabilities related to sampling support.
2026-07-28 adds two named sub-capabilities:
contextโ client supportsincludeContextparameter (soft-deprecated)toolsโ client supportstoolsandtoolChoiceparameters
Presence of the parent sampling field indicates baseline sampling support;
presence of a sub-field declares the specific sub-capability. Empty {} is valid.
Deprecated per SEP-2577 alongside the Sampling feature.
Fieldsยง
ยงcontext: Option<HashMap<String, Value>>Deprecated per SEP-2577 (2026-07-28). Replacement: integrate directly with LLM provider APIs. Earliest removal: first release on/after 2027-07-28.
Whether the client supports context inclusion via includeContext.
Server MAY use includeContext: "thisServer"/"allServers" only if this
is declared.
tools: Option<HashMap<String, Value>>Deprecated per SEP-2577 (2026-07-28). Replacement: integrate directly with LLM provider APIs. Earliest removal: first release on/after 2027-07-28.
Whether the client supports tool use in sampling.
Server MUST get an error if it sends tools/toolChoice without this
declared.
extra: HashMap<String, Value>Deprecated per SEP-2577 (2026-07-28). Replacement: integrate directly with LLM provider APIs. Earliest removal: first release on/after 2027-07-28.
Additional forward-compatible capability data.
Trait Implementationsยง
Sourceยงimpl Clone for SamplingCapabilities
impl Clone for SamplingCapabilities
Sourceยงfn clone(&self) -> SamplingCapabilities
fn clone(&self) -> SamplingCapabilities
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 SamplingCapabilities
impl Debug for SamplingCapabilities
Sourceยงimpl Default for SamplingCapabilities
impl Default for SamplingCapabilities
Sourceยงfn default() -> SamplingCapabilities
fn default() -> SamplingCapabilities
Sourceยงimpl<'de> Deserialize<'de> for SamplingCapabilities
impl<'de> Deserialize<'de> for SamplingCapabilities
Sourceยงfn deserialize<__D>(
__deserializer: __D,
) -> Result<SamplingCapabilities, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SamplingCapabilities, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Sourceยงimpl Serialize for SamplingCapabilities
impl Serialize for SamplingCapabilities
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 Forget for SamplingCapabilities
impl Freeze for SamplingCapabilities
impl Move for SamplingCapabilities
impl RefUnwindSafe for SamplingCapabilities
impl Send for SamplingCapabilities
impl Sync for SamplingCapabilities
impl Unpin for SamplingCapabilities
impl UnsafeUnpin for SamplingCapabilities
impl UnwindSafe for SamplingCapabilities
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more