Skip to content

Commit 1af2e80

Browse files
xorpsehashemix
andauthored
fix ServerHandler task handling method return types (#132)
Co-authored-by: Ali Hashemi <14126952+hashemix@users.noreply.github.com>
1 parent 19473ee commit 1af2e80

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

crates/rust-mcp-sdk/src/mcp_handlers/mcp_server_handler.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,12 +258,12 @@ pub trait ServerHandler: Send + Sync + 'static {
258258
)))
259259
}
260260

261-
///Handles a request to retrieve the state of a task.
261+
/// Handles a request to retrieve the state of a task.
262262
async fn handle_get_task_request(
263263
&self,
264264
params: GetTaskParams,
265265
runtime: Arc<dyn McpServer>,
266-
) -> std::result::Result<CompleteResult, RpcError> {
266+
) -> std::result::Result<GetTaskResult, RpcError> {
267267
Err(RpcError::method_not_found().with_message(format!(
268268
"No handler is implemented for '{}'.",
269269
&GetTaskRequest::method_value(),
@@ -275,7 +275,7 @@ pub trait ServerHandler: Send + Sync + 'static {
275275
&self,
276276
params: GetTaskPayloadParams,
277277
runtime: Arc<dyn McpServer>,
278-
) -> std::result::Result<CompleteResult, RpcError> {
278+
) -> std::result::Result<GetTaskPayloadResult, RpcError> {
279279
Err(RpcError::method_not_found().with_message(format!(
280280
"No handler is implemented for '{}'.",
281281
&GetTaskPayloadRequest::method_value(),
@@ -287,7 +287,7 @@ pub trait ServerHandler: Send + Sync + 'static {
287287
&self,
288288
params: CancelTaskParams,
289289
runtime: Arc<dyn McpServer>,
290-
) -> std::result::Result<CompleteResult, RpcError> {
290+
) -> std::result::Result<CancelTaskResult, RpcError> {
291291
Err(RpcError::method_not_found().with_message(format!(
292292
"No handler is implemented for '{}'.",
293293
&CancelTaskRequest::method_value(),
@@ -299,7 +299,7 @@ pub trait ServerHandler: Send + Sync + 'static {
299299
&self,
300300
params: Option<PaginatedRequestParams>,
301301
runtime: Arc<dyn McpServer>,
302-
) -> std::result::Result<CompleteResult, RpcError> {
302+
) -> std::result::Result<ListTasksResult, RpcError> {
303303
Err(RpcError::method_not_found().with_message(format!(
304304
"No handler is implemented for '{}'.",
305305
&ListTasksRequest::method_value(),

0 commit comments

Comments
 (0)