Skip to main content
Glama

open_session

Open a persistent browser session for multi-step web tasks, keeping the page alive across calls to explore, click, fill, debug, and collect console/network logs.

Instructions

Open a persistent browser session and return {session_id, url, title, screenshot}. The page stays alive across tool calls so you can explore, click, fill, debug, and accumulate console/network logs — the main workflow for anything multi-step. Pass project to share its authenticated context; headed=true opens a visible window. Sessions expire after idle timeout, so close_session when done.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "url": "<url>"
    },
    "name": "open_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlYesURL to open
widthNoCustom viewport width (applied before the first load)
deviceNoOpen already emulating a device. Size presets (mobile_sm, mobile, mobile_lg, tablet, tablet_lg, laptop, desktop, desktop_lg) just set the viewport. Any Playwright device name ('iPhone 14', 'Pixel 7', 'Galaxy S9+', 'iPad Pro 11') or 'samsung_internet' also emulates user agent, DPR and touch in a private context seeded with the project's login state.
headedNoOpen a VISIBLE browser window instead of headless (default: false). Requires a display on the server. Use when you want to watch or hand-drive the session.
heightNoCustom viewport height
consentNoHandle the cookie-consent banner right after the page loads (same as handle_consent).
projectNoProject name (optional). With a project: runs in its shared, authenticated context. Without: runs in an isolated context (no shared cookies/login).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.12.0
    • addedInput schema / properties / consent
      Added value: +{
      +  "description": "Handle the cookie-consent banner right after the page loads (same as handle_consent).",
      +  "enum": [
      +    "accept",
      +    "deny",
      +    "dismiss"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / device
      Added value: +{
      +  "description": "Open already emulating a device. Size presets (mobile_sm, mobile, mobile_lg, tablet, tablet_lg, laptop, desktop, desktop_lg) just set the viewport. Any Playwright device name ('iPhone 14', 'Pixel 7', 'Galaxy S9+', 'iPad Pro 11') or 'samsung_internet' also emulates user agent, DPR and touch in a private context seeded with the project's login state.",
      +  "type": "string"
      +}
    • addedInput schema / properties / height
      Added value: +{
      +  "description": "Custom viewport height",
      +  "type": "integer"
      +}
    • addedInput schema / properties / width
      Added value: +{
      +  "description": "Custom viewport width (applied before the first load)",
      +  "type": "integer"
      +}
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose key behavior: the page stays alive across tool calls, console/network logs accumulate, sessions expire after idle timeout, and headed mode requires a display on the server. However, it does not state authentication or permission requirements for opening a session, nor what happens if url is unreachable or a session limit is hit — meaningful gaps for a state-creating tool.

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 purpose and return value, then workflow guidance, then lifecycle cleanup — a sensible ordering. It is dense but nearly every clause carries information; only the log-accumulation clause is arguably incidental.

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?

Even without an output schema, the description enumerates the returned fields. For a seven-parameter session-creating tool it covers lifecycle, context sharing, and cleanup, leaving nothing an agent needs in order to call it correctly.

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; the description nevertheless reinforces the two highest-impact params — project switches between shared authenticated and isolated context, headed opens a visible window. It adds only marginal meaning beyond the schema's own thorough device and consent descriptions, so it sits just above baseline.

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 a persistent browser session") plus the exact return shape {session_id, url, title, screenshot}. The word "persistent" and the multi-step framing make it clearly distinct from one-shot siblings like navigate_session or screenshot_session.

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?

Gives clear when-to-use guidance: "the main workflow for anything multi-step" and "explore, click, fill, debug." It also names the lifecycle alternative ("close_session when done") and the project-sharing condition. It does not explicitly contrast with navigate_session, which is the most likely near-miss sibling, so it falls short of a 5.

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