update_tools

View as MarkdownOpen in Claude

Replace the agent’s tool list mid-session. The new tools take effect immediately, replacing all previously registered tools on this agent.

Parameters

tools
list[Any]Required

A new list of @function_tool-decorated functions.

Returns

None

Example

from signalwire.livewire import Agent, AgentSession, AgentServer, JobContext, function_tool, run_app
@function_tool
def greet(name: str) -> str:
"""Greet the caller by name."""
return f"Hello, {name}!"
@function_tool
def farewell(name: str) -> str:
"""Say goodbye to the caller."""
return f"Goodbye, {name}!"
agent = Agent(instructions="You are a greeter.", tools=[greet])
# Later, swap in a different tool set
await agent.update_tools([farewell])