Cogitator
Browser

Tools Reference

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

Overview

browserTools(session) returns all 32 tools. You can filter by module or import individual tool factories.

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

const allTools = browserTools(session);

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

7 tools for page navigation and waiting.

browser_navigate

Navigate to a URL. Returns the final URL, page title, and HTTP status.

ParameterTypeDescription
urlstringURL to navigate to
waitUntilenumload | domcontentloaded | networkidle | commit

browser_go_back

Go back to the previous page in browser history. No parameters.

browser_go_forward

Go forward to the next page in browser history. No parameters.

browser_reload

Reload the current page.

ParameterTypeDescription
waitUntilenumload | domcontentloaded | networkidle | commit

browser_wait_for_navigation

Wait for the page to navigate to a URL matching a pattern.

ParameterTypeDescription
urlstringURL pattern to wait for
timeoutnumberTimeout in milliseconds

browser_get_current_url

Get the current page URL and title. No parameters.

browser_wait_for_selector

Wait for a CSS selector to appear on the page.

ParameterTypeDescription
selectorstringCSS selector to wait for
stateenumvisible | hidden | attached | detached
timeoutnumberTimeout in milliseconds

Interaction

9 tools for clicking, typing, and form manipulation.

browser_click

Click an element by CSS selector.

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 or type() for keystroke simulation. When stealth is enabled, automatically adds human-like delays between keystrokes.

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

browser_select_option

Select an option from a <select> element.

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

browser_hover

Hover over an element.

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

browser_scroll

Scroll the page or a specific element.

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.

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.

ParameterTypeDescription
sourcestringCSS selector of drag source
targetstringCSS selector of drop target

browser_fill_form

Smart form filler. Finds inputs by name, placeholder, aria-label, or associated label text.

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

String values are typed into inputs, booleans toggle checkboxes, and string arrays select multiple options. When stealth is enabled, typing uses human-like delays.

// 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.

ParameterTypeDescription
selectorstringCSS selector of file input
filePathsstring[]Absolute paths to files

Extraction

7 tools for reading page content.

browser_get_text

Extract text content from the page or a specific element.

ParameterTypeDescription
selectorstringCSS selector (defaults to body)

browser_get_html

Get HTML content of the page or a specific element.

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.

ParameterTypeDescription
selectorstringCSS selector
attributestringAttribute name

Extract all links from the page or a scoped element. Returns text, href, and title for each link.

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 tag, text, attributes, and visibility 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 and rows.

ParameterTypeDescription
selectorstringCSS selector of table

browser_extract_structured

Extract clean readable text from the page. Removes scripts, styles, and non-visible elements. Returns the text alongside the extraction instruction for agent processing.

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. Returns base64-encoded image data.

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 with bounding box coordinates.

ParameterTypeDescription
selectorstringCSS selector of element

browser_find_by_description

Find elements matching a natural language description using the accessibility tree.

ParameterTypeDescription
descriptionstringNatural language description

browser_click_by_description

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

ParameterTypeDescription
descriptionstringNatural language description
indexnumberIndex of match if multiple found

Network

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

browser_intercept_request

Intercept HTTP requests matching a URL pattern.

ParameterTypeDescription
urlPatternstringURL pattern (glob or regex)
actionenumblock | modify | continue
modifyobject{ headers?, body?, url? } for action=modify

browser_wait_for_response

Wait for an HTTP response matching a URL pattern.

ParameterTypeDescription
urlPatternstringURL pattern to match
timeoutnumberTimeout in milliseconds

browser_block_resources

Block specific resource types from loading.

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

browser_capture_har

Start or stop capturing HTTP traffic in HAR format.

ParameterTypeDescription
actionenumstart | stop
pathstringFile path to save HAR on stop

browser_get_api_calls

Get captured XHR/fetch API calls with optional filtering.

ParameterTypeDescription
urlPatternstringFilter by URL pattern
methodstringFilter by HTTP method

On this page