Skip to main content
Glama
Xxx00xxX33

Browserbase MCP Server

by Xxx00xxX33

browserbase_stagehand_navigate

Navigate to specified URLs in a browser to automate web interactions, extract data, and perform automated tasks through cloud browser automation.

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 handler function that executes the tool: retrieves stagehand and active page, navigates to the URL, fetches Browserbase debug URL using SDK, returns content with navigation confirmation and session 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 definition including name, description, and Zod input schema for the URL parameter.
    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,
    };
  • Tool object registration combining schema, capability, and handler function, exported for use in tools index.
    const navigateTool: Tool<typeof NavigateInputSchema> = {
      capability: "core",
      schema: navigateSchema,
      handle: handleNavigate,
    };
    
    export default navigateTool;
  • Aggregates all tools including navigateTool into TOOLS array for server registration.
    export const TOOLS = [
      ...multiSessionTools,
      ...sessionTools,
      navigateTool,
      actTool,
      extractTool,
      observeTool,
      screenshotTool,
    ];
  • src/index.ts:188-218 (registration)
    Imports TOOLS and registers each tool with the MCP server using server.tool(), providing a wrapper handler that invokes context.run(tool, params).
    const tools: MCPToolsArray = [...TOOLS];
    
    // Register each tool with the Smithery server
    tools.forEach((tool) => {
      if (tool.schema.inputSchema instanceof z.ZodObject) {
        server.tool(
          tool.schema.name,
          tool.schema.description,
          tool.schema.inputSchema.shape,
          async (params: z.infer<typeof tool.schema.inputSchema>) => {
            try {
              const result = await context.run(tool, params);
              return result;
            } catch (error) {
              const errorMessage =
                error instanceof Error ? error.message : String(error);
              process.stderr.write(
                `[Smithery Error] ${new Date().toISOString()} Error running tool ${tool.schema.name}: ${errorMessage}\n`,
              );
              throw new Error(
                `Failed to run tool '${tool.schema.name}': ${errorMessage}`,
              );
            }
          },
        );
      } else {
        console.warn(
          `Tool "${tool.schema.name}" has an input schema that is not a ZodObject. Schema type: ${tool.schema.inputSchema.constructor.name}`,
        );
      }
    });
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions that URLs should be 'confident will work and stay up to date', which implies reliability concerns, but doesn't disclose other behavioral traits such as error handling, timeouts, or what happens if navigation fails. This leaves gaps in understanding the tool's behavior beyond the basic action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the core action and followed by a usage guideline. Every sentence earns its place by providing essential information without waste, making it appropriately sized and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (navigation in a browser), no annotations, no output schema, and a simple input schema, the description is somewhat complete but has gaps. It covers the basic purpose and usage but lacks details on behavioral aspects like what happens after navigation, error conditions, or integration with other tools, making it adequate but not fully comprehensive.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the 'url' parameter fully documented in the schema. The description doesn't add any additional meaning beyond what the schema provides, such as URL format requirements or examples. Baseline 3 is appropriate since the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'navigate' and resource 'URL in the browser', making the purpose specific and understandable. However, it doesn't explicitly distinguish this tool from its sibling 'multi_browserbase_stagehand_navigate_session', which appears to be a multi-session version, so it misses full sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context on when to use this tool ('with URLs you're confident will work and stay up to date') and suggests an alternative starting point ('use https://google.com as the starting point'), which helps guide usage. However, it doesn't explicitly mention when not to use it or compare it to other sibling tools like 'browserbase_stagehand_observe' or 'browserbase_stagehand_act', so it lacks full alternative naming.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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

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