Skip to content

Commit 4c5b319

Browse files
committed
feat!: remove URLElicitationRequiredError (SEP-2322)
1 parent 3c39484 commit 4c5b319

8 files changed

Lines changed: 4 additions & 263 deletions

File tree

crates/rmcp/src/handler/client.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ impl<H: ClientHandler> Service<RoleClient> for H {
6666
ServerNotification::PromptListChangedNotification(_notification_no_param) => {
6767
self.on_prompt_list_changed(context).await
6868
}
69-
ServerNotification::ElicitationCompleteNotification(notification) =>
70-
{
71-
#[allow(deprecated)]
72-
self.on_url_elicitation_notification_complete(notification.params, context)
73-
.await
74-
}
7569
ServerNotification::TaskStatusNotification(notification) => {
7670
self.on_task_status(notification.params, context).await
7771
}
@@ -244,17 +238,6 @@ pub trait ClientHandler: Sized + Send + Sync + 'static {
244238
std::future::ready(())
245239
}
246240

247-
#[deprecated(
248-
since = "2.0.0",
249-
note = "URL elicitation is removed by SEP-2322 (Multi Round-Trip Requests). Use InputRequiredResult-based MRTR flow instead."
250-
)]
251-
fn on_url_elicitation_notification_complete(
252-
&self,
253-
params: ElicitationResponseNotificationParam,
254-
context: NotificationContext<RoleClient>,
255-
) -> impl Future<Output = ()> + MaybeSendFuture + '_ {
256-
std::future::ready(())
257-
}
258241
fn on_task_status(
259242
&self,
260243
params: TaskStatusNotificationParam,

crates/rmcp/src/model.rs

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,6 @@ impl ErrorCode {
518518
pub const INVALID_PARAMS: Self = Self(-32602);
519519
pub const INTERNAL_ERROR: Self = Self(-32603);
520520
pub const PARSE_ERROR: Self = Self(-32700);
521-
#[deprecated(
522-
since = "2.0.0",
523-
note = "URLElicitationRequiredError is removed by SEP-2322 (Multi Round-Trip Requests). Use InputRequiredResult instead."
524-
)]
525-
pub const URL_ELICITATION_REQUIRED: Self = Self(-32042);
526521
}
527522

528523
/// Error information for JSON-RPC error responses.
@@ -578,17 +573,6 @@ impl ErrorData {
578573
pub fn internal_error(message: impl Into<Cow<'static, str>>, data: Option<Value>) -> Self {
579574
Self::new(ErrorCode::INTERNAL_ERROR, message, data)
580575
}
581-
#[deprecated(
582-
since = "2.0.0",
583-
note = "URLElicitationRequiredError is removed by SEP-2322 (Multi Round-Trip Requests). Use InputRequiredResult instead."
584-
)]
585-
#[allow(deprecated)]
586-
pub fn url_elicitation_required(
587-
message: impl Into<Cow<'static, str>>,
588-
data: Option<Value>,
589-
) -> Self {
590-
Self::new(ErrorCode::URL_ELICITATION_REQUIRED, message, data)
591-
}
592576
}
593577

594578
/// Represents any JSON-RPC message that can be sent or received.
@@ -2783,7 +2767,6 @@ pub type RootsListChangedNotification = NotificationNoParam<RootsListChangedNoti
27832767
// Elicitation allows servers to request interactive input from users during tool execution.
27842768
const_string!(ElicitationCreateRequestMethod = "elicitation/create");
27852769
const_string!(ElicitationResponseNotificationMethod = "notifications/elicitation/response");
2786-
const_string!(ElicitationCompletionNotificationMethod = "notifications/elicitation/complete");
27872770

27882771
/// Represents the possible actions a user can take in response to an elicitation request.
27892772
///
@@ -3018,34 +3001,6 @@ pub type ElicitRequest = Request<ElicitationCreateRequestMethod, ElicitRequestPa
30183001
#[deprecated(since = "2.0.0", note = "Renamed to ElicitRequest")]
30193002
pub type CreateElicitationRequest = ElicitRequest;
30203003

