Integrations · LangChain
Flight & hotel tools for your agent, via MCP
LangChain's MCP adapters load both hosted FlightPowers servers as ordinary tools. Your agent searches live fares and hotel rates and quotes Google's verdict on every fare; you write no HTTP code.
Free tier on RapidAPI. No card to try.
from langchain_mcp_adapters.client import MultiServerMCPClient
from langchain.agents import create_agent
client = MultiServerMCPClient({
"flights": {
"transport": "http",
"url": "https://flights.flightpowers.com/mcp",
"headers": {"x-rapidapi-key": "YOUR_KEY"},
},
"hotels": {
"transport": "http",
"url": "https://hotels.flightpowers.com/mcp",
"headers": {"x-rapidapi-key": "YOUR_KEY"},
},
})
tools = await client.get_tools()
agent = create_agent(model, tools) # any chat modelThe REST alternative
No MCP? Wrap the endpoints as tools
The API is one POST with flat JSON per endpoint, so a hand-rolled tool is a few lines: one for flights, one for hotels.
import os, requests
from langchain_core.tools import tool
HEADERS = {"x-api-key": os.environ["RAPIDAPI_KEY"]}
@tool
def search_flights(from_airport: str, to_airport: str, departure_date: str) -> list:
"""Live one-way fares with Google's price band and low|typical|high verdict."""
r = requests.post(
"https://api.flightpowers.com/v1/flights/oneway",
headers=HEADERS,
json={"from_airport": from_airport, "to_airport": to_airport,
"departure_date": departure_date},
)
return r.json()
@tool
def search_hotels(destination: str, checkin_date: str, checkout_date: str) -> dict:
"""Live Booking.com rates for a destination (free text, e.g. "Lisbon")."""
r = requests.post(
"https://api.flightpowers.com/v1/hotels/search",
headers=HEADERS,
json={"destination": destination, "checkin_date": checkin_date,
"checkout_date": checkout_date},
)
return r.json()The response includes price_insights_low / high and the verdict field, so the agent can reason about whether a fare is worth booking, not just list it.
Recipes
Seven things to build with LangChain
Each one is a full page: the connect block, the job in plain words, the exact call it makes, and the response fields your logic reads.
One-way flight search
Flights API · /v1/flights/oneway
Round-trip search
Flights API · /v1/flights/roundtrip
Price-insights check
Flights API · /v1/flights/oneway
Cheapest-date scan
Flights API · /v1/flights/oneway
Hotel search
Hotels API · /v1/hotels/search
Rate-parity check
Hotels API · /v1/hotels/by-name
Fare-alert cron
Flights API · /v1/flights/oneway
Questions, answered plainly
- Is there a first-party LangChain package?
- No, and none is needed. LangChain’s own MCP adapters load the hosted servers’ tools directly, and the plain REST API wraps into a @tool in a few lines. Both paths are shown on this page; there is nothing else to install from us.
- What tools does the agent get?
- What the MCP servers expose: one-way and round-trip flight search on the flights server, hotel search and hotel-by-name on the hotels server. Each returns the same JSON as the REST API, including the price band and verdict.
- Where does the key go?
- In the headers block of the server config, as x-rapidapi-key. It rides on every tool call and bills to your own RapidAPI plan. Flights and hotels are separate subscriptions.
- Does this work with LangGraph?
- Yes. get_tools() returns ordinary LangChain tools; pass them to create_agent or any LangGraph graph the same way you pass any tool list.
Give your agent a fare verdict
Live Google Flights and Booking.com data as clean JSON. Free tier on RapidAPI, no card to try.
Free tier: 10 requests/month. No card to try.