Skip to content
Draft
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
12 changes: 4 additions & 8 deletions conformance/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,8 @@ impl ServerHandler for ConformanceServer {
),
];
Ok(ListToolsResult {
meta: None,
tools,
next_cursor: None,
..Default::default()
})
}

Expand Down Expand Up @@ -543,7 +542,6 @@ impl ServerHandler for ConformanceServer {
_cx: RequestContext<RoleServer>,
) -> Result<ListResourcesResult, ErrorData> {
Ok(ListResourcesResult {
meta: None,
resources: vec![
RawResource {
uri: "test://static-text".into(),
Expand All @@ -568,7 +566,7 @@ impl ServerHandler for ConformanceServer {
}
.no_annotation(),
],
next_cursor: None,
..Default::default()
})
}

Expand Down Expand Up @@ -628,7 +626,6 @@ impl ServerHandler for ConformanceServer {
_cx: RequestContext<RoleServer>,
) -> Result<ListResourceTemplatesResult, ErrorData> {
Ok(ListResourceTemplatesResult {
meta: None,
resource_templates: vec![
RawResourceTemplate {
uri_template: "test://template/{id}/data".into(),
Expand All @@ -640,7 +637,7 @@ impl ServerHandler for ConformanceServer {
}
.no_annotation(),
],
next_cursor: None,
..Default::default()
})
}

Expand Down Expand Up @@ -670,7 +667,6 @@ impl ServerHandler for ConformanceServer {
_cx: RequestContext<RoleServer>,
) -> Result<ListPromptsResult, ErrorData> {
Ok(ListPromptsResult {
meta: None,
prompts: vec![
Prompt::new(
"test_simple_prompt",
Expand Down Expand Up @@ -700,7 +696,7 @@ impl ServerHandler for ConformanceServer {
None,
),
],
next_cursor: None,
..Default::default()
})
}

Expand Down
1 change: 1 addition & 0 deletions crates/rmcp-macros/src/prompt_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ pub fn prompt_handler(attr: TokenStream, input: TokenStream) -> syn::Result<Toke
) -> Result<ListPromptsResult, rmcp::ErrorData> {
let prompts = #router_expr.list_all();
Ok(ListPromptsResult {
result_type: Default::default(),
prompts,
meta: #meta,
next_cursor: None,
Expand Down
1 change: 1 addition & 0 deletions crates/rmcp-macros/src/tool_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub fn tool_handler(attr: TokenStream, input: TokenStream) -> syn::Result<TokenS
_context: rmcp::service::RequestContext<rmcp::RoleServer>,
) -> Result<rmcp::model::ListToolsResult, rmcp::ErrorData> {
Ok(rmcp::model::ListToolsResult{
result_type: Default::default(),
tools: #router.list_all(),
meta: #result_meta,
next_cursor: None,
Expand Down
8 changes: 7 additions & 1 deletion crates/rmcp/src/handler/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ impl<H: ClientHandler> Service<RoleClient> for H {
ServerNotification::PromptListChangedNotification(_notification_no_param) => {
self.on_prompt_list_changed(context).await
}
ServerNotification::ElicitationCompletionNotification(notification) => {
ServerNotification::ElicitationCompletionNotification(notification) =>
{
#[allow(deprecated)]
self.on_url_elicitation_notification_complete(notification.params, context)
.await
}
Expand Down Expand Up @@ -238,6 +240,10 @@ pub trait ClientHandler: Sized + Send + Sync + 'static {
std::future::ready(())
}

#[deprecated(
since = "2.0.0",
note = "URL elicitation is removed by SEP-2322 (Multi Round-Trip Requests). Use InputRequiredResult-based MRTR flow instead."
)]
fn on_url_elicitation_notification_complete(
&self,
params: ElicitationResponseNotificationParam,
Expand Down
1 change: 1 addition & 0 deletions crates/rmcp/src/handler/server/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ impl IntoGetPromptResult for GetPromptResult {
impl IntoGetPromptResult for Vec<PromptMessage> {
fn into_get_prompt_result(self) -> Result<GetPromptResult, crate::ErrorData> {
Ok(GetPromptResult {
result_type: Default::default(),
description: None,
messages: self,
})
Expand Down
4 changes: 4 additions & 0 deletions crates/rmcp/src/handler/server/router/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,8 @@ mod tests {
name: Cow::Borrowed("requires_params"),
arguments: Some(Default::default()),
task: None,
input_responses: None,
request_state: None,
},
RequestContext::new(NumberOrString::Number(1), peer),
);
Expand Down Expand Up @@ -706,6 +708,8 @@ mod tests {
name: Cow::Borrowed("test_tool"),
arguments: None,
task: None,
input_responses: None,
request_state: None,
},
RequestContext::new(NumberOrString::Number(1), peer),
);
Expand Down
1 change: 1 addition & 0 deletions crates/rmcp/src/handler/server/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ impl<'s, S> ToolCallContext<'s, S> {
name,
arguments,
task,
..
}: CallToolRequestParams,
request_context: RequestContext<RoleServer>,
) -> Self {
Expand Down
Loading