

Written by: Yuan Teoh, Software Engineer @ Google (Linkedin)
The world of travel planning can be complex, involving numerous interconnected tasks from flight bookings and hotel reservations to itinerary creation and local activity suggestions. Traditionally, this has been a manual, time-consuming process. But what if we could automate and optimize this using the power of multi-agent systems?
Today, we will demonstrate building a multi-agent travel agency application. This is achieved through the use of MCP Toolbox for Databases, a powerful solution that allows intelligent agents to seamlessly interact with various data sources, guaranteeing each agent has access to the tools they need.
Cymbal Travel Agency
Ever wondered how a traditional travel agency really works? They’re basically your go-between, connecting you with all sorts of travel providers like airlines, hotels, and tour companies. Multi-agent systems enable the creation of specialized agents, each designed to handle a distinct part of a complex process. This allows for a clear division of labor, where each agent is responsible for specific tasks.
This example showcases a simplified travel agency called Cymbal Travel Agency. It demonstrates how three agents can collaborate to research and book flights and hotels:
- Customer service Agent: This agent is the primary interface for the customer. It receives travel requests, clarifies details, and routes user queries to other agents.
- Flight Agent: Queries flight databases, compares prices, and handles flight booking details.
- Hotel Agent: Searches for hotel accommodations, compares prices, and manages hotel reservations.
Grouping Tools into Toolsets
Agents will require tools to access database information, such as tools for listing and booking flight tickets, and searching for hotels. These tools are configured in the MCP Toolbox tools.yaml
config file. The available tools are categorized into general knowledge tools (e.g., searching for airports, airport amenities) and specialized tools (e.g., searching and booking hotels, searching and booking flights). These tools are organized into distinct “toolsets”:
sources:
my-pg-instance:
kind: alloydb-postgres
project: my-project
region: us-central1
cluster: my-cluster
instance: my-instance
database: my_db
user: ${USER_NAME}
password: ${PASSWORD}tools:
search_airports:
kind: postgres-sql
source: my-pg-instance
description: |
Use this tool to list all airports matching search criteria.
Takes at least one of country, city, name, or all and returns all matching airports.
parameters:
- name: country
type: string
description: Country
default: ""
- name: city
type: string
description: City
default: ""
- name: name
type: string
description: Airport name
default: ""
statement: |
SELECT * FROM airports
WHERE (CAST($1 AS TEXT) = '' OR country ILIKE $1)
AND (CAST($2 AS TEXT) = '' OR city ILIKE $2)
AND (CAST($3 AS TEXT) = '' OR name ILIKE '%' || $3 || '%')
LIMIT 10
# Other tools...
toolsets:
general_tools:
- search_airports
- search_amenities
hotel_tools:
- list_hotels
- book_hotel
- list_bookings
flight_tools:
- list_flights
- search_flights_by_number
- search_policies
- insert_ticket
- list_tickets
For instance, the flight_tools
toolset would comprise all flight-related tools, whereas the hotel_tools
toolset would encompass all hotel-related tools. This modular methodology ensures that each agent is granted access solely to the precise tools requisite for its function, thereby enhancing both efficiency and security.
Specialized Agent
Within our python application (app.py
), we can utilize the MCP Toolbox SDKs for Python to load the tools from Toolbox.
from toolbox_langchain import ToolboxClienttoolboxClient = ToolboxClient("http://127.0.0.1:5000")
general_tools = await toolboxClient.aload_toolset("general_tools")
hotel_tools = await toolboxClient.aload_toolset("hotel_tools")
flight_tools = await toolboxClient.aload_toolset("flight_tools")
To grant an agent access to multiple toolsets, simply combine the retrieved tools.
hotel_with_general_tools = general_tools + hotel_tools
With a multi-agent design, each specialized agent will also have its own prompts, which allows for greater flexibility and precision in how each agent operates. This ensures that each agent can be finely tuned for its specific task, leading to more accurate and efficient results. Here, we show an example of the prompts for a customer service agent:
CUSTOMER_SERVICE_PROMPT = """
You are a friendly and professional customer service agent for Cymbal Travel Agency, a travel booking service.Your primary responsibilities are to:
1. **Welcome users** and greet them warmly.
2. **Answer general knowledge questions** related to travel (e.g. questions about airports or specific airport such as SFO). If you are unsure of a specific information or do not have tool to access it, you should let the user know.
3. **Manage conversational flow** and ask clarifying questions to understand the user's intent.
**Specialized Agent:**
- **flight agent**: If a user asks a question specifically about **searching, listing and booking a flight**.
- **hotel agent**: If a user asks a question specifically about **searching, listing and booking a hotel**.
**You can call the specialized agents** to help you with certain tasks. You can do this however many times you want until you have all the informations needed.
**If you already have the informamtion you need, feel free to response directly to the user instead of calling another agent. If you're unsure, please check with the other agents.**
"""
With the tools and prompts, we can now build our specialized agents! In this example, we will utilize LlamaIndex’s FunctionAgent and AgentWorkflow.
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.google_genai import GoogleGenAI# Load the gemini llm model
llm = GoogleGenAI(
model="gemini-2.5-flash",
vertexai_config={"project": "project-id", "location": "us-central1"},
)
# Build a FunctionAgent
customer_service_agent = FunctionAgent(
name="CustomerServiceAgent",
description="Answer user's queries and route to the right agents for flight and hotel related queries",
system_prompt=CS_PROMPT,
llm=llm,
tools=general_tools,
)
As seen in the example above, the customer service agent will only have access to tools within the general_tools
toolset, restricting its access to flight or hotel information and the ability to retrieve an user’s flight tickets or hotel bookings. Similarly, the flight agent will not have access to the hotel booking dataset. Limiting agent tool access enhances security by reducing attack surfaces, improves efficiency through specialization, simplifies development, lowers complexity for better decision-making, optimizes resource usage, and clarifies accountability for easier troubleshooting.
Similar configuration applies to both the flight agent and the hotel agent.
Putting it all together
Next, let’s create an AgentWorkflow
for the multi-agent application.
from llama_index.core.agent.workflow import AgentWorkflowagent_workflow = AgentWorkflow(
agents = [customer_service_agent, hotel_agent, flight_agent],
root_agent=customer_service_agent.name,
initial_state={},
)
To maintain conversation state between each run, we can utilize Context
.
from llama_index.core.workflow import Contextctx = Context(agent_workflow)
Next, we can run the agent workflow with the following code:
resp = await agent_workflow.run(user_msg=user_input, ctx=ctx)
Now Open for Business
With the multi-agent application configured, let’s observe it in action! See the documentation for details on installing MCP Toolbox.
Run MCP Toolbox to expose the tools:
./toolbox --tools-file=tools.yaml
Then, run the Cymbal Travel Agency application:
python app.py
After running the app, we can check to see what is the capability of the Cymbal Travel Agency:
Cymbal Travel Agency: What question do you have?User: What can you help me with?
Cymbal Travel Agency: Hello! I'm a customer service agent for Cymbal Travel Agency.
I can help you with a variety of travel-related questions.
Here are some of the things I can do:
* Answer general knowledge questions about travel, airports, and destinations.
* Search for airports by country, city, or name.
* Find amenities at airports.
* Connect you with our specialized Flight Agent for all your flight-related needs (searching, booking, and listing flights).
* Connect you with our specialized Hotel Agent for all your hotel-related needs (searching, booking, and listing hotels).
How can I help you today?
Let’s search for a flight to Denver for today, August 26, 2025:
User: Can you list flights to Denver on August 26, 2025?Cymbal Travel Agency: I've handed you over to the Flight Agent.
I can list flights to Denver on August 26, 2025. Do you have a specific departure airport in mind?
User: Departing from SFO.
Cymbal Travel Agency: Here are the flights from San Francisco (SFO) to Denver (DEN) on August 26, 2025:
* **Southwest Airlines (WN) 3121:**
* Departure: 2025-08-26 07:10:00Z from SFO (Gate E46)
* Arrival: 2025-08-26 10:38:00Z at DEN (Gate D30)
* **United Airlines (UA) 948:**
* Departure: 2025-08-26 08:19:00Z from SFO (Gate B1)
* Arrival: 2025-08-26 11:55:00Z at DEN (Gate C10)
* **United Airlines (UA) 618:**
* Departure: 2025-08-26 09:33:00Z from SFO (Gate A21)
* Arrival: 2025-08-26 13:03:00Z at DEN (Gate A18)
* **Frontier Airlines (F9) 658:**
* Departure: 2025-08-26 10:32:00Z from SFO (Gate C8)
* Arrival: 2025-08-26 13:52:00Z at DEN (Gate A17)
* **United Airlines (UA) 753:**
* Departure: 2025-08-26 12:58:00Z from SFO (Gate E17)
* Arrival: 2025-08-26 17:00:00Z at DEN (Gate C48)
* **United Airlines (UA) 526:**
* Departure: 2025-08-26 16:28:00Z from SFO (Gate A9)
* Arrival: 2025-08-26 19:48:00Z at DEN (Gate E13)
* **Cymbal Air (CY) 667:**
* Departure: 2025-08-26 08:32:00Z from SFO (Gate D8)
* Arrival: 2025-08-26 12:47:00Z at DEN (Gate B2)
Airline CY is the Cymbal Air airline code. I like travelling with Cymbal Air. Let’s proceed with the booking!
User: Thank you! I would like to book flight CY 667.Cymbal Travel Agency: To book flight CY 667, I need your full name and email address. Also, just to confirm, the flight details are:
* **Airline:** Cymbal Air (CY)
* **Flight Number:** 667
* **Departure Airport:** SFO
* **Departure Time:** 2025-08-26 08:32:00Z
* **Arrival Airport:** DEN
* **Arrival Time:** 2025-08-26 12:47:00Z
Please provide your name and email to proceed with the booking.
User: Please keep those empty.
For this demo, we’ve simplified the setup by not using the Authenticate Parameters feature in Toolbox — automatically populated with user information decoded from ID tokens. Instead, tools.yaml
was provided with default values for user information like name and email, which Toolbox will automatically utilize. The agent is unaware of the default value.
Cymbal Travel Agency: I have booked flight CY 667 for you, departing from SFO on 2025-08-26 at 08:32:00Z and arriving in DEN at 12:47:00Z. Please note that this booking was made without a name or email address associated with it, as per your request.
Voila! Now we have a flight booked! Now let’s book a hotel.
User: Great! I would also like to book a hotel. Do you have any hotels at Denver?Cymbal Travel Agency: Great! I can help you with that. Do you have a specific hotel in mind in Denver, or would you like me to search for available options? If so, do you have any preferences for the hotel's rating or price range?
User: I would like to know all available options. I don't have preferen
ce on hotel's rating or price range.
Cymbal Travel Agency: Here are the hotels available in Denver:
* **The Mile High Inn**: Price: $210, Rating: 3.0
* **Union Station Hotel**: Price: $350, Rating: 4.0
Do any of these interest you, or would you like to refine your search?
The Union Station Hotel is a popular choice for travelers visiting Denver! Love it!
User: Yes! Please book a room at the Union Station HotelCymbal Travel Agency: Great choice! To book your room at the Union Station Hotel, I need a few more details:
* What is your desired **check-in date**?
* How many **nights** will you be staying?
* What is your **full name** and **email address** for the booking?
User: I would like to check in on August 26, 2025 for 2 nights
Cymbal Travel Agency: Excellent! So, you'd like to book a room at the Union Station Hotel in Denver, checking in on August 26, 2025, for 2 nights. The total price for two nights will be $700.
Before I finalize the booking, could you please provide your full name and email address?
User: Please keep those empty.
Cymbal Travel Agency: Your booking for the Union Station Hotel in Denver on August 26, 2025, for 2 nights has been successfully made! The total cost is $700.
Our flight and hotel are booked! It’s time for a vacation!
Wrapping Up Our Multi-Agent Travel Agency Journey
We’ve seen how the MCP Toolbox for Databases empowers us to build sophisticated multi-agent systems, transforming complex tasks like travel planning into streamlined, efficient processes. By leveraging specialized agents and intelligently organized toolsets, we can create applications that not only automate but also enhance user interactions, providing a more intuitive and responsive experience.
Cymbal Travel Agency demonstrates the potential of multi-agent architectures, highlighting how clear division of labor, secure tool access, and finely tuned agent prompts contribute to a robust and scalable solution. For the full code implementation, check out the samples branch in MCP Toolbox repository.
Stay tuned for more insights and examples in our next week!
Source Credit: https://medium.com/google-cloud/building-a-multi-agent-travel-agency-with-mcp-toolbox-for-databases-4e17dd508398?source=rss—-e52cf94d98af—4