get_offer_details
Retrieve comprehensive details about a specific flight offer to facilitate informed travel decisions, using the unique offer ID for accurate results.
Instructions
Get detailed information about a specific flight offer.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Implementation Reference
- src/flights/services/search.py:192-204 (handler)The handler function for the 'get_offer_details' tool, decorated with @mcp.tool() for registration. It retrieves detailed offer information using the Duffel API client and returns formatted JSON.async def get_offer_details(params: OfferDetails) -> str: """Get detailed information about a specific flight offer.""" try: async with flight_client as client: response = await client.get_offer( offer_id=params.offer_id ) return json.dumps(response, indent=2) except Exception as e: logger.error(f"Error getting offer details: {str(e)}", exc_info=True) raise
- src/flights/models/offers.py:5-7 (schema)Pydantic model defining the input schema for the get_offer_details tool, consisting of a single required offer_id field.class OfferDetails(BaseModel): """Model for getting detailed offer information.""" offer_id: str = Field(..., description="The ID of the offer to get details for")
- src/flights/server.py:4-4 (registration)Import of the FastMCP server instance from services.search.py, which loads and registers the tool handlers via their decorators.from .services.search import mcp