Skip to main content
Tools can be added to Agents and Teams post-creation. This gives you the flexibility to add tools to an existing Agent or Team instance after initialization, which is useful for dynamic tool management or when you need to conditionally add tools based on runtime requirements. The whole collection of tools available to an Agent or Team can also be updated by using the set_tools call. Note that this will remove any other tools already assigned to your Agent or Team and override it with the list of tools provided to set_tools.

Agent Example

Create your own tool, for example get_weather. Then call add_tool to attach it to your Agent.
add_agent_tool_post_initialization.py

Team Example

Create a list of tools, and assign them to your Team with set_tools
add_team_tool_post_initialization.py
  • The add_tool method allows you to dynamically extend an Agent’s or a Team’s capabilities. This is particularly useful when you want to add tools based on user input or other runtime conditions.
  • The set_tool method allows you to override an Agent’s or a Team’s capabilities. Note that this will remove any existing tools previously assigned to your Agent or Team.

Developer Resources