MCPcopy Create free account
hub / github.com/AI45Lab/Code / get_all_tools

Method get_all_tools

core/src/mcp/manager.rs:265–277  ·  view source on GitHub ↗

Get all MCP tools, grouped by server name. Returns `(server_name, tool)` pairs — the caller is responsible for constructing the `mcp__ __ ` prefix (e.g. via [`create_mcp_tools`]).

(&self)

Source from the content-addressed store, hash-verified

263 /// Returns `(server_name, tool)` pairs — the caller is responsible for
264 /// constructing the `mcp__<server>__<tool>` prefix (e.g. via [`create_mcp_tools`]).
265 pub async fn get_all_tools(&self) -> Vec<(String, McpTool)> {
266 let clients = self.clients.read().await;
267 let mut all_tools = Vec::new();
268
269 for (server_name, client) in clients.iter() {
270 let tools = client.get_cached_tools().await;
271 for tool in tools {
272 all_tools.push((server_name.clone(), tool));
273 }
274 }
275
276 all_tools
277 }
278
279 /// Call an MCP tool by full name
280 ///

Calls 2

get_cached_toolsMethod · 0.80
cloneMethod · 0.45