diagnose_safari_support
Analyze and debug Safari support and accessibility within browser history data to ensure seamless integration and functionality for the client.
Instructions
Diagnose Safari support and accessibility. Useful for debugging Safari integration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server/main.py:97-100 (handler)The main tool handler function for 'diagnose_safari_support', decorated with @mcp.tool() which registers it in the MCP server. It executes the tool logic by calling the check_safari_accessibility helper.@mcp.tool() def diagnose_safari_support() -> Dict[str, Any]: """Diagnose Safari support and accessibility. Useful for debugging Safari integration.""" return check_safari_accessibility()
- server/browser_utils.py:369-406 (helper)Supporting utility function that implements the core diagnostics for Safari support, checking installation, paths, database accessibility, and providing detailed status and recommendations.def check_safari_accessibility() -> Dict[str, Any]: """Check Safari accessibility and provide diagnostics""" result = { "safari_installed": os.path.exists("/Applications/Safari.app"), "profile_path": get_safari_profile_path(), "history_path": PATH_TO_SAFARI_HISTORY, "accessible": False, "error": None, "limitations": "Modern Safari (macOS 10.15+) uses CloudKit for history syncing and has limited programmatic access" } if not result["safari_installed"]: result["error"] = "Safari is not installed" return result if not result["history_path"]: result["error"] = "Safari history database not found" result["recommendation"] = "Consider using Firefox or Chrome for browser history analysis, or export Safari history manually through Safari's interface" return result try: # Try to connect to the database conn = sqlite3.connect(f"file:{result['history_path']}?mode=ro", uri=True) cursor = conn.cursor() cursor.execute("SELECT name FROM sqlite_master WHERE type='table';") tables = [row[0] for row in cursor.fetchall()] conn.close() result["accessible"] = True result["tables"] = tables result["message"] = f"Safari database accessible with {len(tables)} tables" result["note"] = "This may be limited data - modern Safari uses CloudKit for full history syncing" except Exception as e: result["error"] = str(e) result["message"] = "Safari database not accessible" result["recommendation"] = "Modern Safari has limited programmatic access. Consider using Firefox or Chrome for browser history analysis" return result