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

1from signalwire.livewire import Agent, AgentSession, AgentServer, JobContext, function_tool, run_app
2
3@function_tool
4def greet(name: str) -> str:
5 """Greet the caller by name."""
6 return f"Hello, {name}!"
7
8@function_tool
9def farewell(name: str) -> str:
10 """Say goodbye to the caller."""
11 return f"Goodbye, {name}!"
12
13agent = Agent(instructions="You are a greeter.", tools=[greet])
14
15# Later, swap in a different tool set
16await agent.update_tools([farewell])