app_refresh
Refresh the currently open Chrome app on macOS to apply changes or restart the application.
Instructions
Refresh the currently open app in Chrome.
Only works on macOS with Google Chrome.
Returns:
A dictionary containing the result of the operation
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- main.py:583-613 (handler)The handler function for the 'app_refresh' tool. It is registered via the @mcp.tool() decorator. The function refreshes the active tab in Google Chrome using AppleScript, but only on macOS systems.@mcp.tool() def app_refresh() -> Dict[str, Any]: """ Refresh the currently open app in Chrome. Only works on macOS with Google Chrome. Returns: A dictionary containing the result of the operation """ try: # Check if we're on macOS if os.uname().sysname != "Darwin": return { "success": False, "error": "This function is only available on macOS" } # Use AppleScript to refresh the active tab in Chrome refresh_script = 'tell application "Google Chrome" to tell active tab of front window to reload' # Use Popen instead of run to avoid blocking subprocess.Popen(["osascript", "-e", refresh_script], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) return { "success": True, "message": "App refreshed successfully in Chrome" } except Exception as e: logger.error(f"Error refreshing app: {e}") return {"success": False, "error": f"Failed to refresh app: {str(e)}"}