MCPcopy Index your code
hub / github.com/AI45Lab/Code / create_mcp_tools

Function create_mcp_tools

core/src/mcp/tools.rs:83–98  ·  view source on GitHub ↗

Create tool wrappers for all tools from an MCP server

(
    server_name: &str,
    tools: Vec<McpTool>,
    manager: Arc<McpManager>,
)

Source from the content-addressed store, hash-verified

81
82/// Create tool wrappers for all tools from an MCP server
83pub fn create_mcp_tools(
84 server_name: &str,
85 tools: Vec<McpTool>,
86 manager: Arc<McpManager>,
87) -> Vec<Arc<dyn Tool>> {
88 tools
89 .into_iter()
90 .map(|tool| {
91 Arc::new(McpToolWrapper::new(
92 server_name.to_string(),
93 tool,
94 manager.clone(),
95 )) as Arc<dyn Tool>
96 })
97 .collect()
98}
99
100#[cfg(test)]
101mod tests {

Callers 4

execute_with_task_idMethod · 0.85
add_mcp_serverMethod · 0.85
test_create_mcp_toolsFunction · 0.85

Calls 1

cloneMethod · 0.45

Tested by 1

test_create_mcp_toolsFunction · 0.68