Cogitator
Browser

Tools Reference

Complete reference for all 33 browser tools across navigation, interaction, extraction, vision, and network modules.

Overview

browserTools(session) returns all 33 tools. You can filter by module or create tools with the module and per-tool factories.

import { browserTools } from '@cogitator-ai/browser';

const allTools = browserTools(session);

const subset = browserTools(session, {
  modules: ['navigation', 'extraction'],
});

Tools from browserTools() call session.ensureStarted() before every execution, so the browser launches on the first tool call (and relaunches if it was closed or crashed). An unknown module name throws, listing the available ones. Every tool has category: 'web' and the tags ['browser', <module>].

Typed Factories

Each module has a factory — createNavigationTools, createInteractionTools, createExtractionTools, createVisionTools, createNetworkTools — that returns a typed tuple built with toolset(). Destructuring keeps each tool's parameter and result types, which is handy when you call tools from your own code:

import {
  BrowserSession,
  createNavigationTools,
  createExtractionTools,
} from '@cogitator-ai/browser';

const session = new BrowserSession();
await session.start();

const [navigate] = createNavigationTools(session);
const [getText, , , getLinks] = createExtractionTools(session);

const ctx = { agentId: 'script', runId: 'manual', signal: AbortSignal.timeout(30_000) };

const page = await navigate.execute({ url: 'https://example.com' }, ctx); // { url, title, status }
const { text } = await getText.execute({ selector: 'main' }, ctx);
const { links } = await getLinks.execute({ baseUrl: page.url }, ctx);

Tuple order matches the order of the tools on this page. Factory-made tools do not auto-start the session — call session.start() first. Every tool also has its own factory (createNavigateTool, createClickTool, …), and the Zod schemas (navigateSchema, clickSchema, …) and input types (NavigateInput, ClickInput, …) are exported.


7 tools for page navigation and waiting.

browser_navigate

Navigate to a URL. Returns { url, title, status } — the final URL, page title, and HTTP status (0 when there is no response, e.g. about:blank).

ParameterTypeDescription
urlstringURL to navigate to; must include a scheme (https:, about:, data:, file:, …)
waitUntilenumload (default) | domcontentloaded | networkidle | commit

browser_go_back

Go back to the previous page in browser history. No parameters. Returns { navigated, url, title }; navigated is false when there was no history entry.

browser_go_forward

Go forward to the next page in browser history. No parameters. Returns { navigated, url, title }.

browser_reload

Reload the current page. Returns { url, title }.

ParameterTypeDescription
waitUntilenumload (default) | domcontentloaded | networkidle | commit

browser_wait_for_navigation

Wait for the page URL to match a glob pattern. Returns { url, title }.

ParameterTypeDescription
urlstringURL glob to wait for (e.g. **/dashboard); default ** (any)
timeoutnumberTimeout in milliseconds; 0 disables it (default: session timeout)

browser_get_current_url

Get the current page URL and title. No parameters. Returns { url, title }.

browser_wait_for_selector

Wait for a CSS selector to reach a state. Returns { found: true }, or { found: false } on timeout.

ParameterTypeDescription
selectorstringCSS selector to wait for
stateenumvisible (default) | hidden | attached | detached
timeoutnumberTimeout in milliseconds; 0 disables it

Interaction

9 tools for clicking, typing, and form manipulation. With stealth humanLikeMouse, click, hover and scroll use human-like mouse movement; with humanLikeTyping, typing is keystroke by keystroke (see Stealth).

browser_click

Click an element by CSS selector. Returns { clicked: true }.

ParameterTypeDescription
selectorstringCSS selector of element
buttonenumleft | right | middle
clickCountnumberNumber of clicks (2 for double-click)
position{ x, y }Position relative to element

browser_type

Type text into an input element. Uses fill() for instant input (replacing the value), or keystrokes when delay is set (appending unless clearFirst). With stealth humanLikeTyping, the field is cleared and typed key by key with human-like delays, so the result matches fill(). Returns { typed: true }.

ParameterTypeDescription
selectorstringCSS selector of input
textstringText to type
delaynumberDelay between keystrokes in ms
clearFirstbooleanClear the field before typing (with delay)

browser_select_option

Select an option from a <select> element. At least one of value, label or index is required. Returns { selected } — the selected option values.

ParameterTypeDescription
selectorstringCSS selector of select element
valuestringOption value
labelstringOption label text
indexnumberOption index

browser_hover

Hover over an element. Returns { hovered: true }.

ParameterTypeDescription
selectorstringCSS selector
position{ x, y }Position relative to element

browser_scroll

Scroll the page or a specific element. Returns { scrolled: true }.

ParameterTypeDescription
directionenumup | down | left | right
amountnumberScroll amount in pixels (default: 500)
selectorstringCSS selector of scrollable element

browser_press_key

Press a keyboard key with optional modifiers (sent as a combo such as Control+a). Returns { pressed: true }.

ParameterTypeDescription
keystringKey to press (e.g. "Enter", "Tab", "a")
modifiersstring[]Shift, Control, Alt, Meta

browser_drag_and_drop

Drag an element and drop it onto another. Returns { dropped: true }.

ParameterTypeDescription
sourcestringCSS selector of drag source
targetstringCSS selector of drop target

browser_fill_form

Smart form filler. For each key it tries, in order: input[name], input[placeholder], input[aria-label], textarea[name], select[name], then an input / textarea / select inside a <label> containing the text, and fills the first match.

