Skip to main content
Glama
pab1it0

Tripadvisor MCP

get_location_photos

Retrieve photos for a specific Tripadvisor location to visualize destinations before visiting or planning trips.

Instructions

Get photos for a specific location

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationIdYes
languageNoen

Implementation Reference

  • The main asynchronous handler function for the 'get_location_photos' tool. It is registered via the @mcp.tool decorator and fetches photos from the Tripadvisor API for a given location ID.
    @mcp.tool(description="Get photos for a specific location")
    async def get_location_photos(
        locationId: Union[str, int],
        language: str = "en",
    ) -> Dict[str, Any]:
        """
        Get high-quality photos for a specific location.
        
        Parameters:
        - locationId: Tripadvisor location ID (can be string or integer)
        - language: Language code (default: 'en')
        """
        params = {
            "language": language,
        }
        
        # Convert locationId to string to ensure compatibility
        location_id_str = str(locationId)
        
        return await make_api_request(f"location/{location_id_str}/photos", params)
  • Helper utility function used by the get_location_photos handler (and other tools) to perform authenticated HTTP GET requests to the Tripadvisor Content API.
    async def make_api_request(endpoint: str, params: Dict[str, Any] = None) -> Dict[str, Any]:
        """Make a request to the Tripadvisor Content API"""
        if not config.api_key:
            raise ValueError("Tripadvisor API key is missing. Please set TRIPADVISOR_API_KEY environment variable.")
        
        url = f"{config.base_url}/{endpoint}"
        headers = {
            "accept": "application/json"
        }
    
        if params is None:
            params = {}
        params["key"] = config.api_key
        
        async with httpx.AsyncClient() as client:
            response = await client.get(url, headers=headers, params=params)
            response.raise_for_status()
            return response.json()
Behavior1/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It only states the basic action without mentioning permissions, rate limits, pagination, response format, or whether it's read-only or has side effects. This leaves critical operational details unspecified for a tool with parameters.

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 a single, clear sentence with no wasted words. It's front-loaded and efficiently conveys the core purpose without unnecessary elaboration, making it easy to parse quickly.

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 complexity (2 parameters, no annotations, no output schema), the description is incomplete. It doesn't cover parameter meanings, behavioral aspects like safety or output, or usage context. For a tool that fetches data, more details on what to expect and how to use it are needed for effective agent operation.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate by explaining parameters. It doesn't mention 'locationId' or 'language' at all, leaving both parameters undocumented. The description adds no meaning beyond the schema, failing to clarify what 'locationId' refers to or how 'language' affects results.

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 'Get photos for a specific location' clearly states the action (get) and resource (photos for a location), but it's vague about scope (e.g., number of photos, types, or source). It doesn't differentiate from siblings like 'get_location_details' or 'get_location_reviews', which also fetch location-related data but for different resources.

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. For example, it doesn't specify if this is for visual content versus textual details (vs. get_location_details) or reviews (vs. get_location_reviews), or when to prefer search tools like search_locations. The description lacks any context for selection among siblings.

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/pab1it0/tripadvisor-mcp'

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