Skip to main content
Glama
dumyCq

Jinko Hotel Booking MCP Server

by dumyCq

book-hotel

Complete hotel bookings by generating a secure payment link. Requires hotel ID, rate ID, and session ID. Displays booking details and payment link for user confirmation.

Instructions

Initiate a hotel booking process for a specific hotel and rate option.

IMPORTANT WORKFLOW:

  1. Before calling this tool, you MUST present a specific hotel's all available rate options to the user using get-hotel-details

  2. The user MUST select a specific rate option they want to book

  3. This tool will generate a secure payment link that the user needs to open in their browser to complete the booking

The response includes a payment_link that must be prominently displayed to the user, along with booking details such as hotel name, check-in/out dates, and total price.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hotel_idYesID of the hotel to book
rate_idYesID of the specific rate option the user has selected
session_idYesThe session ID from a previous search

Implementation Reference

  • The bookHotel function implements the core logic for booking a hotel. It schedules a booking quote via API, polls for status, generates a payment link, and returns formatted booking details or processing status.
    export async function bookHotel(params: { session_id: string, hotel_id: string; rate_id: string }) {
        // Create quote request
        const quoteRequest = {
          products: [
            {
              product_type: "hotel",
              hotel_id: params.hotel_id,
              search_session_id: params.session_id,
              rate_id: params.rate_id,
            },
          ],
        };
      
        // Schedule quote
        const scheduleResponse = await makeApiRequest<any>(
          "/api/v1/booking/quote/schedule",
          "POST",
          quoteRequest
        );
      
        if (!scheduleResponse || !scheduleResponse.reference) {
          return createYamlResponse({
            status: "error",
            message: "Failed to schedule quote. Please try again later."
          });
        }
      
        const quoteId = scheduleResponse.reference;
      
        // Poll for quote status
        const quoteResult = await pollForQuoteStatus(quoteId);
      
          // Format quote information
        const paymentLink = `https://app.jinko.so/checkout/${quoteId}`;
      
        if (!quoteResult) {
          return createYamlResponse({
            status: "processing",
            message: `Your booking request is being processed. Please inform the user that they can proceed to complete their booking using the payment link provided below. The booking details will be finalized during the payment process.`,
            payment_link: paymentLink,
            quote_id: quoteId
          });
        }
      
        let productInfo = {
          status: "success",
          action: "N/A",
          hotel: "Unknown hotel",
          check_in: "N/A",
          check_out: "N/A",
          total_price: "N/A",
          payment_link: paymentLink,
          quote_id: quoteId
        };
      
        if (quoteResult.quoted_products && quoteResult.quoted_products.length > 0) {
          const product = quoteResult.quoted_products[0];
          productInfo = {
            status: "success",
            action: "IMPORTANT: Present the payment_link to the user so they can complete their booking by clicking the link and processing payment.",
            hotel: product.hotel_name || "Unknown hotel",
            check_in: product.check_in_date,
            check_out: product.check_out_date,
            total_price: `${product.rate_info.selling_price?.amount || "N/A"} ${product.rate_info.selling_price?.currency || "USD"}`,
            payment_link: paymentLink,
            quote_id: quoteId
          };
        }
      
        return createYamlResponse(productInfo);
    }
  • Zod input schema defining parameters for the book-hotel tool: session_id, hotel_id, and rate_id.
    {
      session_id: z.string().describe("The session ID from a previous search"),
      hotel_id: z.string().describe("ID of the hotel to book"),
      rate_id: z.string().describe("ID of the specific rate option the user has selected"),
    },
  • Registration of the 'book-hotel' tool on the MCP server, specifying name, description, input schema, and handler (with telemetry instrumentation).
    server.tool(
      "book-hotel",
      `Initiate a hotel booking process for a specific hotel and rate option.
    
    IMPORTANT WORKFLOW:
    1. Before calling this tool, you MUST present a specific hotel's all available rate options to the user using get-hotel-details
    2. The user MUST select a specific rate option they want to book
    3. This tool will generate a secure payment link that the user needs to open in their browser to complete the booking
    
    The response includes a payment_link that must be prominently displayed to the user, along with
    booking details such as hotel name, check-in/out dates, and total price.
    `,
      {
        session_id: z.string().describe("The session ID from a previous search"),
        hotel_id: z.string().describe("ID of the hotel to book"),
        rate_id: z.string().describe("ID of the specific rate option the user has selected"),
      },
      getTelemetry().telemetryMiddleware.instrumentTool("book-hotel", bookHotel),
    );
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: the tool generates a secure payment link (not completing the booking), requires user action in a browser, and returns specific booking details. It doesn't mention error conditions or rate limits, but covers the core transactional behavior well.

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

Conciseness5/5

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

The description is well-structured with clear sections: purpose statement, numbered workflow steps, and response handling. Every sentence adds value - the workflow steps are essential guidance, and the response details ensure proper user interaction. No wasted words or redundancy.

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

Completeness4/5

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

For a booking tool with no annotations and no output schema, the description provides strong context about the workflow, user interaction requirements, and response expectations. It could be more complete by mentioning error cases or confirmation mechanisms, but covers the essential transactional nature and user workflow adequately.

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

Parameters3/5

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

Schema description coverage is 100%, providing good parameter documentation. The description adds context about parameter relationships (rate_id comes from user selection after get-hotel-details, session_id from previous search) but doesn't provide additional semantic details beyond what the schema already describes. This meets the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the tool's purpose with specific verbs ('initiate a hotel booking process') and resources ('specific hotel and rate option'). It distinguishes from sibling tools like 'get-hotel-details' by focusing on booking initiation rather than information retrieval.

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

Usage Guidelines5/5

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

The description provides explicit workflow guidance: it specifies when to use this tool (after presenting rate options via 'get-hotel-details' and user selection), when not to use it (without those prerequisites), and names the alternative tool ('get-hotel-details') for the prerequisite step.

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

Related 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/dumyCq/jinko-mcp'

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