safari_navigate
Navigate Safari browser to a specified URL for browser automation and web interaction tasks.
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:291-302 (handler)The main handler function for the 'safari_navigate' tool. It extracts sessionId and url from input arguments, delegates navigation to SafariDriverManager, and returns a success message.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-mcp-server.ts:77-87 (schema)Input schema definition and tool description for 'safari_navigate', used in the listTools response for registration.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:228-229 (registration)Dispatch case in the handleToolCall switch statement that routes 'safari_navigate' calls to the navigate handler.case 'safari_navigate': return await this.navigate(args);
- src/safari-driver.ts:93-105 (helper)Underlying helper method in SafariDriverManager that performs the actual navigation using Selenium WebDriver's driver.get(url).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}`); } }