diagnose_safari_support
Diagnose Safari browser support and accessibility to debug integration issues with browser history analysis tools.
Instructions
Diagnose Safari support and accessibility. Useful for debugging Safari integration.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- server/main.py:97-100 (handler)MCP tool handler for 'diagnose_safari_support'. Decorated with @mcp.tool() for registration and execution. Delegates to check_safari_accessibility() helper function.
@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)Core diagnostic function that checks Safari installation, profile and history paths, attempts database connection, lists available tables, and provides detailed accessibility 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