Skip to main content
Glama
melanieawilson

Rec-MCP

find_campgrounds

Search for campgrounds and camping facilities near a specified city using the Recreation Information Database. Geocodes the location and returns facility details with available images.

Instructions

Find camping facilities near a specified location.

Searches for camping facilities within a customizable radius of a city using the Recreation Information Database (RIDB) API. First geocodes the city to get coordinates, then searches for campgrounds and camping facilities in the surrounding area.

Returns a JSON string containing facility information including any available image URLs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
location_nameYes
radiusNo
limitNo

Implementation Reference

  • The main tool handler function that invokes the helper to find camping near a city and returns formatted JSON.
    def find_campgrounds(location_name: str, radius: int = 25, limit: int = 50 ):
        """Find camping facilities near a specified location.
    
        Searches for camping facilities within a customizable radius of a city using the
        Recreation Information Database (RIDB) API. First geocodes the city to get coordinates,
        then searches for campgrounds and camping facilities in the surrounding area.
    
        Returns a JSON string containing facility information including any available image URLs.
         """
    
        camping_data = find_camping_near_city(location_name, radius=25, limit=10)
        return json.dumps(camping_data, indent=4)
  • ridb_mcp_server.py:8-8 (registration)
    Decorator registering the find_campgrounds function as an MCP tool.
    @mcp.tool("find_campgrounds")
  • Helper function that performs geocoding via Google API and fetches campground data from RIDB API.
    def find_camping_near_city(location_name: str, radius: int = 25, limit: int = 50) -> Optional[Dict[str, Any]]:
        """
        Find camping facilities near a city or location combining geocoding and recreation facility search.
    
        Args:
            location_name (str): Name of a location to search for
            radius (int): Search radius in miles (default: 25)
            limit (int): Maximum number of results to return (default: 50)
    
        Returns:
            Optional[Dict[str, Any]]: Dictionary with facilities data if found, None if error
        """
        # First, get the coordinates for the city
        coordinates = get_city_coordinates(location_name)
    
        if coordinates is None:
            print(f"Could not find coordinates for city: {location_name}")
            return None
    
        latitude, longitude = coordinates
    
        # Then, search for camping facilities near those coordinates
        facilities = get_camping_facilities(latitude, longitude, radius, limit)
    
        if facilities and "RECDATA" in facilities:
            facility_count = len(facilities["RECDATA"])
            print(f"Found {facility_count} camping facilities within {radius} miles of {location_name}")
            return facilities
        else:
            print(f"No camping facilities found within {radius} miles of {location_name}")
            return None
  • Supporting function to geocode the location name to lat/long using Google Maps API.
    def get_city_coordinates(location_name: str) -> Optional[Tuple[float, float]]:
        """
        Get latitude and longitude coordinates for a city using Google Maps Geocoding API.
    
        Args:
            location_name (str): Name of a location to search for.
    
        Returns:
            Optional[Tuple[float, float]]: Tuple of (latitude, longitude) if found, None if not found
    
        Raises:
            requests.RequestException: If there's an error with the API request
        """
        base_url = "https://maps.googleapis.com/maps/api/geocode/json"
    
        params = {
            "key": GOOGLE_API_KEY,
            "address": location_name,
        }
    
        try:
            response = requests.get(base_url, params=params)
            response.raise_for_status()  # Raises an HTTPError for bad responses
    
            data = response.json()
    
            # Check if results were found and status is OK
            if data.get("status") == "OK" and "results" in data and len(data["results"]) > 0:
                # Get the first result
                first_result = data["results"][0]
                location = first_result["geometry"]["location"]
                latitude = location["lat"]
                longitude = location["lng"]
                
                return (latitude, longitude)
              
            else:
                status = data.get("status", "UNKNOWN")
                print(f"No results found for city: {location_name}. Status: {status}")
                return None
    
        except requests.RequestException as e:
            print(f"Error making API request: {e}")
            raise
        except KeyError as e:
            print(f"Unexpected response format: {e}")
            return None
        except Exception as e:
            print(f"Unexpected error: {e}")
            return None
  • Supporting function to query RIDB API for camping facilities near coordinates.
    def get_camping_facilities(latitude: float, longitude: float, radius: int = 25,
                               limit: int = 50, offset: int = 0, activity: str = "CAMPING") -> Optional[Dict[str, Any]]:
        """
        Get camping facilities near given coordinates using Recreation.gov API.
        Args:
            latitude (float): Latitude coordinate
            longitude (float): Longitude coordinate
            radius (int): Search radius in miles (default: 25)
            limit (int): Maximum number of results to return (default: 50)
            offset (int): Number of results to skip (default: 0)
            activity (str): Activity type to search for (default: "CAMPING")
        Returns:
            Optional[Dict[str, Any]]: Dictionary with facilities data if found, None if error
        Raises:
            requests.RequestException: If there's an error with the API request
        """
        # Ensure RIDB_API_KEY is available
        if not RIDB_API_KEY:
            raise ValueError("RIDB_API_KEY is not configured")
        
        base_url = "https://ridb.recreation.gov/api/v1/facilities"
        params = {
            "limit": limit,
            "offset": offset,
            "latitude": latitude,
            "longitude": longitude,
            "radius": radius,
            "activity": activity
        }
        headers = {
            "accept": "application/json",
            "apikey": RIDB_API_KEY
        }
    
        try:
            response = requests.get(base_url, params=params, headers=headers)
            response.raise_for_status()
    
            data = response.json()
    
            if data and "RECDATA" in data:
                return data
    
        except requests.RequestException as e:
            print(f"Error making API request to Recreation.gov: {e}")
            raise
        except Exception as e:
            print(f"Unexpected error: {e}")
            raise  # Re-raise instead of returning None for consistency
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the two-step process (geocoding then searching) and the JSON return format with image URLs, but doesn't cover important aspects like rate limits, authentication requirements, error handling, or whether this is a read-only operation. For a tool that performs external API calls, this represents significant gaps in behavioral transparency.

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 well-structured and reasonably concise. It starts with a clear purpose statement, then explains the two-step process, and ends with information about the return format. Each sentence adds value, though the mention of 'JSON string' could be slightly more precise. The description avoids unnecessary repetition and is appropriately sized for the tool's 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 (3 parameters, external API calls, no output schema), the description provides a basic but incomplete picture. It covers the core functionality and return format but lacks important context about error conditions, rate limits, authentication, and parameter details. Without annotations or output schema, the description should do more to compensate, but only partially succeeds.

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?

With 0% schema description coverage, the description must compensate but only partially succeeds. It mentions 'customizable radius' and 'city' for location, which helps interpret the parameters, but doesn't explain the units for radius (miles/kilometers), the purpose of the limit parameter, or provide examples of valid location_name formats. The description adds some value but doesn't fully compensate for the complete lack of schema 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: 'Find camping facilities near a specified location' using the RIDB API. It specifies the verb 'find' and resource 'camping facilities', and mentions geocoding and searching processes. However, with no sibling tools, it cannot demonstrate differentiation from alternatives, so it doesn't reach the highest 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. It explains what the tool does but offers no context about when it's appropriate, what prerequisites might exist, or when other approaches might be better. With no sibling tools mentioned, this gap is particularly notable.

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/melanieawilson/rec_mcp'

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