use std::future::Future;
use rmcp::model::CallToolResult;
use crate::error::McpError;
pub trait McpCaller: Send + Sync {
fn call_tool(
&self,
server_id: &str,
tool_name: &str,
args: serde_json::Value,
) -> impl Future<Output = Result<CallToolResult, McpError>> + Send;
fn list_servers(&self) -> impl Future<Output = Vec<String>> + Send;
}
impl McpCaller for crate::manager::McpManager {
async fn call_tool(
&self,
server_id: &str,
tool_name: &str,
args: serde_json::Value,
) -> Result<CallToolResult, McpError> {
self.call_tool(server_id, tool_name, args).await
}
async fn list_servers(&self) -> Vec<String> {
self.list_servers().await
}
}