open_image_locally
Access and view saved Street View images by opening them directly in your system’s default application. Verify and manage local image files with ease using this tool.
Instructions
Open a saved Street View image in the default application.
Args: filename: The filename of the image to open (must exist in output directory)
Returns: Dict: A status message indicating success or failure
Raises: ValueError: If the file doesn't exist in the output directory
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes |
Implementation Reference
- src/street_view_mcp/server.py:127-127 (registration)Registers the 'open_image_locally' tool with the FastMCP server using the @mcp.tool() decorator.@mcp.tool()
- src/street_view_mcp/server.py:128-152 (handler)Executes the tool logic: checks if the image file exists in the output directory, converts it to an absolute URI, opens it in the default local application using webbrowser.open, and returns a success status.def open_image_locally(filename: str) -> Dict[str, str]: """ Open a saved Street View image in the default application. Args: filename: The filename of the image to open (must exist in output directory) Returns: Dict: A status message indicating success or failure Raises: ValueError: If the file doesn't exist in the output directory """ # Check if file exists image_path = OUTPUT_DIR / filename if not image_path.exists(): raise ValueError(f"Image file '{filename}' does not exist in the output directory") # Convert to absolute path abs_path = image_path.absolute().as_uri() # Open in local application webbrowser.open(abs_path) return {"status": "success", "message": f"Opened {filename} in default application"}