Skip to main content
Glama
RonsDad
by RonsDad

multi_browserbase_stagehand_navigate_session

Navigate to a URL in a browser session for web automation tasks like data extraction, screenshots, or automated actions.

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

  • Wrapper handler for all multi-session tools. Loads the specific session by ID, creates a session-scoped context, and delegates to the original 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);
    },
  • Registers/exports the specific tool 'multi_browserbase_stagehand_navigate_session' by applying multi-session wrapper to the base navigateTool.
    export const navigateWithSessionTool = createMultiSessionAwareTool(
      navigateTool,
      {
        namePrefix: "multi_",
        nameSuffix: "_session",
      },
    );
  • Core navigation handler delegated to by the wrapper. Navigates the page to the given URL using Puppeteer page.goto and provides Browserbase session/debug 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,
      };
    }
  • Base schema for the navigate tool, which is extended by the multi-session wrapper to add sessionId.
    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,
    };
  • Includes the multi-session navigate tool in the array of multi-session tools, which is then added to the full TOOLS array registered with the MCP server.
    export const multiSessionTools = [
      createSessionTool,
      listSessionsTool,
      closeSessionTool,
      navigateWithSessionTool,
      actWithSessionTool,
      extractWithSessionTool,
      observeWithSessionTool,
      getUrlWithSessionTool,
      getAllUrlsWithSessionTool,
    ];
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 that URLs should be 'confident will work and stay up to date,' hinting at potential reliability issues, but doesn't cover critical aspects like whether this is a read-only or mutating operation, error handling, performance implications, or session management details. This leaves significant gaps for a tool that interacts with a browser session.

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

Conciseness4/5

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

The description is appropriately sized with two sentences that are front-loaded and efficient. The first sentence states the core action, and the second provides usage guidance. There's no wasted text, though it could be slightly more structured for clarity.

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 complexity of browser navigation (2 parameters, no annotations, no output schema), the description is somewhat complete but has gaps. It covers the purpose and basic usage but lacks details on behavioral traits, error handling, and what happens after navigation (e.g., page load status). Without annotations or output schema, more context would be helpful for an AI agent to use this tool effectively.

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 clear documentation for both parameters ('sessionId' and 'url'). The description adds no additional meaning beyond what the schema provides, such as URL format requirements or session ID constraints. According to the rules, with high schema coverage (>80%), the baseline is 3, which is appropriate here as 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 action ('Navigate to a URL') and resource ('in the browser'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'browserbase_stagehand_navigate' or 'multi_browserbase_stagehand_get_url_session', which might have overlapping or related functionality, preventing a perfect score.

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 ('Only use this tool with URLs you're confident will work and stay up to date') and suggests an alternative starting point ('Otherwise, use https://google.com as the starting point'). However, it doesn't explicitly mention when not to use it or compare it to specific sibling tools like 'browserbase_stagehand_navigate', which could be a simpler alternative, so it's not fully comprehensive.

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

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