Skip to content

Commit f4ff56b

Browse files
authored
feat!: add MRTR model types (SEP-2322) (#915)
* feat!: add SEP-2322 MRTR model types * feat!: remove URLElicitationRequiredError (SEP-2322)
1 parent 5195776 commit f4ff56b

22 files changed

Lines changed: 969 additions & 255 deletions

conformance/src/bin/server.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,8 @@ impl ServerHandler for ConformanceServer {
204204
),
205205
];
206206
Ok(ListToolsResult {
207-
meta: None,
208207
tools,
209-
next_cursor: None,
208+
..Default::default()
210209
})
211210
}
212211

@@ -540,7 +539,6 @@ impl ServerHandler for ConformanceServer {
540539
_cx: RequestContext<RoleServer>,
541540
) -> Result<ListResourcesResult, ErrorData> {
542541
Ok(ListResourcesResult {
543-
meta: None,
544542
resources: vec![
545543
Resource::new("test://static-text", "Static Text Resource")
546544
.with_description("A static text resource for testing")
@@ -549,7 +547,7 @@ impl ServerHandler for ConformanceServer {
549547
.with_description("A static binary/blob resource for testing")
550548
.with_mime_type("image/png"),
551549
],
552-
next_cursor: None,
550+
..Default::default()
553551
})
554552
}
555553

@@ -609,13 +607,12 @@ impl ServerHandler for ConformanceServer {
609607
_cx: RequestContext<RoleServer>,
610608
) -> Result<ListResourceTemplatesResult, ErrorData> {
611609
Ok(ListResourceTemplatesResult {
612-
meta: None,
613610
resource_templates: vec![
614611
ResourceTemplate::new("test://template/{id}/data", "Dynamic Resource")
615612
.with_description("A dynamic resource with parameter substitution")
616613
.with_mime_type("application/json"),
617614
],
618-
next_cursor: None,
615+
..Default::default()
619616
})
620617
}
621618

@@ -645,7 +642,6 @@ impl ServerHandler for ConformanceServer {
645642
_cx: RequestContext<RoleServer>,
646643
) -> Result<ListPromptsResult, ErrorData> {
647644
Ok(ListPromptsResult {
648-
meta: None,
649645
prompts: vec![
650646
Prompt::new(
651647
"test_simple_prompt",
@@ -675,7 +671,7 @@ impl ServerHandler for ConformanceServer {
675671
None,
676672
),
677673
],
678-
next_cursor: None,
674+
..Default::default()
679675
})
680676
}
681677

crates/rmcp-macros/src/prompt_handler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub fn prompt_handler(attr: TokenStream, input: TokenStream) -> syn::Result<Toke
6161
) -> Result<rmcp::model::ListPromptsResult, rmcp::ErrorData> {
6262
let prompts = #router_expr.list_all();
6363
Ok(rmcp::model::ListPromptsResult {
64+
result_type: Default::default(),
6465
prompts,
6566
meta: #meta,
6667
next_cursor: None,

crates/rmcp-macros/src/tool_handler.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ pub fn tool_handler(attr: TokenStream, input: TokenStream) -> syn::Result<TokenS
6969
_context: rmcp::service::RequestContext<rmcp::RoleServer>,
7070
) -> Result<rmcp::model::ListToolsResult, rmcp::ErrorData> {
7171
Ok(rmcp::model::ListToolsResult{
72+
result_type: Default::default(),
7273
tools: #router.list_all(),
7374
meta: #result_meta,
7475
next_cursor: None,

crates/rmcp/src/handler/client.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +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-
self.on_url_elicitation_notification_complete(notification.params, context)
71-
.await
72-
}
7369
ServerNotification::TaskStatusNotification(notification) => {
7470
self.on_task_status(notification.params, context).await
7571
}
@@ -242,13 +238,6 @@ pub trait ClientHandler: Sized + Send + Sync + 'static {
242238
std::future::ready(())
243239
}
244240

245-
fn on_url_elicitation_notification_complete(
246-
&self,
247-
params: ElicitationResponseNotificationParam,
248-
context: NotificationContext<RoleClient>,
249-
) -> impl Future<Output = ()> + MaybeSendFuture + '_ {
250-
std::future::ready(())
251-
}
252241
fn on_task_status(
253242
&self,
254243
params: TaskStatusNotificationParam,

crates/rmcp/src/handler/server/prompt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ impl IntoGetPromptResult for GetPromptResult {
103103
impl IntoGetPromptResult for Vec<PromptMessage> {
104104
fn into_get_prompt_result(self) -> Result<GetPromptResult, crate::ErrorData> {
105105
Ok(GetPromptResult {
106+
result_type: Default::default(),
106107
description: None,
107108
messages: self,
108109
meta: None,

crates/rmcp/src/handler/server/router/tool.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,8 @@ mod tests {
669669
name: Cow::Borrowed("requires_params"),
670670
arguments: Some(Default::default()),
671671
task: None,
672+
input_responses: None,
673+
request_state: None,
672674
},
673675
RequestContext::new(NumberOrString::Number(1), peer),
674676
);
@@ -708,6 +710,8 @@ mod tests {
708710
name: Cow::Borrowed("test_tool"),
709711
arguments: None,
710712
task: None,
713+
input_responses: None,
714+
request_state: None,
711715
},
712716
RequestContext::new(NumberOrString::Number(1), peer),
713717
);

crates/rmcp/src/handler/server/tool.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ impl<'s, S> ToolCallContext<'s, S> {
4646
name,
4747
arguments,
4848
task,
49+
..
4950
}: CallToolRequestParams,
5051
request_context: RequestContext<RoleServer>,
5152
) -> Self {

0 commit comments

Comments
 (0)