Skip to main content
Glama

browser

browser

Automate web sessions to open pages, navigate tabs, run Playwright code, inspect DOM snapshots, capture images, and click or type in UI elements for testing and data extraction.

Instructions

Browser sessions with open/close, code, state (AX), snapshot (interactive DOM), navigate, tabs, observe, act, images, dismissSurface and waitForHumanVerification. All except open require browserSessionId. Inspect and attempt ordinary verification through the page UI before requesting human help; pause after bounded attempts fail or user-owned credentials/OTP/QR/device approval are required. Inspect returned postActionState and actual image content. dismissSurface clicks (0,0) for option popups; use explicit Close/Cancel first for dialogs and verify closureConfirmed. action=code executes JavaScript with top-level await in a persistent Node.js Playwright runtime. page, context, browser and tab are already provided: use page directly; never initialize it from window.__page or redeclare these bindings. document, window and DOMParser are unavailable in the outer cell; use them inside a browser-side callback such as page.evaluate. Correct: var info = await page.evaluate(() => ({ title: document.title, url: window.location.href })); nodeRepl.write(info); Incorrect: const page = window.__page; document.querySelector(...). An evaluate callback runs in the page and cannot capture Node variables, page or nodeRepl; pass values using its second argument, return JSON-safe data, then call nodeRepl.write outside the callback. Use nodeRepl.write(value) for results (top-level return is also supported). Prefer var for bindings reused across cells. Bare fetch runs on the Node host without browser cookies; for an observed browser-authenticated HTTP API use context.request.get(url), check response.ok(), then await response.json()/text(). If document/window is not defined, move the DOM read into page.evaluate instead of retrying the same outer-cell code.

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": {
      "action": "<action>"
    },
    "name": "browser"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNo
yNo
keyNoOne key or simultaneous chord, e.g. Control+v, Control+Shift+v, Shift+ArrowLeft, Alt+ArrowDown.
urlNo
codeNoaction=code executes JavaScript with top-level await in a persistent Node.js Playwright runtime. page, context, browser and tab are already provided: use page directly; never initialize it from window.__page or redeclare these bindings. document, window and DOMParser are unavailable in the outer cell; use them inside a browser-side callback such as page.evaluate. Correct: var info = await page.evaluate(() => ({ title: document.title, url: window.location.href })); nodeRepl.write(info); Incorrect: const page = window.__page; document.querySelector(...). An evaluate callback runs in the page and cannot capture Node variables, page or nodeRepl; pass values using its second argument, return JSON-safe data, then call nodeRepl.write outside the callback. Use nodeRepl.write(value) for results (top-level return is also supported). Prefer var for bindings reused across cells. Bare fetch runs on the Node host without browser cookies; for an observed browser-authenticated HTTP API use context.request.get(url), check response.ok(), then await response.json()/text(). If document/window is not defined, move the DOM read into page.evaluate instead of retrying the same outer-cell code.
endXNo
endYNo
kindNo
textNo
frameNo
maxMsNo
queryNo
scopeNo
stepsNoIntermediate mouse moves for drag/move/hover; drag defaults to 12.
tabIdNo
actionYes
buttonNoMouse button for click/drag. Default left. Use right for context menus.
cursorNo
deltaXNo
deltaYNo
reasonNo
imageIdsNoSelect historical image IDs; latest image always remains selected. Empty resets history.
questionNorequestUserInput: the complete user-facing question in Markdown. Preserve paragraph breaks; use headings and lists for multiple options or files. Identify the material or decision needed to continue the current task.
selectorNo
modifiersNoHold these keys throughout one mouse gesture; release afterwards, including on failure.
clickCountNoclick only: 1 single, 2 double, 3 triple click in one gesture.
snapshotViewNo
tabOperationNo
observationIdNo
maxOutputCharsNo
recoveryReviewNo
snapshotCursorNo
observationModeNo
browserSessionIdNoRequired except open. Use the exact id returned by open.
attachmentArtifactIdsNocode only: artifactIds returned by file/code tools. Registers these artifacts for attachmentVault.setInputFiles(locator, artifactId); no local paths.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.10

TDQS

A3.6/5.0
Behavior4/5

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

With no annotations at all, the description must carry the full burden, and it discloses a meaningful amount beyond the obvious: the session-id requirement for all non-open actions, destructive-vs-safe ordering for dismissSurface with a closureConfirmed check, the persistent Node/Playwright execution context, and the fact that bare fetch runs on the Node host without browser cookies. It still omits session lifetime/expiry, what open returns, and what postActionState actually contains, but the disclosure density is well above baseline for an unannotated tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded correctly with the action surface and the session-id constraint, and each later block (dismissSurface, code runtime, fetch) is topically coherent. The weakness is a dense run-on style with the entire code/correct/incorrect example block restated from the schema, which bloats the text without adding selection value; a reader must parse a wall of prose to find the two sentences that matter.

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 35-parameter, 13-action tool with no annotations and no output schema, the definition covers most of the hard parts: session scoping, verification escalation policy, surface dismissal, and the code-cell execution model with usable correct/incorrect examples. The remaining gap is the observe/act/snapshot workflow — observationId, snapshot cursors, and postActionState are referenced but never explained, which leaves the core inspection loop underspecified.

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 only 29%, so the description is expected to compensate, and it partially does: it documents the action enum values and the browserSessionId rule, and the code paragraph explains the runtime bindings. But roughly two dozen parameters (observationId, observationMode, snapshotView, snapshotCursor, scope, cursor, tabOperation, recoveryReview, maxOutputChars, imageIds context) get no meaning anywhere, and the long code paragraph is duplicated near-verbatim from the schema's own description, so it adds no new information there.

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 enumerates the concrete action surface (open/close, code, state, snapshot, navigate, tabs, observe, act, images, dismissSurface, waitForHumanVerification) so an agent knows this is a full browser-automation tool rather than a formatter or sandbox. It never states the purpose in a single verb+resource sentence, but the action list plus the Playwright/Node runtime detail makes the role unmistakable against siblings like codeSandbox or terminal.

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

Usage Guidelines3/5

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

It gives genuinely explicit when/when-not rules for the human-verification path ('Inspect and attempt ordinary verification through the page UI before requesting human help; pause after bounded attempts fail') and ordering for dismissSurface ('use explicit Close/Cancel first for dialogs'). However, for a 13-action tool it offers no routing at all among the core read/interact actions — nothing says when to use state vs snapshot vs observe, or when act is preferable to code, which is the most common selection decision an agent faces.

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