Skip to main content
Glama
clockworked247

Flight + Stay Search MCP

search_stays

Find and compare hotel stays by entering location, dates, guest count, and room requirements to identify suitable accommodations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationYesCity, airport code, or area to search for stays
check_in_dateYesCheck-in date (YYYY-MM-DD)
check_out_dateYesCheck-out date (YYYY-MM-DD)
guestsYesNumber of guests
roomsNoNumber of rooms
radius_kmNoSearch radius in kilometers

Implementation Reference

  • The MCP server.tool registration and inline handler function for the 'search_stays' tool. It receives parameters validated by staySearchSchema and delegates the search to DuffelStaysClient.searchOffers, returning the JSON-formatted response.
      'search_stays',
      staySearchSchema.shape,
      async (params: StaySearch) => {
        try {
          const response = await staysClient.searchOffers(params);
          return {
            content: [
              {
                type: 'text',
                text: JSON.stringify(response, null, 2)
              }
            ]
          };
        } catch (error) {
          console.error(`Error searching stays: ${error}`);
          throw error;
        }
      }
    );
  • Zod schema defining the input parameters for the search_stays tool, including location, dates, guests, etc.
    export const staySearchSchema = z.object({
      location: z.string().describe('City, airport code, or area to search for stays'),
      check_in_date: z.string().describe('Check-in date (YYYY-MM-DD)'),
      check_out_date: z.string().describe('Check-out date (YYYY-MM-DD)'),
      guests: z.number().int().min(1).describe('Number of guests'),
      rooms: z.number().int().min(1).optional().describe('Number of rooms'),
      radius_km: z.number().optional().describe('Search radius in kilometers'),
    });
  • The core searchOffers method in DuffelStaysClient that makes the HTTP POST request to Duffel's Stays API (/offers endpoint) and processes the response into a standardized StayOfferResponse format.
    async searchOffers(params: StaySearchParams): Promise<StayOfferResponse> {
      // Duffel API docs: https://duffel.com/docs/api/v2/offers
      const response = await this.client.post('/offers', {
        location: params.location,
        check_in_date: params.check_in_date,
        check_out_date: params.check_out_date,
        guests: params.guests,
        rooms: params.rooms,
        radius_km: params.radius_km,
      });
      // Adapt to Duffel's real response structure
      const offers = (response.data.data || []).map((offer: any) => ({
        offer_id: offer.id,
        hotel_id: offer.hotel?.id || '',
        hotel_name: offer.hotel?.name || '',
        address: offer.hotel?.address?.line_1 || '',
        price: offer.total_amount ? { amount: offer.total_amount, currency: offer.currency } : { amount: '', currency: '' },
        room_type: offer.room_type || '',
        cancellation_policy: offer.cancellation_policy || '',
      }));
      return { offers };
    }
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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