Refresh Tools • AI Agent SDK

refresh_tools: Re-derive the live toolset from “self.tools“.

refresh_tools

Method

</div>

This is a method of the Agent class in the agent module.

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.

Diagram

uses

returns

Agent

Tool: refresh_tools

Result

Signature

python
def refresh_tools() -> List[Any]

Returns

ResponseField List[Any]

The current list of tools/MCP instances on the agent.

Used By

Source

View on GitHub

praisonaiagents/agent/agent.py at line 6140


Related Documentation