Skip to main content
Glama

airbnb_listing_details

Retrieve comprehensive Airbnb property details including pricing, amenities, and host information for specific listings with direct booking links.

Instructions

Get detailed information about a specific Airbnb listing. Provide direct links to the user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesThe Airbnb listing ID
checkinNoCheck-in date (YYYY-MM-DD)
checkoutNoCheck-out date (YYYY-MM-DD)
adultsNoNumber of adults
childrenNoNumber of children
infantsNoNumber of infants
petsNoNumber of pets
ignoreRobotsTextNoIgnore robots.txt rules for this request

Implementation Reference

  • Handler function for airbnb_listing_details tool. Fetches listing page, parses the script element to extract structured details, and returns a JSON response.
    async function handleAirbnbListingDetails(params: any) {
      const {
        id,
        checkin,
        checkout,
        adults = 1,
        children = 0,
        infants = 0,
        pets = 0,
        ignoreRobotsText = false,
      } = params;
    
      // Build listing URL
      const listingUrl = new URL(`${BASE_URL}/rooms/${id}`);
      
      // Add query parameters
      if (checkin) listingUrl.searchParams.append("check_in", checkin);
      if (checkout) listingUrl.searchParams.append("check_out", checkout);
      
      // Add guests
      const adults_int = parseInt(adults.toString());
      const children_int = parseInt(children.toString());
      const infants_int = parseInt(infants.toString());
      const pets_int = parseInt(pets.toString());
      
      const totalGuests = adults_int + children_int;
      if (totalGuests > 0) {
        listingUrl.searchParams.append("adults", adults_int.toString());
        listingUrl.searchParams.append("children", children_int.toString());
        listingUrl.searchParams.append("infants", infants_int.toString());
        listingUrl.searchParams.append("pets", pets_int.toString());
      }
    
      // Check if path is allowed by robots.txt
      const path = listingUrl.pathname + listingUrl.search;
      if (!ignoreRobotsText && !isPathAllowed(path)) {
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              error: robotsErrorMessage,
              url: listingUrl.toString()
            }, null, 2)
          }],
          isError: true
        };
      }
    
      const allowSectionSchema: Record<string, any> = {
        "LOCATION_DEFAULT": {
          lat: true,
          lng: true,
          subtitle: true,
          title: true
        },
        "POLICIES_DEFAULT": {
          title: true,
          houseRulesSections: {
            title: true,
            items : {
              title: true
            }
          }
        },
        "HIGHLIGHTS_DEFAULT": {
          highlights: {
            title: true
          }
        },
        "DESCRIPTION_DEFAULT": {
          htmlDescription: {
            htmlText: true
          }
        },
        "AMENITIES_DEFAULT": {
          title: true,
          seeAllAmenitiesGroups: {
            title: true,
            amenities: {
              title: true
            }
          }
        },
        //"AVAILABLITY_CALENDAR_DEFAULT": true,
      };
    
      try {
        const response = await fetchWithUserAgent(listingUrl.toString());
        const html = await response.text();
        const $ = cheerio.load(html);
        
        let details = {};
        
        try {
          const scriptElement = $("#data-deferred-state-0").first();
          const clientData = JSON.parse($(scriptElement).text()).niobeMinimalClientData[0][1];
          const sections = clientData.data.presentation.stayProductDetailPage.sections.sections;
          sections.forEach((section: any) => cleanObject(section));
          details = sections
            .filter((section: any) => allowSectionSchema.hasOwnProperty(section.sectionId))
            .map((section: any) => {
              return {
                id: section.sectionId,
                ...flattenArraysInObject(pickBySchema(section.section, allowSectionSchema[section.sectionId]))
              }
            });
        } catch (e) {
            console.error(e);
        }
    
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              listingUrl: listingUrl.toString(),
              details: details
            }, null, 2)
          }],
          isError: false
        };
      } catch (error) {
        return {
          content: [{
            type: "text",
            text: JSON.stringify({
              error: error instanceof Error ? error.message : String(error),
              listingUrl: listingUrl.toString()
            }, null, 2)
          }],
          isError: true
        };
      }
    }
  • Tool definition including input schema for airbnb_listing_details.
    const AIRBNB_LISTING_DETAILS_TOOL: Tool = {
      name: "airbnb_listing_details",
      description: "Get detailed information about a specific Airbnb listing. Provide direct links to the user",
      inputSchema: {
        type: "object",
        properties: {
          id: {
            type: "string",
            description: "The Airbnb listing ID"
          },
          checkin: {
            type: "string",
            description: "Check-in date (YYYY-MM-DD)"
          },
          checkout: {
            type: "string",
            description: "Check-out date (YYYY-MM-DD)"
          },
          adults: {
            type: "number",
            description: "Number of adults"
          },
          children: {
            type: "number",
            description: "Number of children"
          },
          infants: {
            type: "number",
            description: "Number of infants"
          },
          pets: {
            type: "number",
            description: "Number of pets"
          },
          ignoreRobotsText: {
            type: "boolean",
            description: "Ignore robots.txt rules for this request"
          }
        },
        required: ["id"]
      }
    };
  • index.ts:508-510 (registration)
    Tool registration and request routing in the main CallToolRequest handler.
    case "airbnb_listing_details": {
      return await handleAirbnbListingDetails(request.params.arguments);
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions 'Provide direct links to the user', which hints at output behavior, but doesn't disclose other important traits like whether it's a read-only operation, authentication needs, rate limits, error handling, or what 'detailed information' includes. For a tool with 8 parameters and no annotations, this is insufficient.

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

Conciseness4/5

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

The description is concise with two short sentences that are front-loaded with the main purpose. However, the second sentence 'Provide direct links to the user' could be integrated more smoothly, and there's some room to add necessary context without becoming verbose.

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

Completeness2/5

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

Given the tool has 8 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what 'detailed information' includes, how results are structured, or behavioral aspects like safety or performance. For a data retrieval tool with multiple optional parameters, more context is needed to guide effective use.

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%, so the schema fully documents all 8 parameters. The description adds no parameter-specific information beyond what's in the schema. According to guidelines, when coverage is high (>80%), the baseline is 3 even with no param info in the description.

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

Purpose4/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: 'Get detailed information about a specific Airbnb listing.' It specifies the verb ('Get') and resource ('Airbnb listing'), but doesn't explicitly differentiate from its sibling 'airbnb_search' beyond mentioning 'specific' listing versus search. The description adds 'Provide direct links to the user' which clarifies an output behavior.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus its sibling 'airbnb_search'. It doesn't mention prerequisites, alternatives, or exclusions. The only implied usage is for getting details of a known listing, but this isn't explicitly stated as a guideline.

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/geobio/mcp-server-airbnb'

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