MCP GUIDE

Give your AI agent a flight search tool

Connect the remote MCP endpoint once, then let an agent call flight_search with the same validated schema as the REST API.

Why use MCP for flight search?

Model Context Protocol gives an AI client a machine-readable tool definition instead of asking the model to construct an arbitrary HTTP request. The client can discover the flight_search tool, inspect its input schema, validate arguments, and receive a structured result.

This is useful when the user expresses travel intent conversationally—for example, “find an economy round trip from Tokyo to San Francisco next month”—and the agent should translate that intent into a precise search.

Connect the remote MCP server

Create an API key in the Flight MCP dashboard and add the remote endpoint to an MCP-compatible client. Keep the key in an environment variable or secret store rather than committing it to source control.

{
  "mcpServers": {
    "flight-search": {
      "url": "https://flight-mcp.com/mcp",
      "headers": {
        "Authorization": "Bearer $FLIGHT_MCP_API_KEY"
      }
    }
  }
}
One credential boundary

The same API key and monthly plan apply to REST and MCP. Cache hits remain free on both interfaces.

Give the agent the right context

An agent produces better calls when your system instructions define required travel details. Ask it to confirm the origin, destination, departure date, optional return date, passenger counts, and cabin class before searching. Let the user choose currency, locale, and point of sale when those values matter.

Do not tell the agent that a returned offer is booked or guaranteed. Search results are time-sensitive. A production workflow should show the result timestamp and re-run the search before presenting a final purchase action.

Control retries and cost

A repeated tool call can return cached data without consuming another monthly call, but agents should still avoid uncontrolled retry loops. Use the structured error code and retry timing, and increase cacheTtlSeconds when a workflow can accept older data.

See the MCP reference for protocol details and the cache guide for freshness patterns.