Reference for the six browser tools agents call.
{ ok: true, ...payload } on success, or { ok: false, error } for model-fixable failures (unknown session ID, thrown Playwright code). Errors include a next step when possible. Host misconfiguration (missing API keys) and domain policy violations throw instead of returning { ok: false }.url after opening. Returns a sessionId for later tools.path urlstringhttps:// URL, or omit url and navigate with browser_exec via await page.goto(...).{ ok: true, sessionId }.{ ok: false, error } so the agent can open again.browser_open, but browser_close detaches without killing the externally managed browser.path cdpUrlstringrequiredws://127.0.0.1:9222/devtools/browser/....{ ok: true, sessionId }.return to produce a result.page, context, browser. TypeScript is fine (stripped with Sucrase). console.log / console.error are captured as stdout / stderr.path sessionIdstringrequiredbrowser_open or browser_connect.path codestringrequiredreturn await page.title().path pageIdstringbrowser_status. Defaults to the most recently opened tab.1234567{ ok: true, result: unknown, stdout: string, stderr: string, snapshotDiff: string, // a11y-tree diff since the previous exec; empty when unchanged }
{ ok: false, error, stdout?, stderr? } — fix the code and retry.browser_snapshot to orient on a full accessibility tree before interacting, or to verify state after a change.browser_exec calls already return snapshotDiff for what changed since the previous exec on that session. Prefer reading that before taking another full snapshot.ref handles (for example l7) so the agent can refer to structure while writing Playwright locators in browser_exec.path sessionIdstringrequiredbrowser_open or browser_connect.path screenshotbooleantrue, also return a PNG as { base64, mimeType: "image/png" }. Framework adapters (AI SDK, Pi) can surface that image to the model.path pageIdstringbrowser_status. Defaults to the most recently opened tab.{ ok: true, tree, screenshot? }.| Args | Returns |
| (none) | { ok: true, sessions } — each session lists sessionId, provider, and pages |
sessionId | { ok: true, pages } for that session |
sessionId + pageId | Page detail: url, title, viewport, active, readyState |
path sessionIdstringbrowser_open or browser_connect.path pageIdstringbrowser_status call. Requires sessionId.browser_connect sessions it detaches without killing the external browser.path sessionIdstringrequired{ ok: true }.dispose() on the toolkit closes every session that toolkit still owns.