Skip to main content
Glama
Browser Session MCP

Browser Session MCP

open_browser_session

Start a new isolated Chrome browser session and get its sessionId to pass to every other tool. Each session keeps separate cookies, storage and tabs, and can be named to save a login across tasks.

Instructions

Open a new isolated browser session and return its sessionId; call this first, then pass the id to every other tool. Each session is its own Chrome BrowserContext with separate cookies, storage and tabs, so sessions never see each other, and it starts with one blank tab. Don't open a new session per page: reuse one and use new_page for more tabs. To start logged in, follow with load_browser_state before navigate. Set viewport for a specific window size and useMobileUA to be a phone: a mobile User-Agent and client hints, mobile device metrics (the page's viewport meta applies) and a touch screen (navigator.maxTouchPoints, touch events, pointer: coarse), so sites pick their touch behavior; use tap and swipe on it, and act taps and swipes on its own. Both are fixed for the session's life. Give a name (e.g. github) to keep a login across tasks: opening that name again reuses the session while it is open, and otherwise opens a new one with the login saved under the name, which is saved when a takeover finishes and when the session closes. Sessions persist until close_browser_session, or until the reaper role closes ones idle for MAX_IDLE_HOURS (default 24). Fails if Chrome is unreachable at BROWSER_URL.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "open_browser_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameNoReuse the open session with this name, or open one with the login saved under it; its login is saved under the name on takeover and close.
deviceNoA device preset: its screen size, pixel ratio, User-Agent and, for phones and tablets, a touch screen. `viewport`, `useMobileUA` and `userAgent` override parts of it.
viewportNoWindow size in CSS pixels, { width, height, deviceScaleFactor? }. Default 1280x800 at 1x.
userAgentNoA User-Agent string to send instead of Chrome's, e.g. a specific phone's; with useMobileUA the session is also a touch phone. A non-Chrome one is sent without Chrome's client hints.
useMobileUANoEmulate a phone: a mobile User-Agent and client hints, mobile device metrics and a touch screen. Pair it with a phone-sized viewport such as 390x844. Default false.

Output Schema

NameRequiredDescriptionDefault
activeUrlNo
pageCountYes
sessionIdYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.1.23
    • addedInput schema / properties / device
      Added value: +{
      +  "description": "A device preset: its screen size, pixel ratio, User-Agent and, for phones and tablets, a touch screen. `viewport`, `useMobileUA` and `userAgent` override parts of it.",
      +  "enum": [
      +    "pixel-7",
      +    "galaxy-s23",
      +    "iphone-15",
      +    "iphone-se",
      +    "ipad-air",
      +    "laptop",
      +    "desktop-1080p"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / name
      Added value: +{
      +  "description": "Reuse the open session with this name, or open one with the login saved under it; its login is saved under the name on takeover and close.",
      +  "type": "string"
      +}
    • addedInput schema / properties / userAgent
      Added value: +{
      +  "description": "A User-Agent string to send instead of Chrome's, e.g. a specific phone's; with useMobileUA the session is also a touch phone. A non-Chrome one is sent without Chrome's client hints.",
      +  "type": "string"
      +}
    • changedInput schema / properties / viewport / description
      Previous value: -"Window size in CSS pixels, { width, height }. Default 1280x800."New value: +"Window size in CSS pixels, { width, height, deviceScaleFactor? }. Default 1280x800 at 1x."
    • addedInput schema / properties / viewport / properties / deviceScaleFactor
      Added value: +{
      +  "description": "Device pixels per CSS pixel (window.devicePixelRatio), e.g. 2.625 for a Pixel 7. Default 1.",
      +  "maximum": 4,
      +  "minimum": 0.5,
      +  "type": "number"
      +}
  2. Changed1 schema field changedv0.1.18
    • changedInput schema / properties / useMobileUA / description
      Previous value: -"Send a mobile User-Agent and client hints instead of desktop ones. Default false."New value: +"Emulate a phone: a mobile User-Agent and client hints, mobile device metrics and a touch screen. Pair it with a phone-sized viewport such as 390x844. Default false."
  3. Changed1 schema field changedv0.1.5
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "properties": {
      +    "activeUrl": {
      +      "type": [
      +        "string",
      +        "null"
      +      ]
      +    },
      +    "pageCount": {
      +      "format": "uint",
      +      "minimum": 0,
      +      "type": "integer"
      +    },
      +    "sessionId": {
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "sessionId",
      +    "pageCount"
      +  ],
      +  "type": "object"
      +}
  4. Changed2 schema fields changed
    • addedInput schema / properties / useMobileUA / description
      Added value: +"Send a mobile User-Agent and client hints instead of desktop ones. Default false."
    • addedInput schema / properties / viewport / description
      Added value: +"Window size in CSS pixels, { width, height }. Default 1280x800."
  5. First observedv0.1.2

TDQS

A4.8/5.0
Behavior5/5

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

Annotations only declare the generic safety profile (not read-only, non-idempotent, non-destructive), but the description adds substantive behavior: each session is an isolated BrowserContext with separate cookies/storage/tabs, starts with one blank tab, viewport/useMobileUA are fixed for the session's life, and sessions persist until close or reaper expiry at MAX_IDLE_HOURS (default 24). It also discloses the failure condition (Chrome unreachable at BROWSER_URL) and the name-based login persistence and takeover save points.

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?

Front-loaded with the core action and return value, then lifecycle, then optional parametrization — a sensible information hierarchy. It is dense and long, with some parenthetical excess (navigator.maxTouchPoints, pointer: coarse) that is useful to a browser-automation agent but borders on over-detailed.

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

Completeness5/5

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

For a session-creation tool with five optional parameters and an output schema, the description covers the call sequence, isolation model, persistence/expiry, mobile emulation effect on downstream tools, and the connection failure mode. Nothing an agent needs to invoke it correctly or plan subsequent calls is missing.

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

Parameters4/5

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

Schema coverage is 100%, so baseline is 3, but the description adds real meaning beyond the schema: that viewport and useMobileUA are immutable for the session's lifetime, that mobile UA implies touch (so tap/swipe work), and that `name` reuses an open session or restores a saved login. These are behavioral constraints the schema cannot express, though it does not explain `device` or the interaction where overrides partially supersede presets.

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?

States a specific verb and resource (open an isolated browser session) and the return value (sessionId), then immediately establishes its role as the entry point: 'call this first, then pass the id to every other tool.' An agent can distinguish it from close_browser_session, list_browser_sessions, or new_page without opening any schema.

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?

Explicit when-to-use and when-not-to-use guidance: 'Don't open a new session per page: reuse one and use new_page for more tabs,' and a named follow-up sequence ('follow with load_browser_state before navigate') for logged-in starts. It also names the lifecycle alternative (close_browser_session vs. reaper idle expiry), leaving little to inference.

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