#[non_exhaustive]pub enum ElicitRequestParams {
FormElicitationParams {
meta: Option<RequestMetaObject>,
message: String,
requested_schema: ElicitationSchema,
},
UrlElicitationParams {
meta: Option<RequestMetaObject>,
message: String,
url: String,
elicitation_id: String,
},
}Expand description
Parameters for creating an elicitation request to gather user input.
This structure contains everything needed to request interactive input from a user:
- A human-readable message explaining what information is needed
- A type-safe schema defining the expected structure of the response
§Example
- Form-based elicitation request
use rmcp::model::*;
let params = ElicitRequestParams::FormElicitationParams {
meta: None,
message: "Please provide your email".to_string(),
requested_schema: ElicitationSchema::builder()
.required_email("email")
.build()
.unwrap(),
};- URL-based elicitation request
use rmcp::model::*;
let params = ElicitRequestParams::UrlElicitationParams {
meta: None,
message: "Please provide your feedback at the following URL".to_string(),
url: "https://example.com/feedback".to_string(),
elicitation_id: "unique-id-123".to_string(),
};Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FormElicitationParams
Fields
meta: Option<RequestMetaObject>Protocol-level metadata for this request (SEP-1319)
message: StringHuman-readable message explaining what input is needed from the user. This should be clear and provide sufficient context for the user to understand what information they need to provide.
requested_schema: ElicitationSchemaType-safe schema defining the expected structure and validation rules for the user’s response. This enforces the MCP 2025-06-18 specification that elicitation schemas must be objects with primitive-typed properties.
UrlElicitationParams
Fields
meta: Option<RequestMetaObject>Protocol-level metadata for this request (SEP-1319)
message: StringHuman-readable message explaining what input is needed from the user. This should be clear and provide sufficient context for the user to understand what information they need to provide.
Trait Implementations§
Source§impl Clone for ElicitRequestParams
impl Clone for ElicitRequestParams
Source§fn clone(&self) -> ElicitRequestParams
fn clone(&self) -> ElicitRequestParams
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 ElicitRequestParams
impl Debug for ElicitRequestParams
Source§impl<'de> Deserialize<'de> for ElicitRequestParams
impl<'de> Deserialize<'de> for ElicitRequestParams
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ElicitRequestParams, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ElicitRequestParams, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for ElicitRequestParams
impl JsonSchema for ElicitRequestParams
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 moreSource§impl PartialEq for ElicitRequestParams
impl PartialEq for ElicitRequestParams
Source§impl RequestParamsMeta for ElicitRequestParams
impl RequestParamsMeta for ElicitRequestParams
Source§fn meta(&self) -> Option<&RequestMetaObject>
fn meta(&self) -> Option<&RequestMetaObject>
Source§fn meta_mut(&mut self) -> &mut Option<RequestMetaObject>
fn meta_mut(&mut self) -> &mut Option<RequestMetaObject>
Source§fn set_meta(&mut self, meta: RequestMetaObject)
fn set_meta(&mut self, meta: RequestMetaObject)
Source§fn progress_token(&self) -> Option<ProgressToken>
fn progress_token(&self) -> Option<ProgressToken>
Source§fn set_progress_token(&mut self, token: ProgressToken)
fn set_progress_token(&mut self, token: ProgressToken)
Source§fn traceparent(&self) -> Option<&str>
fn traceparent(&self) -> Option<&str>
traceparent value from meta, if present (SEP-414)Source§fn set_traceparent(&mut self, value: &str)
fn set_traceparent(&mut self, value: &str)
traceparent value in meta (SEP-414)Source§fn tracestate(&self) -> Option<&str>
fn tracestate(&self) -> Option<&str>
tracestate value from meta, if present (SEP-414)Source§fn set_tracestate(&mut self, value: &str)
fn set_tracestate(&mut self, value: &str)
tracestate value in meta (SEP-414)Source§fn set_baggage(&mut self, value: &str)
fn set_baggage(&mut self, value: &str)
baggage value in meta (SEP-414)Source§fn meta_or_default(&mut self) -> &mut RequestMetaObject
fn meta_or_default(&mut self) -> &mut RequestMetaObject
Source§impl Serialize for ElicitRequestParams
impl Serialize for ElicitRequestParams
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,
impl StructuralPartialEq for ElicitRequestParams
Source§impl TryFrom<ElicitRequestParamsWire> for ElicitRequestParams
impl TryFrom<ElicitRequestParamsWire> for ElicitRequestParams
Auto Trait Implementations§
impl Freeze for ElicitRequestParams
impl RefUnwindSafe for ElicitRequestParams
impl Send for ElicitRequestParams
impl Sync for ElicitRequestParams
impl Unpin for ElicitRequestParams
impl UnsafeUnpin for ElicitRequestParams
impl UnwindSafe for ElicitRequestParams
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