(
&self,
server_name: &str,
tools: Vec<crate::protocol::ToolDefinition>,
)
| 45 | } |
| 46 | |
| 47 | pub async fn register_batch( |
| 48 | &self, |
| 49 | server_name: &str, |
| 50 | tools: Vec<crate::protocol::ToolDefinition>, |
| 51 | ) { |
| 52 | let mut registry = self.tools.write().await; |
| 53 | for tool_def in tools { |
| 54 | let mcp_tool = McpTool::new( |
| 55 | server_name, |
| 56 | &tool_def.name, |
| 57 | tool_def.description, |
| 58 | tool_def.input_schema, |
| 59 | ); |
| 60 | registry.insert(mcp_tool.full_name.clone(), mcp_tool); |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | pub async fn get(&self, full_name: &str) -> Option<McpTool> { |
| 65 | let tools = self.tools.read().await; |
no test coverage detected