This guide explains how to create and test agents using the agents-as-tools pattern with the Agentic Chatbot Accelerator. In this pattern, an orchestrator agent delegates tasks to specialized sub-agents that are exposed as callable tools.
An agents-as-tools configuration consists of:
- Orchestrator Agent: A central agent with its own model, instructions, and reasoning capabilities that decides which sub-agents to invoke
- Sub-Agents as Tools: Existing deployed agents that are exposed as tools to the orchestrator, each with a defined role describing its specialization
- Endpoint: The qualifier/endpoint of each sub-agent (e.g.
DEFAULT) - Optional Tools: Additional tools, knowledge bases, and MCP servers available to the orchestrator alongside the sub-agent tools
Unlike graph agents where the execution flow is predefined by edges, the orchestrator dynamically decides which sub-agent(s) to invoke based on the user's request and each sub-agent's role description. The orchestrator can invoke multiple sub-agents in sequence, combine their outputs, and reason about the results before responding to the user.
This pattern is inspired by the Strands Agents multi-agent agents-as-tools approach: each sub-agent is wrapped as a tool with a description derived from its role, allowing the orchestrator to select the right agent for each task.
Before creating an agents-as-tools orchestrator, you need:
- At least one deployed agent (single, swarm, or graph) with status "Ready" and a tagged endpoint (e.g. DEFAULT)
- The accelerator deployed with the agents-as-tools feature enabled (CDK stack includes the agents-as-tools container image)
Each sub-agent is an independent agent that can be invoked on its own. Create them through the UI:
- Go to Agent Factory → Create Agent
- Select Single Agent architecture
- Configure the agent with its own name, instructions, and model
- Wait for it to reach "Ready" status and ensure it has a tagged endpoint (e.g. DEFAULT)
- Go to Agent Factory → Create Agent
- In the Architecture Type step, select Agents as Tools
- Enter a name for the orchestrator agent (e.g.
travel_planner)
In the Agents as Tools step:
- Use the Select an agent dropdown to add existing agents as tools
- For each agent, select the Endpoint from the dropdown (typically "DEFAULT")
- Enter a Role description — this is critical as the orchestrator uses it to decide when to invoke each sub-agent. Be specific and descriptive about what the agent can do.
- You can add multiple sub-agents; the orchestrator will reason about which one(s) to call
In the Orchestrator Configuration step:
- Model: Select the LLM model for the orchestrator (e.g. Claude Haiku 4.5)
- Instructions: Write a system prompt that tells the orchestrator how to use its sub-agents. Reference the sub-agents by their roles and explain the delegation strategy.
- Conversation Manager: Choose how conversation history is managed (Sliding Window is recommended)
- Additional Tools (optional): Add extra tools, knowledge bases, or MCP servers that the orchestrator can use directly alongside its sub-agent tools
The review step shows:
- A Sub-Agent Tools summary table (agent name, endpoint, role)
- A JSON preview of the complete configuration
Click Create Runtime to submit. The orchestrator agent goes through the same creation pipeline as other agents (Step Function → AgentCore Runtime).
Once the orchestrator reaches "Ready" status:
- Go to the Chat interface
- Select your orchestrator agent's endpoint
- Send a message — the orchestrator will analyze the request, decide which sub-agent(s) to invoke, and synthesize a response
A travel planning orchestrator that delegates to specialized sub-agents for booking and activities.
| Agent Name | Instructions |
|---|---|
booking_agent |
"You are a booking assistant specializing in travel reservations. When given a travel request, simulate looking up available flights and hotels for the requested destination and dates. Provide realistic-looking options with prices, airlines, hotel names, and ratings. Format your response clearly with separate sections for flights and accommodations. Since you don't have access to real booking systems, generate plausible options based on the destination." |
activities_agent |
"You are a local activities and excursions expert. When given a travel destination and dates, simulate researching and recommending local activities, tours, restaurants, and cultural experiences. Provide realistic suggestions with estimated costs, durations, and brief descriptions. Organize recommendations by category (sightseeing, food, adventure, culture). Since you don't have access to real activity databases, generate plausible recommendations based on the destination." |
Create each one through the UI:
- Agent Factory → Create Agent → Single Agent
- Set the agent name, instructions, and model (e.g.
us.anthropic.claude-haiku-4-5-20251001-v1:0) - Do not add any tools — the agents will simulate their responses
- Wait for "Ready" status
- Agent Factory → Create Agent → Agents as Tools
- Name:
travel_planner
| Agent | Endpoint | Role |
|---|---|---|
booking_agent |
DEFAULT | "Handles travel booking research including flights and hotel availability. Invoke this agent when the user needs help finding or comparing travel options like flights, hotels, or rental cars for specific destinations and dates." |
activities_agent |
DEFAULT | "Researches and recommends local activities, tours, and dining options at travel destinations. Invoke this agent when the user wants suggestions for things to do, places to eat, or experiences to have at their destination." |
You are a helpful travel planning assistant that coordinates specialized agents to help users plan their trips.
You have access to the following specialized agents:
- A booking agent that can research flights and hotels
- An activities agent that can recommend local activities and dining
When a user asks about planning a trip:
1. First, use the booking agent to find flight and hotel options for their destination and dates
2. Then, use the activities agent to recommend things to do at the destination
3. Combine the results into a comprehensive travel plan with a clear itinerary
Always pass complete context to each agent — include the destination, dates, preferences, budget, and any other relevant details from the user's request. The sub-agents cannot see the conversation history, so you must include all necessary information in each request.
If the user only asks about one aspect (e.g., just flights or just activities), only invoke the relevant agent.
- Model: Claude Haiku 4.5 (or your preferred model)
- Temperature: 0.2
- Max Tokens: 3000
- Conversation Manager: Sliding Window
Open the chat interface, select the travel_planner endpoint, and try:
User: I'm planning a 5-day trip to Tokyo in April. My budget is around $3000.
Can you help me find flights from New York, a good hotel, and suggest activities?
→ Orchestrator analyzes the request
→ Invokes booking_agent: "Find flights from New York to Tokyo in April and
hotels for 5 nights. Budget around $3000 total."
→ Invokes activities_agent: "Recommend activities, restaurants, and cultural
experiences for a 5-day trip to Tokyo in April."
→ Orchestrator combines both responses into a comprehensive travel plan
→ Final response returned to user with flights, hotel, and activity recommendations
The orchestrator dynamically decides which sub-agents to invoke based on the user's request. If the user later asks "What else can I do in Shibuya?", the orchestrator will only invoke the activities agent since no booking information is needed.
To inspect an existing agents-as-tools configuration:
- Go to Agent Factory
- Find the agent in the table — the Architecture column shows "AGENTS_AS_TOOLS"
- Click on a version to open the View Version modal
- The modal displays: model configuration, orchestrator instructions, agents-as-tools table (runtime ID, endpoint, role), additional tools (if any), and conversation manager
To update an agents-as-tools configuration:
- Select the agent in the Agent Factory table
- Click New version
- The wizard opens with the existing configuration pre-populated
- Modify sub-agents, orchestrator instructions, or model settings as needed
- Click Create Runtime to deploy the new version
- The UI sends a
createAgentCoreRuntimemutation witharchitectureType: AGENTS_AS_TOOLSand the orchestrator config asconfigValue - The Agent Factory Resolver validates the config against
OrchestratorConfiguration(Pydantic) and verifies all referenced runtime IDs exist - The Step Function invokes the Create Runtime Version Lambda, which selects the agents-as-tools Docker container (
docker-agents-as-tools/) - At runtime, the container's
data_source.pyloads the orchestrator configuration from DynamoDB factory.pycreates a StrandsAgentwith the orchestrator's model and instructions, then wraps each sub-agent as anInvokeSubAgentTool:- Each sub-agent becomes a tool named
invoke_<runtimeId> - The tool description includes the sub-agent's role, telling the orchestrator when to use it
- When invoked, the tool calls the AgentCore invoke API to run the sub-agent and returns its response
- Each sub-agent becomes a tool named
- The orchestrator agent reasons about the user's request, decides which sub-agent tools to call (and with what input), and synthesizes the final response
Sub-agents have no access to the conversation history. When the orchestrator invokes a sub-agent tool, it must pass all relevant context in the query parameter. The tool's schema enforces this:
"Complete, self-contained prompt to send to the sub-agent. IMPORTANT: You MUST include ALL relevant details, parameters, and data from the user's request that the sub-agent needs to fulfill its role."
This is why clear orchestrator instructions are essential — the orchestrator must know to forward complete context to each sub-agent.
The role is the primary mechanism the orchestrator uses to decide which sub-agent to invoke. Good roles are:
- Specific: "Handles flight and hotel booking research for specific destinations and dates" (not "Helps with travel")
- Action-oriented: Describe what the agent does, not what it is
- Boundary-clear: Make it obvious when this agent should (and shouldn't) be invoked
- List all sub-agents and describe when to use each one
- Define a delegation strategy — should the orchestrator call all agents or only relevant ones?
- Emphasize context passing — remind the orchestrator to include all relevant details in each sub-agent call
- Describe synthesis — tell the orchestrator how to combine sub-agent responses into a final answer
| Pattern | Best for |
|---|---|
| Single Agent | Simple tasks with direct tool access |
| Agents as Tools | Dynamic delegation where the orchestrator decides which specialists to invoke based on the request |
| Swarm | Collaborative workflows where agents hand off conversations to each other |
| Graph | Predefined workflows with fixed execution paths and conditional routing |
| Issue | Cause | Fix |
|---|---|---|
| Orchestrator doesn't invoke sub-agents | Role descriptions are too vague | Make roles more specific and descriptive |
| Sub-agent returns incomplete responses | Orchestrator didn't pass enough context | Update orchestrator instructions to emphasize passing complete context |
| Wrong sub-agent invoked | Role descriptions overlap | Make roles more distinct with clearer boundaries |
| Agent not appearing in dropdown | Agent hasn't finished creating | Wait for the agent to reach "Ready" status |
| Creation fails with validation error | Empty tools/toolParameters mismatch | Ensure either both tools and toolParameters are provided, or neither |
| Sub-agent timeout | Complex sub-agent taking too long | The sub-agent has its own timeout settings; increase them if needed |
| "Runtime not found" error | Referenced runtime ID doesn't exist | Verify the sub-agent is deployed and has a valid endpoint |

