Skip to main content
Glama
alt250

Famxplor Family Travel Activities

by alt250

search_family_activities

Find family-friendly travel activities near your location based on specific interests and distance preferences.

Instructions

Retrieves family activities that are geographically close to the specified location.

Args:
    latitude (float): Latitude of the location.
    longitude (float): Longitude of the location.
    max_dist (float): Maximum distance from the provided coordinates in meters.
    user_query (str): The precise user's query for which activities are being searched. Used to return relevant activities.

Returns:
    str: A formatted string containing the information of the family activities. Each activity has a title, more info URL, image URL, and location.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
latYes
lonYes
max_distYes
user_queryYes

Implementation Reference

  • server.py:60-91 (handler)
    The main handler function for the 'search_family_activities' tool. It takes lat, lon, max_dist, user_query; calls the Famxplor API; handles response; formats activities using the helper; returns formatted string.
    async def search_family_activities(lat: float, lon: float, max_dist: float, user_query: str) -> str:
        """
        Retrieves family activities that are geographically close to the specified location.
    
        Args:
            latitude (float): Latitude of the location.
            longitude (float): Longitude of the location.
            max_dist (float): Maximum distance from the provided coordinates in meters.
            user_query (str): The precise user's query for which activities are being searched. Used to return relevant activities.
    
        Returns:
            str: A formatted string containing the information of the family activities. Each activity has a title, more info URL, image URL, and location.
        """
        logging.info(f"search_family_activities lat={lat} lon={lon} max_dist={max_dist} user_query='{user_query}'")
    
        url = f"{CONFIG.api_base}/v1/nearest-activities"
        params = {
            "lat": lat,
            "lon": lon,
            "max_distance": max_dist
        }
        data = await make_famxplor_request(url, params)
    
        if not data or "activities" not in data:
            return "Unable to fetch activities."
    
        if not data["activities"]:
            return "No activities found for this location."
    
        activities = [format_activity(activity) for activity in data["activities"]]
        return "\n---\n".join(activities)
  • server.py:59-59 (registration)
    Registers the search_family_activities function as an MCP tool using the FastMCP @mcp.tool() decorator.
    @mcp.tool()
  • Docstring schema defining input arguments (lat, lon, max_dist, user_query) and output format for the tool.
    """
    Retrieves family activities that are geographically close to the specified location.
    
    Args:
        latitude (float): Latitude of the location.
        longitude (float): Longitude of the location.
        max_dist (float): Maximum distance from the provided coordinates in meters.
        user_query (str): The precise user's query for which activities are being searched. Used to return relevant activities.
    
    Returns:
        str: A formatted string containing the information of the family activities. Each activity has a title, more info URL, image URL, and location.
    """
  • Helper function to format a single activity dictionary into a multi-line string with title, URL, image, location.
    def format_activity(activity: dict) -> str:
        """Format an activity into a readable string."""
        return (
            f"Title: {activity.get('title', 'No title')}\n"
            f"More info URL: {activity.get('url', 'No URL')}\n"
            f"Image URL: {activity.get('img_url', 'No image')}\n"
            f"Location: ({activity.get('lat', 0)}, {activity.get('lon', 0)})\n"
        )
  • Helper function to make authenticated POST requests to the Famxplor API, handling errors and returning JSON or None.
    async def make_famxplor_request(url: str, json: Any) -> dict[str, Any] | None:
        """Make a request to the Famxplor API with proper error handling."""
        headers = {
            "User-Agent": USER_AGENT,
            "Accept": "application/json",
            "api-key": CONFIG.api_key,
        }
        async with httpx.AsyncClient() as client:
            try:
                response = await client.post(url, headers=headers, timeout=30.0, json=json)
                response.raise_for_status()
                return response.json()
            except Exception as e:
                print(f"Error during Famxplor API request: {e}", file=sys.stderr)
                traceback.print_exc(file=sys.stderr)
                return None
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 the tool retrieves activities based on location and a user query, but lacks details on permissions, rate limits, error handling, or what happens if no activities are found. For a retrieval tool with zero annotation coverage, this leaves significant behavioral gaps.

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 well-structured and front-loaded with the core purpose, followed by clear sections for arguments and returns. Each sentence adds value: the first explains the tool's function, and the subsequent lines detail parameters and output without redundancy. It's appropriately sized for the complexity.

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

Completeness3/5

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

Given the tool's moderate complexity (4 parameters, no annotations, no output schema), the description is partially complete. It covers the purpose and parameters well, but lacks behavioral details like error handling or output format specifics beyond a brief mention. Without annotations or output schema, more context would improve completeness.

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

Parameters5/5

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

The description adds substantial meaning beyond the input schema, which has 0% description coverage. It explains all four parameters: latitude and longitude specify the location, max_dist defines the search radius in meters, and user_query is the precise query for relevance. This fully compensates for the schema's lack of descriptions.

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: 'Retrieves family activities that are geographically close to the specified location.' It uses specific verbs ('retrieves') and resources ('family activities'), and defines the geographic scope. However, with no sibling tools mentioned, there's no opportunity to differentiate from alternatives, preventing a perfect score.

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 alternatives, prerequisites, or exclusions. It only states what the tool does, without context for its application. With no sibling tools, it could implicitly suggest this is the only option, but explicit usage scenarios are missing.

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/alt250/famxplor-family-travel-mcp-server'

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