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

Method refresh_mcp_tools

sdk/python/src/lib.rs:1131–1141  ·  view source on GitHub ↗

Re-fetch tool definitions from all connected global MCP servers and update the agent-level cache. New sessions created after this call will see the refreshed tool list. Existing sessions are unaffected.

(&self, py: Python<'_>)

Source from the content-addressed store, hash-verified

1129 /// New sessions created after this call will see the refreshed tool list.
1130 /// Existing sessions are unaffected.
1131 fn refresh_mcp_tools(&self, py: Python<'_>) -> PyResult<()> {
1132 let agent = self.inner.clone();
1133 py.allow_threads(move || {
1134 get_runtime().block_on(async {
1135 agent
1136 .refresh_mcp_tools()
1137 .await
1138 .map_err(|e| PyRuntimeError::new_err(format!("refresh_mcp_tools failed: {e}")))
1139 })
1140 })
1141 }
1142
1143 /// Bind to a workspace directory, returning a Session.
1144 ///

Callers

nothing calls this directly

Calls 3

block_onMethod · 0.80
get_runtimeFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected