feat: add meta to elicitation results (#792)

This commit is contained in:
Matthew Zeng 2026-04-08 12:07:04 -07:00 • committed by GitHub
commit 5f432834a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2699,6 +2699,10 @@ pub struct CreateElicitationResult {
/// Only present when action is Accept.
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<Value>,
/// Optional protocol-level metadata for this result.
#[serde(rename = "_meta", skip_serializing_if = "Option::is_none")]
pub meta: Option<Meta>,
}
impl CreateElicitationResult {
@ -2707,6 +2711,7 @@ impl CreateElicitationResult {
Self {
action,
content: None,
meta: None,
}
}
@ -2715,6 +2720,12 @@ impl CreateElicitationResult {
self.content = Some(content);
self
}
/// Set the metadata on this result.
pub fn with_meta(mut self, meta: Meta) -> Self {
self.meta = Some(meta);
self
}
}
/// Request type for creating an elicitation to gather user input