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
| Name | Required | Description | Default |
|---|---|---|---|
| offer_id | Yes | Offer ID of the flight option for which to request a booking link. | |
| search_id | Yes | Search 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
- src/flights-mcp/main.py:196-212 (handler)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()
- src/flights-mcp/main.py:193-195 (registration)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.")
- src/flights-mcp/main.py:197-198 (schema)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."),