Skip to main content
Glama
hhw67865

TripAdvisor Vacation Planner MCP Server

by hhw67865

get_location_details_tool

Retrieve essential location details by ID to support trip planning decisions with TripAdvisor data.

Instructions

Get essential details about a location by ID for trip planning

Args:
    location_id: TripAdvisor location ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
location_idYes

Implementation Reference

  • The main handler function for the 'get_location_details_tool' tool. It is registered using the @mcp.tool() decorator and implements the logic to fetch location details from the TripAdvisor API, extracting essential information like name, description, hours, rating, and address.
    @mcp.tool()
    async def get_location_details_tool(location_id: int) -> str:
        """
        Get essential details about a location by ID for trip planning
        
        Args:
            location_id: TripAdvisor location ID
        """
        # Get basic details
        full_details = await tripadvisor_api_request(f"location/{location_id}/details")
        
        # Extract only the essential information for itinerary planning
        if "error" not in full_details:
            essential_details = {
                "name": full_details.get("name"),
                "description": full_details.get("description"),
                "hours": full_details.get("hours", {}).get("weekday_text", []),
                "rating": full_details.get("rating"),
                "address": full_details.get("address_obj", {}).get("address_string"),
            }
            
            return json.dumps(essential_details, indent=2)
        else:
            return json.dumps(full_details, indent=2)  # Return error as is

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

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