pub struct CreateElicitationRequestParams {
pub meta: Option<Meta>,
pub message: String,
pub requested_schema: ElicitationSchema,
}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
use rmcp::model::*;
let params = CreateElicitationRequestParams {
meta: None,
message: "Please provide your email".to_string(),
requested_schema: ElicitationSchema::builder()
.required_email("email")
.build()
.unwrap(),
};Fields§
§meta: Option<Meta>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.
Trait Implementations§
Source§impl Clone for CreateElicitationRequestParams
impl Clone for CreateElicitationRequestParams
Source§fn clone(&self) -> CreateElicitationRequestParams
fn clone(&self) -> CreateElicitationRequestParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de> Deserialize<'de> for CreateElicitationRequestParams
impl<'de> Deserialize<'de> for CreateElicitationRequestParams
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for CreateElicitationRequestParams
impl JsonSchema for CreateElicitationRequestParams
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for CreateElicitationRequestParams
impl PartialEq for CreateElicitationRequestParams
Source§fn eq(&self, other: &CreateElicitationRequestParams) -> bool
fn eq(&self, other: &CreateElicitationRequestParams) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl RequestParamsMeta for CreateElicitationRequestParams
impl RequestParamsMeta for CreateElicitationRequestParams
Source§fn progress_token(&self) -> Option<ProgressToken>
fn progress_token(&self) -> Option<ProgressToken>
Get the progress token from meta, if present
Source§fn set_progress_token(&mut self, token: ProgressToken)
fn set_progress_token(&mut self, token: ProgressToken)
Set a progress token in meta
impl StructuralPartialEq for CreateElicitationRequestParams
Auto Trait Implementations§
impl Freeze for CreateElicitationRequestParams
impl RefUnwindSafe for CreateElicitationRequestParams
impl Send for CreateElicitationRequestParams
impl Sync for CreateElicitationRequestParams
impl Unpin for CreateElicitationRequestParams
impl UnwindSafe for CreateElicitationRequestParams
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
Mutably borrows from an owned value. Read more