Skip to main content
Glama

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
NameRequiredDescriptionDefault
sessionIdYesSession identifier
urlYesURL to navigate to

Implementation Reference

  • 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'] } },
  • 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}` } ]; }
  • 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}`); } }
  • Switch case in handleToolCall that routes 'safari_navigate' calls to the navigate handler.
    case 'safari_navigate': return await this.navigate(args);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lxman/safari-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server