Skip to main content
Glama
clockworked247

Flight + Stay Search MCP

get_offer_details

Retrieve detailed flight offer information including pricing, itinerary, and conditions using a unique offer identifier.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
offerIdYesUnique identifier for the flight offer

Implementation Reference

  • The async handler function that executes the tool logic: fetches offer details via flightClient.getOffer and returns formatted JSON response.
    async (params: OfferDetails) => {
      try {
        const response = await flightClient.getOffer(params.offerId);
        
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(response, null, 2)
            }
          ]
        };
        
      } catch (error) {
        console.error(`Error getting offer details: ${error}`);
        throw error;
      }
    }
  • src/server.ts:117-137 (registration)
    The server.tool registration for the 'get_offer_details' tool, including name, schema, and handler.
      'get_offer_details',
      offerDetailsSchema.shape,
      async (params: OfferDetails) => {
        try {
          const response = await flightClient.getOffer(params.offerId);
          
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(response, null, 2)
              }
            ]
          };
          
        } catch (error) {
          console.error(`Error getting offer details: ${error}`);
          throw error;
        }
      }
    );
  • Zod schema and TypeScript type definition for the tool's input parameters (offerId).
    export const offerDetailsSchema = z.object({
      offerId: z.string().describe('Unique identifier for the flight offer')
    });
    
    export type OfferDetails = z.infer<typeof offerDetailsSchema>;
  • Supporting method in DuffelClient class that makes the actual Duffel API call to retrieve offer details by ID.
    async getOffer(offerId: string): Promise<any> {
      try {
        if (!offerId.startsWith('off_')) {
          throw new Error('Invalid offer ID format - must start with "off_"');
        }
        
        const response = await this.client.get(`/offers/${offerId}`);
        return response.data;
        
      } catch (error) {
        console.error(`Error getting offer ${offerId}: ${error}`);
        throw error;
      }
    }

Tool Definition Quality

Score is being calculated. Check back soon.

Install Server

Other 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/clockworked247/flights-mcp-ts'

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