3021-
/// Notification parameters for an url elicitation completion notification.
3022-
#[derive(Default, Debug, Serialize, Deserialize, Clone, PartialEq)]
3023-
#[serde(rename_all = "camelCase")]
3024-
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
3025-
#[non_exhaustive]
3026-
pub struct ElicitationResponseNotificationParam {
3027-
pub elicitation_id: String,
3028-
#[serde(rename = "_meta", skip_serializing_if = "Option::is_none")]
3029-
pub meta: Option<Meta>,
3030-
}
3031-
3032-
impl ElicitationResponseNotificationParam {
3033-
/// Create a new ElicitationResponseNotificationParam.
3034-
pub fn new(elicitation_id: impl Into<String>) -> Self {
3035-
Self {
3036-
elicitation_id: elicitation_id.into(),
3037-
meta: None,
3038-
}
3039-
}
3040-
}
3041-
3042-
/// Notification sent when an url elicitation process is completed.
3043-
pub type ElicitationCompleteNotification =
3044-
Notification<ElicitationCompletionNotificationMethod, ElicitationResponseNotificationParam>;
3045-
3046-
#[deprecated(since = "2.0.0", note = "Renamed to ElicitationCompleteNotification")]
3047-
pub type ElicitationCompletionNotification = ElicitationCompleteNotification;
3048-
30493004
// =============================================================================
30503005
// TOOL EXECUTION RESULTS
30513006
// =============================================================================
@@ -3828,7 +3783,6 @@ ts_union!(
38283783
| ResourceListChangedNotification
38293784
| ToolListChangedNotification
38303785
| PromptListChangedNotification
3831-
| ElicitationCompleteNotification
38323786
| TaskStatusNotification
38333787
| CustomNotification;
38343788
);

crates/rmcp/src/model/meta.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ variant_extension! {
218218
ResourceListChangedNotification
219219
ToolListChangedNotification
220220
PromptListChangedNotification
221-
ElicitationCompleteNotification
222221
TaskStatusNotification
223222
CustomNotification
224223
}

crates/rmcp/src/service/server.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ use url::Url;
1010

1111
use super::*;
1212
#[cfg(feature = "elicitation")]
13-
use crate::model::{
14-
ElicitRequest, ElicitRequestParams, ElicitResult, ElicitationAction,
15-
ElicitationCompleteNotification, ElicitationResponseNotificationParam,
16-
};
13+
use crate::model::{ElicitRequest, ElicitRequestParams, ElicitResult, ElicitationAction};
1714
use crate::{
1815
model::{
1916
CancelledNotification, CancelledNotificationParam, ClientInfo, ClientJsonRpcMessage,
@@ -474,14 +471,6 @@ impl Peer<RoleServer> {
474471
method!(peer_req create_elicitation ElicitRequest(ElicitRequestParams) => ElicitResult);
475472
#[cfg(feature = "elicitation")]
476473
method!(peer_req_with_timeout create_elicitation_with_timeout ElicitRequest(ElicitRequestParams) => ElicitResult);
477-
#[cfg(feature = "elicitation")]
478-
method!(
479-
#[deprecated(
480-
since = "2.0.0",
481-
note = "URL elicitation is removed by SEP-2322 (Multi Round-Trip Requests). Use InputRequiredResult-based MRTR flow instead."
482-
)]
483-
peer_not notify_url_elicitation_completed ElicitationCompleteNotification(ElicitationResponseNotificationParam)
484-
);
485474

486475
method!(peer_not notify_cancelled CancelledNotification(CancelledNotificationParam));
487476
method!(peer_not notify_progress ProgressNotification(ProgressNotificationParam));

crates/rmcp/tests/test_elicitation.rs

Lines changed: 0 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,31 +1882,6 @@ async fn test_url_elicitation_json_rpc_protocol() {
18821882
}
18831883
}
18841884

