Skip to main content
Glama
dumyCq

Jinko Hotel Booking MCP Server

by dumyCq

get-facilities

Retrieve facility IDs for hotel amenities like pet-friendly, WiFi, and pools. Use these IDs with the search-hotels tool to filter hotels based on user requirements. Essential for accurate hotel searches.

Instructions

IMPORTANT: ALWAYS USE THIS TOOL FIRST when a user mentions ANY specific hotel amenities or requirements.

This tool must be called BEFORE search-hotels whenever the user mentions requirements like:

  • Pet-friendly or traveling with pets/dogs/cats

  • WiFi or internet access

  • Swimming pools

  • Parking (free or paid)

  • Air conditioning or heating

  • Fitness center or gym

  • Restaurant or room service

  • Family rooms

  • Non-smoking rooms

  • Any other specific hotel features

The tool returns facility IDs that MUST be used with the search-hotels tool's facilities parameter to properly filter hotels. Without using this tool first, searches will not correctly filter for user-requested amenities.

Example workflow:

  1. User asks for "pet-friendly hotels in Paris"

  2. Call get-facilities to find the facility_id for "Pets allowed"

  3. Use that facility_id in the search-hotels facilities parameter

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
languageNoLanguage code for facility names (en, es, it, he, ar, de)en

Implementation Reference

  • The async handler function for the 'get-facilities' tool. Fetches facilities data for the specified language using getFacilitiesByLanguage, parses the JSON response, and returns a formatted success or error message with the facilities list.
      async (params) => {
        const lang = params.language || "en";
        // Create a mock URL for the getFacilitiesByLanguage function
        const uri = new URL(`hotel://facilities/${lang}`);
        const result = await getFacilitiesByLanguage(uri, lang);
        
        // Extract the facilities from the result
        let facilities = [];
        try {
          facilities = JSON.parse(result.contents[0].text);
        } catch (e) {
          return {
            content: [{
              type: "text",
              text: JSON.stringify({
                status: "error",
                message: "Failed to parse facilities data"
              })
            }]
          };
        }
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              status: "success",
              facilities: facilities,
              message: `Retrieved ${facilities.length} hotel facilities in ${lang} language. 
    IMPORTANT: You MUST identify the facility_id values that match the user's requirements and include them in the facilities parameter of the search-hotels tool. 
    For example, if the user wants pet-friendly hotels, find the facility_id for "Pets allowed" in this list and include it in your search-hotels call.`
            })
          }]
        };
      }
  • The Zod input schema for the 'get-facilities' tool defining the optional 'language' parameter.
    {
      language: z.string().default("en").describe("Language code for facility names (en, es, it, he, ar, de)"),
    },
  • The server.tool call registering the 'get-facilities' tool, including its name, detailed description instructing usage before searches, input schema, and inline handler implementation.
    server.tool(
      "get-facilities",
      `IMPORTANT: ALWAYS USE THIS TOOL FIRST when a user mentions ANY specific hotel amenities or requirements.
    
    This tool must be called BEFORE search-hotels whenever the user mentions requirements like:
    - Pet-friendly or traveling with pets/dogs/cats
    - WiFi or internet access
    - Swimming pools
    - Parking (free or paid)
    - Air conditioning or heating
    - Fitness center or gym
    - Restaurant or room service
    - Family rooms
    - Non-smoking rooms
    - Any other specific hotel features
    
    The tool returns facility IDs that MUST be used with the search-hotels tool's facilities parameter
    to properly filter hotels. Without using this tool first, searches will not correctly filter for 
    user-requested amenities.
    
    Example workflow:
    1. User asks for "pet-friendly hotels in Paris"
    2. Call get-facilities to find the facility_id for "Pets allowed"
    3. Use that facility_id in the search-hotels facilities parameter
    `,
      {
        language: z.string().default("en").describe("Language code for facility names (en, es, it, he, ar, de)"),
      },
      async (params) => {
        const lang = params.language || "en";
        // Create a mock URL for the getFacilitiesByLanguage function
        const uri = new URL(`hotel://facilities/${lang}`);
        const result = await getFacilitiesByLanguage(uri, lang);
        
        // Extract the facilities from the result
        let facilities = [];
        try {
          facilities = JSON.parse(result.contents[0].text);
        } catch (e) {
          return {
            content: [{
              type: "text",
              text: JSON.stringify({
                status: "error",
                message: "Failed to parse facilities data"
              })
            }]
          };
        }
        
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              status: "success",
              facilities: facilities,
              message: `Retrieved ${facilities.length} hotel facilities in ${lang} language. 
    IMPORTANT: You MUST identify the facility_id values that match the user's requirements and include them in the facilities parameter of the search-hotels tool. 
    For example, if the user wants pet-friendly hotels, find the facility_id for "Pets allowed" in this list and include it in your search-hotels call.`
            })
          }]
        };
      }
    );
  • Helper function loadFacilitiesData that loads the hotel facilities data from facilities.json file, used indirectly by the getFacilitiesByLanguage function called in the tool handler.
    export function loadFacilitiesData(): any[] {
      try {
        if (fs.existsSync(FACILITIES_PATH)) {
          const data = fs.readFileSync(FACILITIES_PATH, "utf-8");
          return JSON.parse(data);
        } else {
          console.warn("facilities.json not found at:", FACILITIES_PATH);
        }
      } catch (error) {
        console.error("Error loading facilities data:", error);
      }
      return []; // Return empty array on error or if file not found
    }
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