Skip to main content
Glama
jomon003

PlayMCP Browser Automation Server

by jomon003

openBrowser

Launch a new browser instance for web automation tasks like scraping, testing, and interaction using Playwright technology.

Instructions

Launch a new browser instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
headlessNo
debugNo

Implementation Reference

  • Core handler function that launches the Chromium browser instance, creates a new browser context and page, with support for headless mode and debug logging.
    async openBrowser(headless: boolean = false, debug: boolean = false): Promise<void> {
      try {
        this.state.debug = debug;
        this.log('Attempting to launch browser');
        
        if (this.state.browser?.isConnected()) {
          this.log('Browser already running');
          return;
        }
    
        this.log('Launching new browser instance', { headless });
        this.state.browser = await chromium.launch({ 
          headless,
          args: ['--no-sandbox']
        });
        
        this.log('Creating browser context');
        this.state.context = await this.state.browser.newContext({
          viewport: { width: 1280, height: 720 }
        });
        
        this.log('Creating new page');
        this.state.page = await this.state.context.newPage();
        
        this.log('Browser successfully launched');
      } catch (error: any) {
        console.error('Browser launch error:', error);
        throw new BrowserError(
          'Failed to launch browser', 
          `Technical details: ${error?.message || 'Unknown error'}`
        );
      }
    }
  • MCP server request handler for the openBrowser tool call that delegates to the Playwright controller with input arguments.
    case 'openBrowser': {
      await playwrightController.openBrowser(
        args.headless as boolean,
        args.debug as boolean
      );
      return {
        content: [{ type: "text", text: "Browser opened successfully" }]
      };
    }
  • Tool schema definition specifying the name, description, and input parameters (headless and debug booleans).
    const OPEN_BROWSER_TOOL: Tool = {
      name: "openBrowser",
      description: "Launch a new browser instance",
      inputSchema: {
        type: "object",
        properties: {
          headless: { type: "boolean" },
          debug: { type: "boolean" }
        },
        required: []
      }
    };
  • src/server.ts:514-553 (registration)
    Registration of the openBrowser tool in the tools object passed to the MCP server capabilities.
    const tools = {
      openBrowser: OPEN_BROWSER_TOOL,
      navigate: NAVIGATE_TOOL,
      type: TYPE_TOOL,
      click: CLICK_TOOL,
      moveMouse: MOVE_MOUSE_TOOL,
      scroll: SCROLL_TOOL,
      screenshot: SCREENSHOT_TOOL,
      getPageSource: GET_PAGE_SOURCE_TOOL,
      getPageText: GET_PAGE_TEXT_TOOL,
      getPageTitle: GET_PAGE_TITLE_TOOL,
      getPageUrl: GET_PAGE_URL_TOOL,
      getScripts: GET_SCRIPTS_TOOL,
      getStylesheets: GET_STYLESHEETS_TOOL,
      getMetaTags: GET_META_TAGS_TOOL,
      getLinks: GET_LINKS_TOOL,
      getImages: GET_IMAGES_TOOL,
      getForms: GET_FORMS_TOOL,
      getElementContent: GET_ELEMENT_CONTENT_TOOL,
      getElementHierarchy: GET_ELEMENT_HIERARCHY_TOOL,
      executeJavaScript: EXECUTE_JAVASCRIPT_TOOL,
      goForward: GO_FORWARD_TOOL,
      hover: HOVER_TOOL,
      dragAndDrop: DRAG_AND_DROP_TOOL,
      selectOption: SELECT_OPTION_TOOL,
      pressKey: PRESS_KEY_TOOL,
      waitForText: WAIT_FOR_TEXT_TOOL,
      waitForSelector: WAIT_FOR_SELECTOR_TOOL,
      resize: RESIZE_TOOL,
      handleDialog: HANDLE_DIALOG_TOOL,
      getConsoleMessages: GET_CONSOLE_MESSAGES_TOOL,
      getNetworkRequests: GET_NETWORK_REQUESTS_TOOL,
      uploadFiles: UPLOAD_FILES_TOOL,
      evaluateWithReturn: EVALUATE_WITH_RETURN_TOOL,
      takeScreenshot: TAKE_SCREENSHOT_TOOL,
      mouseMove: MOUSE_MOVE_TOOL,
      mouseClick: MOUSE_CLICK_TOOL,
      mouseDrag: MOUSE_DRAG_TOOL,
      closeBrowser: CLOSE_BROWSER_TOOL
    };
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Launch a new browser instance' implies a creation/mutation operation but doesn't specify whether this requires specific permissions, what happens if a browser is already open, whether it's resource-intensive, or what the expected outcome looks like. For a tool that likely initiates a significant system process, this is inadequate behavioral context.

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 maximally concise - a single clear sentence that states exactly what the tool does with zero wasted words. It's perfectly front-loaded and every word earns its place. This is an excellent example of efficient communication.

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 (launching a browser instance), lack of annotations, no output schema, and 2 undocumented parameters, the description is insufficiently complete. It doesn't explain what happens after launch, whether the browser persists, what capabilities it has, or how it integrates with other browser tools. For a foundational tool in a browser automation suite, this leaves too many questions unanswered.

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 description mentions no parameters, while the schema shows 2 parameters with 0% description coverage. The baseline is 4 for 0 parameters, but since there ARE 2 undocumented parameters (headless, debug) that the description completely ignores, this creates a significant gap. The description doesn't compensate for the schema's lack of parameter documentation.

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 ('Launch') and resource ('a new browser instance'), making the tool's purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'navigate' or 'closeBrowser', but the verb 'Launch' is specific enough to convey this is about creating a browser instance rather than interacting with an existing one.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools for browser interaction (like navigate, closeBrowser, screenshot), there's no indication whether this should be called first, what prerequisites exist, or when other tools might be more appropriate. The agent must infer usage from the name alone.

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/jomon003/PlayMCP'

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