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
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Input Schema (JSON Schema)
{
"$defs": {
"OfferDetails": {
"description": "Model for getting detailed offer information.",
"properties": {
"offer_id": {
"description": "The ID of the offer to get details for",
"title": "Offer Id",
"type": "string"
}
},
"required": [
"offer_id"
],
"title": "OfferDetails",
"type": "object"
}
},
"properties": {
"params": {
"$ref": "#/$defs/OfferDetails"
}
},
"required": [
"params"
],
"title": "get_offer_detailsArguments",
"type": "object"
}
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