Skip to main content
Glama

browserbase_stagehand_navigate

Navigate to a specified URL in a cloud browser for web automation, data extraction, and interaction tasks.

Instructions

Navigate to a URL in the browser. Only use this tool with URLs you're confident will work and stay up to date. Otherwise, use https://google.com as the starting point

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL to navigate to

Implementation Reference

  • The handleNavigate function that executes the core logic of navigating to the specified URL using the active page and Browserbase SDK, returning navigation confirmation and debug links.
    async function handleNavigate( context: Context, params: NavigateInput, ): Promise<ToolResult> { const action = async (): Promise<ToolActionResult> => { try { const stagehand = await context.getStagehand(); const page = await context.getActivePage(); if (!page) { throw new Error("No active page available"); } await page.goto(params.url, { waitUntil: "domcontentloaded" }); const sessionId = stagehand.browserbaseSessionID; if (!sessionId) { throw new Error("No Browserbase session ID available"); } // Get the debug URL using Browserbase SDK const bb = new Browserbase({ apiKey: context.config.browserbaseApiKey, }); const debugUrl = (await bb.sessions.debug(sessionId)) .debuggerFullscreenUrl; return { content: [ { type: "text", text: `Navigated to: ${params.url}`, }, { type: "text", text: `View the live session here: https://www.browserbase.com/sessions/${sessionId}`, }, { type: "text", text: `Browserbase Live Debugger URL: ${debugUrl}`, }, ], }; } catch (error) { const errorMsg = error instanceof Error ? error.message : String(error); throw new Error(`Failed to navigate: ${errorMsg}`); } }; return { action, waitForNetwork: false, }; }
  • Tool schema defining the name 'browserbase_stagehand_navigate', description, and references the input schema (defined lines 7-9).
    const navigateSchema: ToolSchema<typeof NavigateInputSchema> = { name: "browserbase_stagehand_navigate", description: "Navigate to a URL in the browser. Only use this tool with URLs you're confident will work and stay up to date. Otherwise, use https://google.com as the starting point", inputSchema: NavigateInputSchema, };
  • Defines and exports the complete navigateTool object, bundling schema and handler for use in MCP.
    const navigateTool: Tool<typeof NavigateInputSchema> = { capability: "core", schema: navigateSchema, handle: handleNavigate, }; export default navigateTool;
  • Registers navigateTool (imported from ./navigate.js) into the central TOOLS array used for MCP tool server.
    export const TOOLS = [ ...multiSessionTools, ...sessionTools, navigateTool, actTool, extractTool, observeTool, screenshotTool, getUrlTool, ];

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/vaibhavAtlys/mcp-server-browserbase'

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