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

Method refresh_mcp_tools

core/src/agent_api.rs:368–370  ·  view source on GitHub ↗

Re-fetch tool definitions from all connected global MCP servers and update the internal cache. Call this when an MCP server has added or removed tools since the agent was created. The refreshed tools will be visible to all new** sessions created after this call; existing sessions are unaffected (their `ToolExecutor` snapshot is already built).

(&self)

Source from the content-addressed store, hash-verified

366 /// **new** sessions created after this call; existing sessions are
367 /// unaffected (their `ToolExecutor` snapshot is already built).
368 pub async fn refresh_mcp_tools(&self) -> Result<()> {
369 agent_sessions::refresh_mcp_tools(self).await
370 }
371
372 /// Bind to a workspace directory, returning an [`AgentSession`].
373 ///

Callers

nothing calls this directly

Calls 1

refresh_mcp_toolsFunction · 0.85

Tested by

no test coverage detected