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

Function fetch_session_mcp_tools

core/src/agent_api/capabilities.rs:256–266  ·  view source on GitHub ↗
(mcp: &Arc<McpManager>)

Source from the content-addressed store, hash-verified

254}
255
256fn fetch_session_mcp_tools(mcp: &Arc<McpManager>) -> Vec<(String, McpTool)> {
257 match tokio::runtime::Handle::try_current() {
258 Ok(handle) => tokio::task::block_in_place(|| handle.block_on(mcp.get_all_tools())),
259 Err(_) => {
260 tracing::warn!(
261 "No async runtime available for session-level MCP tools - MCP tools will not be registered"
262 );
263 vec![]
264 }
265 }
266}
267
268fn group_mcp_tools_by_server(all_tools: Vec<(String, McpTool)>) -> HashMap<String, Vec<McpTool>> {
269 let mut by_server = HashMap::new();

Callers 1

Calls 2

block_onMethod · 0.80
get_all_toolsMethod · 0.80

Tested by

no test coverage detected