Skip to main content

What This Example Shows

  • How to pass tools_list_dictionary on a per-agent basis inside a swarm
  • How the same tool schema can be shared across multiple worker agents
  • A ConcurrentWorkflow of two financial analysts that both call a structured search_topic tool
Every multi-agent architecture on Swarms accepts the same per-agent tools_list_dictionary. The pattern below works identically for SequentialWorkflow, HierarchicalSwarm, AgentRearrange, GroupChat, MixtureOfAgents, and the rest — only the swarm_type changes.

Step 1: Setup

Step 2: Define a Shared Tool Schema

Tools follow the OpenAI function-call schema. Define it once and reuse across agents.

Step 3: Build the Swarm

Two analysts run concurrently, each equipped with the same tool. Each agent independently decides when to call search_topic.

Step 4: Run It

Tools are scoped per-agent, not per-swarm. You can give each worker its own toolset — for example, the Market Analyst could get a search_topic tool while the Economic Forecaster gets a different fetch_macro_data tool. The swarm orchestrator does not need to know about either.

Reuse the Pattern

To switch to a different swarm topology, only swarm_type changes: The tools_list_dictionary on each agent stays exactly the same.