Walkthrough: Creating a Multi-Agent Tool with Project Templates
Walkthrough: Creating a Multi-Agent Tool with Project Templates
This tutorial requires openagents version 0.8.5.post4 or higher
This walkthrough teaches you how to build a coordinated multi-agent workflow that exposes a tool via MCP. We'll use an "Alternative Service Finder" as our example - a system where multiple agents work together to find and compare alternatives to web services.
By the end, you'll be able to ask Claude:
"Find alternatives to Notion and compare them"
And get a detailed comparison from your multi-agent system!
What You'll Learn
How to use project templates to define reusable workflows
How to expose tools via MCP for external access
How coordinator agents orchestrate multi-agent workflows
How to connect Claude Desktop to your agent network
Architecture Overview
Step 1: Set Up Your Python Environment
First, ensure you have Python 3.10 or higher installed.
# Check your Python versionpython --version
If you need to install Python, visit python.org or use your system's package manager.
Step 2: Install OpenAgents
Install the OpenAgents package from PyPI:
pip install openagents
Tip: Always upgrade to the latest version to get the newest features and bug fixes:
Before starting the network, let's understand how project templates work. Open demos/08_alternative_service_project/network.yaml to see the template definition:
project_templates: find_alternatives: name: Find Service Alternatives description: Provides users with alternative options to given web services expose_as_tool: true tool_name: find_service_alternatives tool_mode: async tool_description: > Find and compare alternative services to a given web service or SaaS tool. Returns a detailed comparison with features, pricing, and recommendations. agent_groups: - coordinators - workers
Key settings:
expose_as_tool: true - Makes this workflow callable as a tool via MCP
tool_name - The name external clients will use to call this tool
agent_groups - Which agents can participate in this workflow
The Studio web interface will automatically open in your browser at http://localhost:8700.
Note: If the browser doesn't open automatically, navigate to http://localhost:8700 manually.
Let's enter the admin dashboard by clicking "Manage Network", enter "admin" as the password.
Step 6: Configure the Default Models and Start the Service Agents
The network needs three agents to function, let's first configure the default LLM for running the service agents.
Configure Default Models
In Default Models tab, configure and test the LLM access.
Start Service Agents
Let's start all three service agents: searcher, comparer and coordinator in the Service Agents tab.
Step 7: Test the Workflow in User Console
Let's verify everything works before connecting Claude Desktop.
Let's click User Console and switch to the Project App. Let's launch a new project and select the Find Service Alternatives project template.
We can type "Discord" so that the agent team will work to search for alternative options of Discord.
What's happening: The coordinator receives your request, delegates to the searcher to find alternatives, then delegates to the comparer to create a detailed analysis. All communication happens through the OpenAgents network.
Step 9: Publish Your Network
To connect Claude Desktop to your network, you need to publish it.
Publish from Admin Dashboard
In the Admin Dashboard, find the "Network Status" panel
Click "Publish Network"
You can authenticate with OpenAgents for creating publishing the networks
Connect via Relay for localhost networks
Publiksh the networks
IMPORTANT: You need to pick an unique network ID
Once published, you'll see the following information if you go to the Dashboard:
Network ID:my-service-finder (only as an example, you have to use your only ID)
Copy the MCP URL - you'll need it for Claude Desktop.
Step 10: Connect Claude Desktop
Now let's connect Claude Desktop to use your multi-agent tool.
Configure Claude Desktop
Go to Settings > Connectors, let's add a custom connector:
Let's configure the connector and always allow the find_service_alternatives tool!
Important: Replace service-alternatives-142342 with your actual network ID from the publish step.
Step 11: Use Your Tool with Claude
Open Claude Desktop and try these prompts:
Basic Query
Find alternative services to Slack.
Claude will:
Call the start_find_service_alternatives tool
Your coordinator will orchestrate the searcher and comparer agents
Claude calls get_result_find_service_alternatives receives and presents the detailed comparison
More Example Queries
Query
What Happens
"What are some alternatives to Mailchimp?"
Finds email marketing alternatives
"Compare project management tools like Asana"
Finds and compares PM tools
"I need a Figma alternative for my team"
Finds design tool alternatives
"What's a good open-source alternative to Notion?"
Filters for open-source options
How the Agents Work Together
The Coordinator (Python)
The coordinator is a non-LLM agent that orchestrates the workflow:
@on_event("project.notification.started")async def on_project_started(self, event): # 1. Extract the service name from project goal # 2. Delegate to searcher: "Find alternatives to {service}" # 3. Wait for searcher to complete # 4. Delegate to comparer: "Compare these alternatives" # 5. Wait for comparer to complete # 6. Mark project as complete
The Searcher Agent (YAML + LLM)
The searcher uses intelligent tool selection:
instructions: | DECISION LOGIC: 1. If the service is well-known (Slack, Notion, etc.) → Use your knowledge 2. If the service is niche or new → Use the search_web tool 3. Prefer efficiency: Don't make unnecessary web requests
The Comparer Agent (YAML + LLM)
The comparer also uses intelligent tool selection:
instructions: | DECISION LOGIC: 1. If you know the services well → Use your knowledge 2. If you need current pricing or features → Use fetch_webpage tool 3. Always provide a structured comparison table
MCP Tools Available
Once connected, Claude has access to:
Tool
Description
find_service_alternatives
Triggers the full workflow to find and compare alternatives
Define reusable workflows - Create once, use many times
Expose as tools - Make workflows callable via MCP
Control access - Specify which agent groups participate
Provide context - Give agents background about the workflow
project_templates: find_alternatives: name: Find Service Alternatives description: Provides users with alternative options to given web services expose_as_tool: true tool_name: find_service_alternatives tool_mod: async context: | This workflow helps users discover alternatives to popular SaaS tools. The searcher finds options, the comparer analyzes them in detail.