Skip to main content
Glama

get_flight_option_details

Retrieve detailed flight information, including segments, pricing, and baggage details, for a specific option identified by search and offer IDs. Use this tool to access granular data essential for informed booking decisions.

Instructions

Retrieve detailed information about a specific flight option from the search results. This tool provides detailed information about a flight option, including its segments, price, baggage info. It is useful for getting more granular information about a specific flight option.

Input Schema

NameRequiredDescriptionDefault
offer_idYesOffer ID of the flight option for which to request a booking link.
search_idYesSearch ID from the previous search_flights tool.

Input Schema (JSON Schema)

{ "properties": { "offer_id": { "description": "Offer ID of the flight option for which to request a booking link.", "title": "Offer Id", "type": "string" }, "search_id": { "description": "Search ID from the previous search_flights tool.", "title": "Search Id", "type": "string" } }, "required": [ "search_id", "offer_id" ], "type": "object" }

Implementation Reference

  • The main handler function that executes the tool logic: retrieves the proposal batch from cache using search_id, finds the specific proposal by offer_id, and returns its full description.
    def get_flight_option_details( search_id: str = Field(..., description="Search ID from the previous search_flights tool."), offer_id: str = Field(..., description="Offer ID of the flight option for which to request a booking link."), ) -> Dict[str, Any]: """Get detailed information about a specific flight option from the search results.""" batch = search_results_cache.get(search_id) if not batch: raise ToolError(f"No search results found for search_id: {search_id}. " \ "It may have expired after 10 minutes. " \ "Please perform a search first using the `search_flights` tool.") proposal = batch.get_proposal_by_id(offer_id) if not proposal: raise ToolError(f"No flight details found for offer_id: {offer_id} in search_id: {search_id}.") return proposal.get_full_description()
  • The @mcp.tool decorator that registers the get_flight_option_details tool with the FastMCP server, including its description.
    @mcp.tool(description="Retrieve detailed information about a specific flight option from the search results. " \ "This tool provides detailed information about a flight option, including its segments, price, baggage info. " \ "It is useful for getting more granular information about a specific flight option.")
  • Pydantic Field definitions providing input schema validation and descriptions for the tool parameters.
    search_id: str = Field(..., description="Search ID from the previous search_flights tool."), offer_id: str = Field(..., description="Offer ID of the flight option for which to request a booking link."),

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/maratsarbasov/flights-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server