Skip to main content
Glama
Xxx00xxX33

Browserbase MCP Server

by Xxx00xxX33

multi_browserbase_stagehand_navigate_session

Navigate to a specific URL within a browser session for web automation tasks like data extraction, form filling, or taking screenshots.

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 (for a specific session)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYesThe session ID to use
urlYesThe URL to navigate to

Implementation Reference

  • Handler for the multi-session navigate tool. Retrieves session by ID from stagehandStore, creates overridden context pointing to the session's resources, and delegates to the base navigate tool's handler.
    handle: async (
      context: Context,
      params: z.infer<typeof newInputSchema>,
    ): Promise<ToolResult> => {
      const { sessionId, ...originalParams } = params;
    
      // Get the session
      const session = stagehandStore.get(sessionId);
      if (!session) {
        throw new Error(`Session ${sessionId} not found`);
      }
    
      // Create a temporary context that points to the specific session
      const sessionContext = Object.create(context);
      sessionContext.currentSessionId =
        session.metadata?.bbSessionId || sessionId;
      sessionContext.getStagehand = async () => session.stagehand;
      sessionContext.getActivePage = async () => session.page;
      sessionContext.getActiveBrowser = async () => session.browser;
    
      // Call the original tool's handler with the session-specific context
      return originalTool.handle(sessionContext, originalParams);
    },
  • Base navigate tool handler invoked by the multi-session wrapper. Performs page.goto(url), retrieves Browserbase session details, and returns navigation confirmation with live view URLs.
    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,
      };
    }
  • Definition and export of the specific tool 'multi_browserbase_stagehand_navigate_session' by applying the multi-session wrapper factory to the base navigateTool, generating the exact name, schema, and handler.
    export const navigateWithSessionTool = createMultiSessionAwareTool(
      navigateTool,
      {
        namePrefix: "multi_",
        nameSuffix: "_session",
      },
    );
  • Schema generation for session-aware tools: extends the original tool's input schema by adding a required 'sessionId' field.
    if (originalSchema instanceof z.ZodObject) {
      // If it's a ZodObject, we can spread its shape
      newInputSchema = z.object({
        sessionId: z.string().describe("The session ID to use"),
        ...originalSchema.shape,
      });
    } else {
      // For other schema types, create an intersection
      newInputSchema = z.intersection(
        z.object({ sessionId: z.string().describe("The session ID to use") }),
        originalSchema,
      );
    }
  • src/index.ts:188-218 (registration)
    MCP server registration of all tools (including the target tool via TOOLS array) using server.tool() for each tool's name, description, input schema, and a wrapper handler that executes 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}`,
        );
      }
    });
  • Inclusion of navigateWithSessionTool in the multiSessionTools array, which is spread into the main TOOLS export used for MCP registration.
    export const multiSessionTools = [
      createSessionTool,
      listSessionsTool,
      closeSessionTool,
      navigateWithSessionTool,
      actWithSessionTool,
      extractWithSessionTool,
      observeWithSessionTool,
    ];
Behavior2/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 of behavioral disclosure. It mentions the action ('navigate to a URL') but lacks details on permissions, rate limits, error handling, or what happens in the browser session. The guidance about URL reliability adds some context, but overall, it's insufficient for a mutation tool with zero annotation coverage.

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 concise and well-structured, consisting of two sentences that directly address the tool's purpose and usage guidelines. Every sentence adds value without redundancy, making it easy to understand quickly.

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

Completeness2/5

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

Given the tool's complexity (a navigation action in a browser session) and the lack of annotations and output schema, the description is incomplete. It doesn't explain what the tool returns, potential side effects, or how it interacts with other session tools. The usage guidance helps, but more behavioral context is needed for adequate completeness.

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?

Schema description coverage is 100%, with clear descriptions for both parameters ('sessionId' and 'url'). The description doesn't add any semantic details beyond what the schema provides, such as URL format requirements or session ID constraints. Given the high coverage, a baseline score of 3 is appropriate.

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 tool's purpose: 'Navigate to a URL in the browser.' This is a specific verb ('navigate') with a resource ('URL'), making the action clear. However, it doesn't explicitly differentiate from sibling tools like 'browserbase_stagehand_navigate' (which lacks 'multi_' and 'session' in its name), though the context implies it's for multi-session scenarios.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: '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 (for a specific session).' This clearly states when to use it (with reliable URLs) and offers an alternative approach, though it doesn't name specific sibling alternatives.

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