Skip to main content
Glama

browser_navigate

Directs a web browser to open a specified URL, enabling automated web navigation for testing or interaction tasks.

Instructions

Navigate to a URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to navigate to

Implementation Reference

  • Handler function that retrieves the current browser driver from stateManager and navigates to the specified URL, returning success or error message.
    async ({ url }) => {
      try {
        const driver = stateManager.getDriver();
        await driver.get(url);
        return {
          content: [{ type: 'text', text: `Navigated to ${url}` }],
        };
      } catch (e) {
        return {
          content: [{ type: 'text', text: `Error navigating: ${(e as Error).message}` }],
        };
      }
    }
  • Input schema defining the 'url' parameter as a required string for the browser_navigate tool.
    {
      url: z.string().describe('URL to navigate to'),
    },
  • Direct registration of the 'browser_navigate' tool using server.tool within registerBrowserTools, specifying name, description, input schema, and inline handler function.
    server.tool(
      'browser_navigate',
      'Navigate to a URL',
      {
        url: z.string().describe('URL to navigate to'),
      },
      async ({ url }) => {
        try {
          const driver = stateManager.getDriver();
          await driver.get(url);
          return {
            content: [{ type: 'text', text: `Navigated to ${url}` }],
          };
        } catch (e) {
          return {
            content: [{ type: 'text', text: `Error navigating: ${(e as Error).message}` }],
          };
        }
      }
    );

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/pshivapr/selenium-mcp'

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