browser
Control a Chromium-family instance over CDP to navigate pages, read rendered text, inspect tabs, and evaluate JavaScript without keystrokes or OCR.
Instructions
Talk to the instance's Chromium-family browser over the Chrome DevTools Protocol — exact navigation and page text without keystrokes or OCR.
action='info' → {"ok", "url", "title", "pages": [{url, title}, …], "viewport"} of the
active tab + all tabs. viewport = {dpr, left, top, css_width,
css_height} maps the page's CSS pixels (getBoundingClientRect) to the
pixels click()/screenshot() use: x = left + css_xdpr, y = top + css_ydpr
(dpr is not 1 on a zoomed page; top is the toolbar height)
action='navigate' → loads url in the active tab (waits for the load event, max 30 s);
returns {"ok", "url", "title", "loaded": bool}
action='text' → {"ok", "url", "title", "text", "length", "truncated"}: the rendered page
text (document.body.innerText), capped at max_chars (default 20000,
max 200000)
action='eval' → {"ok", "result"}: the JSON value of the JavaScript expression js
(e.g. "document.querySelector('h1').innerText"); a Promise is awaited.
A result whose JSON is longer than max_chars (default 100000, max
1000000) comes back as {"ok", "truncated": true, "length", "result_json":
the first max_chars characters} — raise max_chars or return less
(slice/map in the script). Errors in the page script come back as a
failure with the message
timeout_s (1–600, default 30) bounds an eval or text call. On a timeout the call fails
(isError, "timed_out": true) and the connection stays usable, but the script KEEPS RUNNING
in the page — for long work store the outcome on window (js="fetchAll().then(r => {
window.__r = r }); 'started'") and poll with short evals.
page_url_contains picks a tab by URL fragment (default: the most recently active page).
Works only for browsers started by launch_app/start-display.sh (CDP port 9222+N); fails
(isError) with the fix otherwise, or when the tab, URL or script is bad. The page state you
see in screenshots is this same tab.
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": "browser"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| js | No | ||
| url | No | ||
| action | No | info | |
| instance | No | ||
| max_chars | No | ||
| timeout_s | No | ||
| page_url_contains | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |