Skip to main content
Glama

navigate

Perform browser navigation by directing to a specified URL, optionally waiting for the page to fully load. Enables automated web interactions via the MCP Browser Server.

Instructions

Navigate to a URL

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL to navigate to
waitForLoadNoWait for page to fully load

Implementation Reference

  • The main handler function for the 'navigate' tool. It validates input with NavigateSchema, navigates the current page to the specified URL using Playwright's goto method (with optional networkidle wait), retrieves the page title, and returns a success message.
    case 'navigate': { if (!currentPage) { throw new Error('No browser page available. Launch a browser first.'); } const params = NavigateSchema.parse(args); if (params.waitForLoad) { await currentPage.goto(params.url, { waitUntil: 'networkidle' }); } else { await currentPage.goto(params.url); } const title = await currentPage.title(); return { content: [ { type: 'text', text: `Navigated to ${params.url}\nPage title: ${title}` } ] }; }
  • Zod schema defining the input parameters for the navigate tool: required URL (validated as string URL) and optional waitForLoad boolean.
    const NavigateSchema = z.object({ url: z.string().url(), waitForLoad: z.boolean().default(true) });
  • src/index.ts:158-176 (registration)
    Registration of the 'navigate' tool in the ListTools response, including name, description, and input schema for MCP protocol compliance.
    { name: 'navigate', description: 'Navigate to a URL', inputSchema: { type: 'object', properties: { url: { type: 'string', description: 'URL to navigate to' }, waitForLoad: { type: 'boolean', default: true, description: 'Wait for page to fully load' } }, required: ['url'] } },

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/Wladastic/mcp-browser-server'

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