Skip to main content
Glama

analyzeListingPhotos

Analyze Airbnb listing photos to assess property quality and features for informed booking decisions.

Instructions

Analyze photos from an Airbnb listing

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesAirbnb listing ID

Implementation Reference

  • Handler logic for the 'analyzeListingPhotos' tool. Extracts photos using extractListingPhotos, formats analysis prompt, and returns structured JSON response.
    if (toolName === 'analyzeListingPhotos') {
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              success: photos.extractionSuccess,
              photoCount: photos.photoCount,
              analysisPrompt: formatPhotosForAnalysis(photos),
              photoUrls: photos.photoUrls,
            }),
          },
        ],
        isError: !photos.extractionSuccess,
      };
    }
  • Schema definition for the analyzeListingPhotos tool, including name, description, and input schema requiring 'id'.
      {
        name: 'analyzeListingPhotos',
        description: 'Analyze photos from an Airbnb listing',
        inputSchema: {
          type: 'object',
          properties: {
            id: { type: 'string', description: 'Airbnb listing ID' },
          },
          required: ['id'],
        },
      },
    ];
  • index.ts:666-670 (registration)
    Registration and dispatch in the main tool call handler switch statement, routing analyzeListingPhotos calls to handlePhotoAnalysisTool.
    case "getListingPhotos":
    case "analyzeListingPhotos": {
      result = await handlePhotoAnalysisTool(request.params.name, request.params.arguments);
      break;
    }
  • index.ts:137-141 (registration)
    Tool registration by including photoAnalysisTools (containing analyzeListingPhotos schema) in the main AIRBNB_TOOLS list used for ListTools response.
    const AIRBNB_TOOLS = [
      AIRBNB_SEARCH_TOOL,
      AIRBNB_LISTING_DETAILS_TOOL,
      ...photoAnalysisTools,
    ];
  • Core helper function extractListingPhotos that fetches the listing page and parses photo URLs using cheerio.
    export async function extractListingPhotos(listingId: string) {
      try {
        const url = `https://www.airbnb.com/rooms/${listingId}`;
        const response = await fetch(url, {
          headers: { 'User-Agent': 'Mozilla/5.0' },
        });
    
        if (!response.ok) throw new Error(`HTTP ${response.status}`);
    
        const html = await response.text();
        const $ = cheerio.load(html);
        const photoUrls: string[] = [];
    
        $('img[src*="airbnb"]').each((_: any, el: any) => {
          const src = $(el).attr('src');
          const alt = $(el).attr('alt');
          if (src && alt?.includes('photo') && photoUrls.length < 50) {
            if (!photoUrls.includes(src)) photoUrls.push(src);
          }
        });
    
        return {
          listingId,
          photoUrls,
          photoCount: photoUrls.length,
          extractionSuccess: photoUrls.length > 0,
          timestamp: new Date().toISOString(),
        };
      } catch (error) {
        return {
          listingId,
          photoUrls: [],
          photoCount: 0,
          extractionSuccess: false,
          error: (error instanceof Error ? error.message : 'Unknown error'),
          timestamp: new Date().toISOString(),
        };
      }
    }
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the tool analyzes photos but doesn't describe what the analysis entails (e.g., returns scores, detects objects), potential side effects (e.g., rate limits, data processing), or output format. This is a significant gap for a tool with no structured behavioral hints.

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 a single, efficient sentence that directly states the tool's function without unnecessary words. It is appropriately sized for a simple tool, though it could be more front-loaded with key details like analysis type. There's no wasted text, earning a high score for conciseness.

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 no annotations, no output schema, and a simple input schema, the description is incomplete. It doesn't explain what the analysis returns, how results are structured, or any behavioral traits like error handling. For a tool that presumably performs non-trivial photo analysis, this leaves critical gaps in understanding its operation.

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?

The schema description coverage is 100%, with the single parameter 'id' documented as 'Airbnb listing ID'. The description doesn't add any meaning beyond this, such as format examples or constraints. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, though no extra value is added.

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

Purpose3/5

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

The description states the action ('analyze') and resource ('photos from an Airbnb listing'), which provides a basic understanding of purpose. However, it lacks specificity about what analysis is performed (e.g., quality assessment, content detection) and doesn't distinguish from sibling tools like 'getListingPhotos' that might retrieve photos without analysis. This makes it vague but not tautological.

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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites, context (e.g., after fetching listing details), or comparisons to siblings like 'airbnb_listing_details' or 'getListingPhotos'. This leaves the agent without direction on appropriate usage scenarios.

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

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