@@ -41,14 +41,14 @@ use crate::agent::util::request_channel::{
4141/// Represents a message from an MCP server to the client.
4242#[ derive( Debug ) ]
4343pub enum McpMessage {
44- ToolsResult ( Result < Vec < RmcpTool > , ServiceError > ) ,
45- PromptsResult ( Result < Vec < RmcpPrompt > , ServiceError > ) ,
46- ExecuteToolResult { request_id : u32 , result : ExecuteToolResult } ,
44+ Tools ( Result < Vec < RmcpTool > , ServiceError > ) ,
45+ Prompts ( Result < Vec < RmcpPrompt > , ServiceError > ) ,
46+ ExecuteTool { request_id : u32 , result : ExecuteToolResult } ,
4747}
4848
4949#[ derive( Debug ) ]
5050pub struct McpServerActorHandle {
51- server_name : String ,
51+ _server_name : String ,
5252 sender : RequestSender < McpServerActorRequest , McpServerActorResponse , McpServerActorError > ,
5353 event_rx : mpsc:: Receiver < McpServerActorEvent > ,
5454}
@@ -172,8 +172,8 @@ pub enum McpServerActorEvent {
172172pub struct McpServerActor {
173173 /// Name of the MCP server
174174 server_name : String ,
175- /// Config the server was launched with
176- config : McpServerConfig ,
175+ /// Config the server was launched with. Kept for debug purposes.
176+ _config : McpServerConfig ,
177177 /// Tools
178178 tools : Vec < ToolSpec > ,
179179 /// Prompts
@@ -203,7 +203,7 @@ impl McpServerActor {
203203 tokio:: spawn ( async move { Self :: launch ( server_name_clone, config, req_rx, event_tx) . await } ) ;
204204
205205 McpServerActorHandle {
206- server_name,
206+ _server_name : server_name,
207207 sender : req_tx,
208208 event_rx,
209209 }
@@ -223,7 +223,7 @@ impl McpServerActor {
223223 Ok ( ( service_handle, launch_md) ) => {
224224 let s = Self {
225225 server_name,
226- config,
226+ _config : config,
227227 tools : launch_md. tools . unwrap_or_default ( ) ,
228228 prompts : launch_md. prompts . unwrap_or_default ( ) ,
229229 service_handle,
@@ -292,9 +292,7 @@ impl McpServerActor {
292292 } )
293293 . await
294294 . map_err ( McpServerActorError :: from) ;
295- let _ = message_tx
296- . send ( McpMessage :: ExecuteToolResult { request_id, result } )
297- . await ;
295+ let _ = message_tx. send ( McpMessage :: ExecuteTool { request_id, result } ) . await ;
298296 } ) ;
299297 self . executing_tools . insert ( self . curr_tool_execution_id , tx) ;
300298 Ok ( McpServerActorResponse :: ExecuteTool ( rx) )
@@ -309,19 +307,19 @@ impl McpServerActor {
309307 return ;
310308 } ;
311309 match msg {
312- McpMessage :: ToolsResult ( res) => match res {
310+ McpMessage :: Tools ( res) => match res {
313311 Ok ( tools) => self . tools = tools. into_iter ( ) . map ( Into :: into) . collect ( ) ,
314312 Err ( err) => {
315313 error ! ( ?err, "failed to list tools" ) ;
316314 } ,
317315 } ,
318- McpMessage :: PromptsResult ( res) => match res {
316+ McpMessage :: Prompts ( res) => match res {
319317 Ok ( prompts) => self . prompts = prompts. into_iter ( ) . map ( Into :: into) . collect ( ) ,
320318 Err ( err) => {
321319 error ! ( ?err, "failed to list prompts" ) ;
322320 } ,
323321 } ,
324- McpMessage :: ExecuteToolResult { request_id, result } => match self . executing_tools . remove ( & request_id) {
322+ McpMessage :: ExecuteTool { request_id, result } => match self . executing_tools . remove ( & request_id) {
325323 Some ( tx) => {
326324 let _ = tx. send ( result) ;
327325 } ,
@@ -337,22 +335,24 @@ impl McpServerActor {
337335 }
338336
339337 /// Asynchronously fetch all tools
338+ #[ allow( dead_code) ]
340339 fn refresh_tools ( & self ) {
341340 let service_handle = self . service_handle . clone ( ) ;
342341 let tx = self . message_tx . clone ( ) ;
343342 tokio:: spawn ( async move {
344343 let res = service_handle. list_tools ( ) . await ;
345- let _ = tx. send ( McpMessage :: ToolsResult ( res) ) . await ;
344+ let _ = tx. send ( McpMessage :: Tools ( res) ) . await ;
346345 } ) ;
347346 }
348347
349348 /// Asynchronously fetch all prompts
349+ #[ allow( dead_code) ]
350350 fn refresh_prompts ( & self ) {
351351 let service_handle = self . service_handle . clone ( ) ;
352352 let tx = self . message_tx . clone ( ) ;
353353 tokio:: spawn ( async move {
354354 let res = service_handle. list_prompts ( ) . await ;
355- let _ = tx. send ( McpMessage :: PromptsResult ( res) ) . await ;
355+ let _ = tx. send ( McpMessage :: Prompts ( res) ) . await ;
356356 } ) ;
357357 }
358358}
0 commit comments