open_uri
Initiate actions on an Android device by opening a specified URI directly, enabling quick access to resources or functionalities.
Instructions
Open a URI on the connected Android device
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uri | Yes |
Implementation Reference
- src/espresso_mcp/server.py:89-99 (handler)The handler function for the 'open_uri' tool. It is decorated with @mcp.tool(), which registers it with the FastMCP server. The function executes an adb shell command to open the specified URI on the connected Android device, returning a success message or raising an error.@mcp.tool() def open_uri(uri: str) -> str: """Open a URI on the connected Android device""" result = subprocess.run( ["adb", "shell", "am", "start", "-a", "android.intent.action.VIEW", "-d", uri], capture_output=True, text=True, ) if result.returncode != 0: raise RuntimeError(f"Error opening URI '{uri}': {result.stderr}") return f"URI '{uri}' has been opened successfully."