@@ -4,24 +4,21 @@ use rmcp::{
44 ErrorData as RmcpError ,
55 handler:: server:: { ServerHandler , tool:: ToolRouter , wrapper:: Parameters } ,
66 model:: { CallToolResult , Content , ErrorCode , ServerCapabilities , ServerInfo } ,
7-
87 tool, tool_handler, tool_router,
98 transport:: streamable_http_server:: {
109 session:: local:: LocalSessionManager ,
1110 tower:: { StreamableHttpServerConfig , StreamableHttpService } ,
1211 } ,
1312} ;
14- use tokio:: {
15- sync:: { mpsc, oneshot} ,
16- } ;
13+ use tokio:: sync:: { mpsc, oneshot} ;
1714
1815pub mod messages;
1916
2017pub const BIND_ADDRESS : & str = "127.0.0.1:8181" ;
2118
2219use messages:: McpServerToChipmunk ;
2320
24- use crate :: types:: { SearchFilters } ;
21+ use crate :: types:: SearchFilters ;
2522
2623#[ derive( Clone , Debug ) ]
2724pub struct McpServer {
@@ -133,12 +130,9 @@ When the user provides natural language instructions, interpret them as follows:
133130 "🟢 MCP server received apply_search_filter tool call with params: {:?}" ,
134131 params
135132 ) ;
136- warn ! ( "⏰ MCP server wait 5s" ) ;
137- // Simulate LLM reasoning
138- // sleep(std::time::Duration::from_secs(5)).await;
139133 let ( response_tx, response_rx) = oneshot:: channel ( ) ;
140- let task = McpServerToChipmunk :: ApplyFilter {
141- filters : params. filters ,
134+ let task = McpServerToChipmunk :: ApplySearchFilter {
135+ filters : params. filters . clone ( ) ,
142136 response_tx,
143137 } ;
144138 let task_tx_clone = self . server_to_chipmunk_tx . clone ( ) ;
@@ -156,9 +150,10 @@ When the user provides natural language instructions, interpret them as follows:
156150 // based on the response send back the JSON response to client
157151 match response_rx. await {
158152 Ok ( task_response) => match task_response {
159- Ok ( ( ) ) => Ok ( CallToolResult :: success ( vec ! [ Content :: json(
160- "🟢 MCP Server received ApplyFilter task response: success" ,
161- ) ?] ) ) ,
153+ Ok ( ( ) ) => Ok ( CallToolResult :: success ( vec ! [ Content :: json( format!(
154+ "Chipmunk finished task ApplySearchFilter sucessfully. Applied filter: {}" ,
155+ params
156+ ) ) ?] ) ) ,
162157 Err ( err) => {
163158 let err_msg = format ! ( "Error while applying the search filter: {err}" ) ;
164159 Ok ( CallToolResult :: error ( vec ! [ Content :: json( err_msg) ?] ) )
0 commit comments