Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rust/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3838,6 +3838,7 @@ async fn handle_notification(
_ => crate::types::ElicitationMode::Unknown,
}),
elicitation_source: elicitation_data.elicitation_source,
tool_call_id: elicitation_data.tool_call_id,
url: elicitation_data.url,
};
let client = client.clone();
Expand Down
3 changes: 3 additions & 0 deletions rust/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6936,6 +6936,9 @@ pub struct ElicitationRequest {
/// The source that initiated the request (e.g. MCP server name).
#[serde(skip_serializing_if = "Option::is_none")]
pub elicitation_source: Option<String>,
/// Tool call ID used to correlate this request with the invocation that raised it.
#[serde(skip_serializing_if = "Option::is_none")]
pub tool_call_id: Option<String>,
/// URL to open in the user's browser (url mode only).
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
Expand Down
2 changes: 2 additions & 0 deletions rust/tests/session_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5614,6 +5614,7 @@ async fn elicitation_requested_dispatches_to_handler_and_responds() {
request: ElicitationRequest,
) -> ElicitationResult {
assert_eq!(request.message, "Enter your name");
assert_eq!(request.tool_call_id.as_deref(), Some("tool-call-1"));
ElicitationResult {
action: "accept".to_string(),
content: Some(serde_json::json!({ "name": "Alice" })),
Expand All @@ -5632,6 +5633,7 @@ async fn elicitation_requested_dispatches_to_handler_and_responds() {
"elicitation.requested",
serde_json::json!({
"requestId": "elicit-1",
"toolCallId": "tool-call-1",
"message": "Enter your name",
"requestedSchema": {
"type": "object",
Expand Down