Refresh Tools • AI Agent SDK
refresh_tools: Re-derive the live toolset from “self.tools“.
refresh_tools
Method
</div>
Re-derive the live toolset from `self.tools`.
Per-turn tool assembly already reads from `self.tools directly, so tools added/removed via add_mcp_server/remove_mcp_server are picked up automatically on the next turn. This method clears any cached tool definitions so callers (or an MCP tools/list_changed` event) can force an immediate refresh, and returns the current toolset.
Signature
def refresh_tools() -> List[Any]Returns
ResponseField
List[Any]The current list of tools/MCP instances on the agent.
Used By
Source
View on GitHubpraisonaiagents/agent/agent.py at line 6140