1885-
/// Test ElicitationCompleteNotification serialization/deserialization
1886-
#[tokio::test]
1887-
async fn test_elicitation_completion_notification() {
1888-
let notification_params = ElicitationResponseNotificationParam::new("elicit-789");
1889-
1890-
// Test serialization
1891-
let json = serde_json::to_value(&notification_params).unwrap();
1892-
let expected = json!({
1893-
"elicitationId": "elicit-789"
1894-
});
1895-
assert_eq!(json, expected);
1896-
1897-
// Test deserialization
1898-
let deserialized: ElicitationResponseNotificationParam =
1899-
serde_json::from_value(expected).unwrap();
1900-
assert_eq!(deserialized.elicitation_id, "elicit-789");
1901-
1902-
// Test complete notification structure
1903-
let notification = ElicitationCompleteNotification::new(notification_params);
1904-
1905-
let json = serde_json::to_value(&notification).unwrap();
1906-
assert_eq!(json["method"], "notifications/elicitation/complete");
1907-
assert_eq!(json["params"]["elicitationId"], "elicit-789");
1908-
}
1909-
19101885
/// Test UrlElicitationCapability structure and serialization
19111886
#[tokio::test]
19121887
async fn test_url_elicitation_capability() {
@@ -2020,40 +1995,6 @@ async fn test_elicitation_both_modes() {
20201995
assert!(url_json.get("requestedSchema").is_none());
20211996
}
20221997

2023-
/// Test URL_ELICITATION_REQUIRED error code
2024-
#[tokio::test]
2025-
#[allow(deprecated)]
2026-
async fn test_url_elicitation_required_error_code() {
2027-
// Test the error code constant
2028-
assert_eq!(ErrorCode::URL_ELICITATION_REQUIRED.0, -32042);
2029-
2030-
// Test creating error data with URL_ELICITATION_REQUIRED
2031-
let error_data = ErrorData::url_elicitation_required(
2032-
"URL elicitation is required for this operation",
2033-
Some(json!({
2034-
"url": "https://example.com/complete",
2035-
"elicitationId": "elicit-999"
2036-
})),
2037-
);
2038-
2039-
assert_eq!(error_data.code, ErrorCode::URL_ELICITATION_REQUIRED);
2040-
assert_eq!(
2041-
error_data.message,
2042-
"URL elicitation is required for this operation"
2043-
);
2044-
assert!(error_data.data.is_some());
2045-
2046-
// Test serialization
2047-
let json = serde_json::to_value(&error_data).unwrap();
2048-
assert_eq!(json["code"], -32042);
2049-
assert_eq!(
2050-
json["message"],
2051-
"URL elicitation is required for this operation"
2052-
);
2053-
assert_eq!(json["data"]["url"], "https://example.com/complete");
2054-
assert_eq!(json["data"]["elicitationId"], "elicit-999");
2055-
}
2056-
20571998
/// Test ClientCapabilities with different elicitation mode combinations
20581999
#[tokio::test]
20592000
async fn test_client_capabilities_elicitation_modes() {
@@ -2103,32 +2044,6 @@ async fn test_client_capabilities_elicitation_modes() {
21032044
assert!(json["elicitation"]["url"].is_object());
21042045
}
21052046

2106-
/// Test ElicitationCompleteNotification in ServerNotification enum
2107-
#[tokio::test]
2108-
async fn test_elicitation_completion_in_server_notification() {
2109-
let notification_param = ElicitationResponseNotificationParam::new("notify-123");
2110-
2111-
let completion_notification = ElicitationCompleteNotification::new(notification_param.clone());
2112-
2113-
// Test that it's part of ServerNotification
2114-
let server_notification =
2115-
ServerNotification::ElicitationCompleteNotification(completion_notification);
2116-
2117-
// Test serialization
2118-
let json = serde_json::to_value(&server_notification).unwrap();
2119-
assert_eq!(json["method"], "notifications/elicitation/complete");
2120-
assert_eq!(json["params"]["elicitationId"], "notify-123");
2121-
2122-
// Test deserialization
2123-
let deserialized: ServerNotification = serde_json::from_value(json).unwrap();
2124-
match deserialized {
2125-
ServerNotification::ElicitationCompleteNotification(notif) => {
2126-
assert_eq!(notif.params.elicitation_id, "notify-123");
2127-
}
2128-
_ => panic!("Expected ElicitationCompleteNotification variant"),
2129-
}
2130-
}
2131-
21322047
/// Test ElicitationAction with URL elicitation workflow
21332048
#[tokio::test]
21342049
async fn test_url_elicitation_action_workflow() {
@@ -2162,10 +2077,4 @@ async fn test_elicitation_method_constants() {
21622077
ElicitationResponseNotificationMethod::VALUE,
21632078
"notifications/elicitation/response"
21642079
);
2165-
2166-
// Test new completion notification method
2167-
assert_eq!(
2168-
ElicitationCompletionNotificationMethod::VALUE,
2169-
"notifications/elicitation/complete"
2170-
);
21712080
}

crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema.json

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -770,35 +770,11 @@
770770
}
771771
]
772772
},
773-
"ElicitationCompletionNotificationMethod": {
774-
"type": "string",
775-
"format": "const",
776-
"const": "notifications/elicitation/complete"
777-
},
778773
"ElicitationCreateRequestMethod": {
779774
"type": "string",
780775
"format": "const",
781776
"const": "elicitation/create"
782777
},
783-
"ElicitationResponseNotificationParam": {
784-
"description": "Notification parameters for an url elicitation completion notification.",
785-
"type": "object",
786-
"properties": {
787-
"_meta": {
788-
"type": [
789-
"object",
790-
"null"
791-
],
792-
"additionalProperties": true
793-
},
794-
"elicitationId": {
795-
"type": "string"
796-
}
797-
},
798-
"required": [
799-
"elicitationId"
800-
]
801-
},
802778
"ElicitationSchema": {
803779
"description": "Type-safe elicitation schema for requesting structured user input.\n\nThis enforces the MCP 2025-06-18 specification that elicitation schemas\nmust be objects with primitive-typed properties.\n\n# Example\n\n```rust\nuse rmcp::model::*;\n\nlet schema = ElicitationSchema::builder()\n .required_email(\"email\")\n .required_integer(\"age\", 0, 150)\n .optional_bool(\"newsletter\", false)\n .build();\n```",
804780
"type": "object",
@@ -1420,9 +1396,6 @@
14201396
{
14211397
"$ref": "#/definitions/Notification5"
14221398
},
1423-
{
1424-
"$ref": "#/definitions/Notification6"
1425-
},
14261399
{
14271400
"$ref": "#/definitions/CustomNotification"
14281401
}
@@ -1892,21 +1865,6 @@
18921865
]
18931866
},
18941867
"Notification5": {
1895-
"type": "object",
1896-
"properties": {
1897-
"method": {
1898-
"$ref": "#/definitions/ElicitationCompletionNotificationMethod"
1899-
},
1900-
"params": {
1901-
"$ref": "#/definitions/ElicitationResponseNotificationParam"
1902-
}
1903-
},
1904-
"required": [
1905-
"method",
1906-
"params"
1907-
]
1908-
},
1909-
"Notification6": {
19101868
"type": "object",
19111869
"properties": {
19121870
"method": {

crates/rmcp/tests/test_message_schema/server_json_rpc_message_schema_current.json

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -770,35 +770,11 @@
770770
}
771771
]
772772
},
773-
"ElicitationCompletionNotificationMethod": {
774-
"type": "string",
775-
"format": "const",
776-
"const": "notifications/elicitation/complete"
777-
},
778773
"ElicitationCreateRequestMethod": {
779774
"type": "string",
780775
"format": "const",
781776
"const": "elicitation/create"
782777
},
783-
"ElicitationResponseNotificationParam": {
784-
"description": "Notification parameters for an url elicitation completion notification.",
785-
"type": "object",
786-
"properties": {
787-
"_meta": {
788-
"type": [
789-
"object",
790-
"null"
791-
],
792-
"additionalProperties": true
793-
},
794-
"elicitationId": {
795-
"type": "string"
796-
}
797-
},
798-
"required": [
799-
"elicitationId"
800-
]
801-
},
802778
"ElicitationSchema": {
803779
"description": "Type-safe elicitation schema for requesting structured user input.\n\nThis enforces the MCP 2025-06-18 specification that elicitation schemas\nmust be objects with primitive-typed properties.\n\n# Example\n\n```rust\nuse rmcp::model::*;\n\nlet schema = ElicitationSchema::builder()\n .required_email(\"email\")\n .required_integer(\"age\", 0, 150)\n .optional_bool(\"newsletter\", false)\n .build();\n```",
804780
"type": "object",
@@ -1420,9 +1396,6 @@
14201396
{
14211397
"$ref": "#/definitions/Notification5"
14221398
},
1423-
{
1424-
"$ref": "#/definitions/Notification6"
1425-
},
14261399
{
14271400
"$ref": "#/definitions/CustomNotification"
14281401
}
@@ -1892,21 +1865,6 @@
18921865
]
18931866
},
18941867
"Notification5": {
1895-
"type": "object",
1896-
"properties": {
1897-
"method": {
1898-
"$ref": "#/definitions/ElicitationCompletionNotificationMethod"
1899-
},
1900-
"params": {
1901-
"$ref": "#/definitions/ElicitationResponseNotificationParam"
1902-
}
1903-
},
1904-
"required": [
1905-
"method",
1906-
"params"
1907-
]
1908-
},
1909-
"Notification6": {
19101868
"type": "object",
19111869
"properties": {
19121870
"method": {

0 commit comments

Comments
 (0)