safari_navigate
Directs Safari to a specified URL using a session identifier, enabling browser automation for accessing and monitoring web content efficiently.
Instructions
Navigate to a URL in Safari
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sessionId | Yes | Session identifier | |
| url | Yes | URL to navigate to |
Implementation Reference
- src/safari-mcp-server.ts:76-87 (registration)Registers the 'safari_navigate' tool in the listTools response, including name, description, and input schema.{ name: 'safari_navigate', description: 'Navigate to a URL in Safari', inputSchema: { type: 'object', properties: { sessionId: { type: 'string', description: 'Session identifier' }, url: { type: 'string', description: 'URL to navigate to' } }, required: ['sessionId', 'url'] } },
- src/safari-mcp-server.ts:291-302 (handler)Server-side handler method for 'safari_navigate' that extracts parameters and delegates to SafariDriverManager.private async navigate(args: Record<string, any>): Promise<Array<{ type: string; text: string }>> { const { sessionId, url } = args; await this.driverManager.navigateToUrl(sessionId, url); return [ { type: 'text', text: `Successfully navigated to: ${url}` } ]; }
- src/safari-driver.ts:93-105 (handler)Core implementation of navigation using Selenium WebDriver's driver.get(url) method.async navigateToUrl(sessionId: string, url: string): Promise<void> { const session = this.getSession(sessionId); if (!session) { throw new Error(`Session ${sessionId} not found`); } try { await session.driver.get(url); } catch (error: unknown) { const errorMessage = error instanceof Error ? error.message : String(error); throw new Error(`Navigation failed: ${errorMessage}`); } }
- src/safari-mcp-server.ts:228-229 (handler)Switch case in handleToolCall that routes 'safari_navigate' calls to the navigate handler.case 'safari_navigate': return await this.navigate(args);