Skip to main content
Glama

ui_start_session

ui_start_session

Start a browser session to test a UI under selected device, viewport, locale, timezone, or color scheme, and log tool calls into its report. Pass the returned session id to later tools.

Instructions

Start a session bracket: opens a fresh browser context and begins logging subsequent primitive tool calls into a report. A connection can hold several sessions at once (up to MAX_SESSIONS_PER_CONNECTION, default 3): pass the returned session id as session_id to every other tool to choose which session it acts on. A session left unused for 10 minutes is closed automatically and its report is written with status timed_out. Optionally test at the sizes and settings real users have: device (a Playwright device name such as "iPhone 13": mobile user agent, touch, pixel ratio and size), viewport (overrides the device size), colorScheme, locale, timezoneId. With none of them the browser is a 1280x720 desktop. These apply to this session only; use ui_set_viewport to resize mid-flow.

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": {
      "target": "<target>"
    },
    "name": "ui_start_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
deviceNoPlaywright device name, e.g. "iPhone 13", "Pixel 7", "iPad Pro 11"
localeNoBrowser locale, e.g. "fr-FR"
targetYesLabel/URL identifying what this session tests
viewportNoPage size in CSS pixels (320-3840 x 320-2160), e.g. {width: 375, height: 812} for a phone
timezoneIdNoIANA timezone, e.g. "Asia/Tokyo"
colorSchemeNoprefers-color-scheme the page sees

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior4/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 so well: it discloses the per-connection session cap, the 10-minute idle auto-close and that the report is written with status timed_out, the default 1280x720 desktop when no options are given, and that settings are session-scoped. It stops short of saying what happens when the session cap is exceeded (error vs. eviction) or whether sessions survive connection loss, which are the remaining behavioral gaps.

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-loads the core action and the session_id contract, then moves to timeout behavior and finally optional environment knobs. The device/viewport/colorScheme/locale/timezoneId run is dense but each item adds a distinct concept; the only mild redundancy is restating examples already in the schema descriptions.

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?

For a 6-parameter session-creation tool with a nested viewport object, no annotations and no output schema, the definition covers lifecycle, defaults, and addressing correctly. The notable omission is guidance on the required `target` argument, and the return value is only described as 'the returned session id' with no hint of the rest of the response.

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 already 100%, so parameter documentation is largely redundant, but the description adds real meaning the schema does not: that no options yields a 1280x720 desktop default, that `viewport` overrides the size implied by `device`, and concrete device names such as "iPhone 13". It never mentions the one required parameter, `target`, outside the schema.

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 ('Start a session bracket: opens a fresh browser context and begins logging subsequent primitive tool calls into a report'), plus what the tool returns (a session id). It is immediately distinguishable from ui_end_session and the primitive interaction tools in the sibling list.

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?

Tells the agent exactly how to use the result: 'pass the returned session id as `session_id` to every other tool to choose which session it acts on'. It also names an explicit alternative for a related need ('use ui_set_viewport to resize mid-flow') and sets the concurrency context (up to MAX_SESSIONS_PER_CONNECTION, default 3), which is when-not guidance for opening further sessions.

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