Skip to main content
Glama
RonsDad
by RonsDad

multi_browserbase_stagehand_session_create

Create parallel browser sessions for multi-session workflows like data scraping, automation, A/B testing, and batch processing. Each session maintains independent cookies, authentication, and state for scaling tasks requiring multiple browsers.

Instructions

Create parallel browser session for multi-session workflows. Use this when you need multiple browser instances running simultaneously: parallel data scraping, concurrent automation, A/B testing, multiple user accounts, cross-site operations, batch processing, or any task requiring more than one browser. Creates an isolated browser session with independent cookies, authentication, and state. Always pair with session-specific tools (those ending with '_session'). Perfect for scaling automation tasks that require multiple browsers working in parallel.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameNoHighly recommended: Descriptive name for tracking multiple sessions (e.g. 'amazon-scraper', 'user-login-flow', 'checkout-test-1'). Makes debugging and session management much easier!
browserbaseSessionIDNoResume an existing Browserbase session by providing its session ID. Use this to continue work in a previously created browser session that may have been paused or disconnected.

Implementation Reference

  • The handler function that executes the tool logic: creates a new session using stagehandStore.create, retrieves the Browserbase session ID and debug URL, and returns a success message with session details.
    handle: async (
      context: Context,
      { name, browserbaseSessionID },
    ): Promise<ToolResult> => {
      try {
        const params: CreateSessionParams = {
          browserbaseSessionID,
          meta: name ? { name } : undefined,
        };
    
        const session = await stagehandStore.create(context.config, params);
    
        const bbSessionId = session.metadata?.bbSessionId;
        if (!bbSessionId) {
          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(bbSessionId))
          .debuggerFullscreenUrl;
    
        return {
          action: async () => ({
            content: [
              {
                type: "text",
                text: `Created session ${session.id}${name ? ` (${name})` : ""}\nBrowserbase session: ${bbSessionId}\nBrowserbase Live Session View URL: https://www.browserbase.com/sessions/${bbSessionId}\nBrowserbase Live Debugger URL: ${debugUrl}`,
              },
            ],
          }),
          waitForNetwork: false,
        };
      } catch (error) {
        const errorMessage =
          error instanceof Error ? error.message : String(error);
        throw new Error(
          `Failed to create browser session: ${errorMessage}. Please check your Browserbase credentials and try again.`,
        );
      }
    },
  • The input schema and description for the tool, defining optional 'name' and 'browserbaseSessionID' parameters.
    schema: {
      name: "multi_browserbase_stagehand_session_create",
      description:
        "Create parallel browser session for multi-session workflows. Use this when you need multiple browser instances running simultaneously: parallel data scraping, concurrent automation, A/B testing, multiple user accounts, cross-site operations, batch processing, or any task requiring more than one browser. Creates an isolated browser session with independent cookies, authentication, and state. Always pair with session-specific tools (those ending with '_session'). Perfect for scaling automation tasks that require multiple browsers working in parallel.",
      inputSchema: z.object({
        name: z
          .string()
          .optional()
          .describe(
            "Highly recommended: Descriptive name for tracking multiple sessions (e.g. 'amazon-scraper', 'user-login-flow', 'checkout-test-1'). Makes debugging and session management much easier!",
          ),
        browserbaseSessionID: z
          .string()
          .optional()
          .describe(
            "Resume an existing Browserbase session by providing its session ID. Use this to continue work in a previously created browser session that may have been paused or disconnected.",
          ),
      }),
  • The tool is included in the TOOLS array via multiSessionTools, which is used for MCP server registration.
    // Export all tools as array
    export const TOOLS = [
      ...multiSessionTools,
      ...sessionTools,
      navigateTool,
      actTool,
      extractTool,
      observeTool,
      screenshotTool,
      getUrlTool,
    ];
  • src/index.ts:196-226 (registration)
    Final MCP server registration: all tools from TOOLS are registered using server.tool() with a wrapper handler that calls context.run(tool, params). This makes the tool available via MCP.
    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}`,
        );
      }
    });
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: creates an isolated browser session with independent cookies, authentication, and state, and specifies that it's for parallel workflows. However, it lacks details on error handling, performance implications, or resource usage, which would be helpful for a tool creating multiple browser instances.

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 well-structured and front-loaded with the core purpose, followed by usage guidelines and behavioral details. It uses bullet-like examples efficiently but could be slightly more concise by reducing some redundancy in the use case list (e.g., 'parallel data scraping' and 'batch processing' overlap).

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

Completeness4/5

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

Given the tool's complexity (creating parallel browser sessions) and lack of annotations or output schema, the description does a good job covering purpose, usage, and key behaviors. However, it could improve by mentioning output format (e.g., session ID for use with other tools) or potential limitations, which would help an agent understand the full context.

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%, so the schema already documents both parameters thoroughly. The description does not add any parameter-specific information beyond what's in the schema, such as explaining how parameters interact with the multi-session context. Baseline 3 is appropriate when the schema does the heavy lifting.

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

Purpose5/5

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

The description explicitly states the tool's purpose as 'Create parallel browser session for multi-session workflows' and provides specific use cases like parallel data scraping, concurrent automation, A/B testing, etc. It clearly distinguishes from sibling tools by emphasizing multi-session capabilities and the need to pair with session-specific tools, unlike the single-session 'browserbase_session_create'.

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 guidance on when to use this tool ('when you need multiple browser instances running simultaneously') and lists specific scenarios (parallel data scraping, concurrent automation, etc.). It also states when to use it ('any task requiring more than one browser') and how to use it ('Always pair with session-specific tools'), offering clear alternatives to single-session tools.

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