ParameterTypeDescription
fieldsRecord<string, string | boolean | string[]>Field name/label to value mapping

String values are typed into inputs, booleans check or uncheck checkboxes, and string arrays select options. When stealth is enabled, typing uses human-like delays. Returns { filled, skipped, errors }: the keys that were filled, the keys with no matching field or that failed, and { field, error } for failures.

// the agent calls this tool with:
{
  "fields": {
    "Email": "user@example.com",
    "Password": "secret",
    "Remember me": true,
    "Country": ["US"]
  }
}

browser_upload_file

Upload files to a file input element. Paths are resolved against the working directory and must exist, otherwise the tool throws Upload file not found. Returns { uploaded: true }.

ParameterTypeDescription
selectorstringCSS selector of file input
filePathsstring[]Paths to the files (at least one)

Extraction

7 tools for reading page content.

browser_get_text

Extract rendered text (innerText) from the page or the first element matching the selector. Hidden elements, scripts and styles are excluded. Returns { text }.

ParameterTypeDescription
selectorstringCSS selector (defaults to body)

browser_get_html

Get HTML content. Without a selector returns the full document; with one, the element's inner HTML, or its outer HTML when outer is set. Returns { html }.

ParameterTypeDescription
selectorstringCSS selector (defaults to full page)
outerbooleanInclude outer HTML of element

browser_get_attribute

Get the value of an attribute on a DOM element. Returns { value } (null when the attribute is missing).

ParameterTypeDescription
selectorstringCSS selector
attributestringAttribute name

Extract all links from the page or the first element matching selector. Returns { links } with text, href and title for each link; href is the raw attribute unless baseUrl is given.

ParameterTypeDescription
selectorstringCSS selector to scope link search
baseUrlstringBase URL for resolving relative links

browser_query_selector_all

Query all elements matching a CSS selector. Returns { elements } with tag, text (first 200 characters), attributes and visible for each.

ParameterTypeDescription
selectorstringCSS selector
attributesstring[]Attributes to include (default: id, class, href, src, type, name)
limitnumberMax elements to return

browser_extract_table

Extract structured data from an HTML table as { headers, rows }. Headers come from the last <thead> row, or from the first row when there is no <thead>. Uses the table's own rows and cells, so nested tables do not leak extra rows. If the selector matches a wrapper element, the first table inside it is used; when nothing matches, both arrays are empty.

ParameterTypeDescription
selectorstringCSS selector of the table or a wrapper (defaults to the first table)

browser_extract_structured

Extract the rendered text of the page or a scoped element without cloning the DOM (no side effects on the page). Scripts, styles, and non-visible elements are excluded and runs of blank lines collapsed. Returns { instruction, text, url, title } so the agent can pull the requested data out of the text itself.

ParameterTypeDescription
instructionstringWhat data to extract
selectorstringCSS selector to scope extraction

Vision

4 tools for visual interaction. See the dedicated Vision page for details.

browser_screenshot

Take a screenshot of the page or element (first match). Returns { image, mimeType, width, height } with base64-encoded image data. fullPage only applies to page screenshots.

ParameterTypeDescription
fullPagebooleanCapture full scrollable page
selectorstringCSS selector of element to capture
qualitynumberImage quality 0-100 (switches to JPEG)

browser_screenshot_element

Screenshot a specific element (first match) as PNG. Returns { image, boundingBox }.

ParameterTypeDescription
selectorstringCSS selector of element

browser_find_by_description

Find elements matching a natural language description using the accessibility tree. Returns { elements, total } (up to 50 elements with role, name, description).

ParameterTypeDescription
descriptionstringNatural language description

browser_click_by_description

Find an element by description and click it. Tries button, link, text, label, and placeholder strategies. Returns { clicked, element }.

ParameterTypeDescription
descriptionstringNatural language description
indexnumberIndex of match if multiple found

Network

6 tools for request interception and traffic monitoring. See the dedicated Network page for details.

browser_intercept_request

Intercept HTTP requests matching a URL pattern in every tab. Returns { interceptorId }.

ParameterTypeDescription
urlPatternstringGlob (**/api/**) or regex literal (/\.png$/i)
actionenumblock | modify | continue
modifyobject{ headers?, body?, url? } for action=modify; headers are merged

browser_remove_interceptor

Remove an interceptor created by browser_intercept_request or browser_block_resources. Returns { removed } — the removed ids.

ParameterTypeDescription
interceptorIdstringInterceptor to remove; omit to remove all

browser_wait_for_response

Wait for an HTTP response matching a URL pattern. Returns { url, status, headers, body }.

ParameterTypeDescription
urlPatternstringURL substring or regex literal
timeoutnumberTimeout in milliseconds; 0 disables it

browser_block_resources

Block specific resource types from loading. Returns { blocking: true, interceptorId, types }.

ParameterTypeDescription
typesstring[]image, stylesheet, font, media, script

browser_capture_har

Start or stop capturing HTTP traffic of all tabs. Stop returns { capturing: false, entries, truncated, har, path? }.

ParameterTypeDescription
actionenumstart | stop
pathstringPath inside the working directory for a HAR 1.2 file (on stop)

browser_get_api_calls

Get captured XHR/fetch API calls with optional filtering. Returns { calls }.

ParameterTypeDescription
urlPatternstringFilter by URL substring or regex literal
methodstringFilter by HTTP method
clearbooleanRemove the returned calls from the history; calls the filters excluded are kept

On this page