Skip to main content
Glama
vlad-ds

Street View MCP

by vlad-ds

get_metadata

Fetch Street View panorama metadata by location, coordinates, or panorama ID to obtain copyright, date, and geographic information for virtual tours.

Instructions

Fetch metadata about a Street View panorama.

Args: location: The address to check for Street View imagery lat_lng: Comma-separated latitude and longitude (e.g., "40.748817,-73.985428") pano_id: Specific panorama ID to fetch metadata for radius: Search radius in meters when using location or coordinates source: Limit Street View searches to selected sources ("default" or "outdoor")

Returns: Dict: Panorama metadata including status, copyright, date, pano_id, lat, lng

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
locationNo
lat_lngNo
pano_idNo
radiusNo
sourceNodefault

Implementation Reference

  • Handler function for 'get_metadata' tool. Includes @mcp.tool() decorator for registration and input parsing. Delegates core logic to get_panorama_metadata helper.
    @mcp.tool()
    def get_metadata(
        location: Optional[str] = None,
        lat_lng: Optional[str] = None,
        pano_id: Optional[str] = None,
        radius: int = 50,
        source: str = "default",
    ) -> Dict[str, Any]:
        """
        Fetch metadata about a Street View panorama.
        
        Args:
            location: The address to check for Street View imagery
            lat_lng: Comma-separated latitude and longitude (e.g., "40.748817,-73.985428")
            pano_id: Specific panorama ID to fetch metadata for
            radius: Search radius in meters when using location or coordinates
            source: Limit Street View searches to selected sources ("default" or "outdoor")
            
        Returns:
            Dict: Panorama metadata including status, copyright, date, pano_id, lat, lng
        """
        # Parse lat_lng string to tuple if provided
        lat_lng_tuple = None
        if lat_lng:
            try:
                lat, lng = map(float, lat_lng.split(','))
                lat_lng_tuple = (lat, lng)
            except (ValueError, TypeError):
                raise ValueError("Invalid lat_lng format. Use format: '40.714728,-73.998672'")
        
        # Fetch metadata
        return get_panorama_metadata(
            location=location,
            lat_lng=lat_lng_tuple,
            pano_id=pano_id,
            radius=radius,
            source=source,
        )
  • Core implementation of get_metadata logic. Makes HTTP request to Google Street View Metadata API and returns JSON response.
    def get_panorama_metadata(
        location: Optional[str] = None,
        lat_lng: Optional[Tuple[float, float]] = None,
        pano_id: Optional[str] = None,
        radius: int = 50,
        source: str = "default",
    ):
        """
        Fetch metadata about a Street View panorama to check availability.
        
        Args:
            location (str, optional): The address to check for Street View imagery
            lat_lng (tuple, optional): Latitude and longitude coordinates as (lat, lng)
            pano_id (str, optional): Specific panorama ID to fetch metadata for
            radius (int): Search radius in meters (when using location or lat_lng)
            source (str): Limits Street View searches to selected sources (default, outdoor)
            
        Returns:
            dict: Panorama metadata including status, copyright, date, pano_id, lat, lng
            
        Raises:
            ValueError: If no location method is provided or multiple are provided
            Exception: If the API request fails
        """
        # Validate input: exactly one location method must be provided
        location_methods = sum(1 for m in [location, lat_lng, pano_id] if m is not None)
        if location_methods == 0:
            raise ValueError("Must provide one of: location, lat_lng, or pano_id")
        if location_methods > 1:
            raise ValueError("Provide only one of: location, lat_lng, or pano_id")
        
        base_url = "https://maps.googleapis.com/maps/api/streetview/metadata"
        
        params = {
            "radius": radius,
            "source": source,
            "key": API_KEY,
        }
        
        # Set the location parameter based on what was provided
        if location:
            params["location"] = location
        elif lat_lng:
            params["location"] = f"{lat_lng[0]},{lat_lng[1]}"
        elif pano_id:
            params["pano"] = pano_id
            # Remove radius when using pano_id as it's not applicable
            if "radius" in params:
                del params["radius"]
        
        response = requests.get(base_url, params=params)
        
        if response.status_code == 200:
            return response.json()
        else:
            raise Exception(f"Error fetching Street View metadata: {response.status_code}")
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 this is a 'fetch' operation but doesn't clarify whether it's read-only, requires authentication, has rate limits, or what happens with invalid inputs. The description mentions what the tool returns but lacks behavioral context about error handling, performance, or side effects.

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 with clear sections (purpose statement, Args, Returns) and efficiently conveys necessary information. The purpose statement is front-loaded, and each parameter explanation earns its place. Minor verbosity in the Returns section could be tightened, but overall it's appropriately sized.

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?

For a 5-parameter tool with no annotations and no output schema, the description provides adequate coverage of parameters and return values. However, it lacks important contextual information about authentication requirements, error conditions, rate limits, and how it differs from sibling tools. The return format description is helpful but could be more detailed given the absence of an output schema.

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

Parameters4/5

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

With 0% schema description coverage, the description compensates well by explaining all 5 parameters in the Args section. It provides meaningful context about what each parameter does (e.g., 'Search radius in meters when using location or coordinates'), including examples and default values. This adds substantial value beyond the bare schema.

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: 'Fetch metadata about a Street View panorama.' It specifies the verb ('fetch') and resource ('metadata about a Street View panorama'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_street_view' (which likely retrieves the actual imagery rather than metadata).

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 doesn't mention sibling tools like 'get_street_view' or explain scenarios where metadata fetching is preferred over retrieving the actual Street View image. The parameter descriptions imply usage contexts but don't offer explicit when-to-use guidance.

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/vlad-ds/street-view-mcp'

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