Available Tools Reference
Complete reference for all built-in tools that page.ai may invoke during an autonomous flow, with guidance on restricting tools with allowedTools.
A tool is a discrete action the AI can take during a page.ai() flow — clicking a button, typing text, navigating to a URL, making an assertion, and so on. When you call page.ai('instruction'), the AI chooses which tools to invoke and in what order to fulfil the goal.
Most of the time you do not interact with tools directly: the AI selects and uses them automatically. There are two reasons you might want to work with them explicitly:
allowedTools— restrict which tools the AI is allowed to use for a specific call (see below).page.run(toolName, ...)— invoke a tool directly, bypassing the AI entirely (seepage.run).
You can also create your own custom tools. See Custom Tools & Persistence Plugins for details.
Default tool set
When allowedTools is not specified, the following tools are available to the AI. These cover the actions needed for most browser automation tasks.
| Tool name | Description | Key parameters |
|---|---|---|
analyzePageText | Reads and analyses the raw text content of the current page | analysisToRun: string, additionalRelevantContext: string |
assert | Evaluates a natural-language assertion about the current page state | assertionToTestFor: string |
assertPage | Evaluates a page-level assertion (URL, title, visibility, etc.) | type: "url" | "title" | "content", expected: string |
changeWebBrowserTab | Switches to another open browser tab by URL | tabUrl: string |
chooseSelectOption | Selects an option from a <select> dropdown element | selector: ElementSelector, optionValues: string[] |
click | Clicks an element identified by a selector | selector: ElementSelector |
doubleClick | Double-clicks an element | selector: ElementSelector |
goForwardOrBack | Navigates the browser history forward or backward | direction: "FORWARD" | "BACK" |
goToWebpage | Navigates to a URL | url: string |
handleBrowserDialog | Accepts or dismisses browser dialogs (alert, confirm, prompt) | text: string | null |
hoverOverElement | Moves the mouse over an element without clicking | selector: ElementSelector |
inputRandomizedEmailAddress | Types a randomly generated email address into an input field | baseEmail: string, selector: ElementSelector |
inputText | Types text into an input field, clearing any existing value first | selector: ElementSelector, text: string |
makeComment | Records an explanatory note in the flow log without interacting with the page | comment: string |
markObjectiveComplete | Signals that the instruction has been fulfilled — ends the flow successfully | (none) |
markObjectiveNotCompletable | Signals that the instruction cannot be completed — ends the flow with a non-success state | (none) |
pressKey | Simulates a keyboard key press (e.g. Enter, Escape, Tab) | selector: ElementSelector, key: string |
rememberPageText | Stores a piece of page text in the flow's working memory for use in later steps | name: string, selector: ElementSelector |
scrollPage | Scrolls the page in a given direction | direction: "UP" | "DOWN" | "LEFT" | "RIGHT" |
setRunMode | Switches the flow between autonomous and manual replay modes | runMode: string |
wait | Waits for a specified number of milliseconds | seconds: number |
ElementSelector is { element: string[]; frame?: string | null } — an array of CSS selector strings tried in priority order, plus an optional frame selector.
Additional tools
The following tools are available but not included in the default set. To use them, pass their names in allowedTools:
await page.ai('Check the page for broken links', {
allowedTools: ['detectBrokenLinks', 'analyzePageText'],
});
| Tool name | Description | Key parameters |
|---|---|---|
acknowledgeUserInstruction | Acknowledges a direct instruction from the user during a paused flow | instruction: string |
assertPageText | Asserts that specific text appears (or does not appear) in the page content | text: string, shouldExist: boolean |
createBrowserCookieReport | Generates a structured report of all cookies in the current browser session | (none) |
detectBrokenLinks | Scans the current page for links that return error responses | (none) |
downloadPdf | Downloads a PDF from a URL | url: string |
pauseForUserInteraction | Pauses the flow and waits for a human to interact with the browser | (none) |
reloadPage | Reloads the current page | (none) |
runAccessibilityTest | Runs an axe-core accessibility audit on the current page | (none) |
runInlineJavaScriptCode | Executes a JavaScript snippet directly in the browser page context | code: string |
runSandboxedJavaScriptCode | Executes a JavaScript snippet in an isolated sandbox (no DOM access) | code: string |
saveWebpageAsPdf | Saves the current page as a PDF file | path: string |
summarizeLearnings | Compiles and summarises information gathered in previous rememberPageText steps | (none) |
triggerDonobuFlow | Invokes another Donobu flow by ID as a sub-flow | flowId: string |
Restricting tools with allowedTools
Narrowing the tool set improves reliability for flows where the scope of interaction is well-defined:
// Only allow the tools needed to fill and submit a form
await page.ai('Fill in the registration form and submit it', {
allowedTools: ['click', 'inputText', 'chooseSelectOption', 'pressKey'],
});
Note: even when allowedTools is set, markObjectiveComplete and markObjectiveNotCompletable are always included so the flow can terminate correctly.
Tool details
Handling browser dialogs
The handleBrowserDialog tool intercepts native browser dialogs. If your test navigates to a page that might trigger a dialog, ensure this tool is available (leave allowedTools unset or include it explicitly) — otherwise the AI may appear to hang waiting for a dialog it cannot dismiss.
Using inputRandomizedEmailAddress
The inputRandomizedEmailAddress tool generates a unique email address on each autonomous run. When the flow is replayed from the cache, it uses the same address that was generated during the first run, ensuring form submissions are reproducible.
Using rememberPageText and summarizeLearnings
rememberPageText stores a piece of page text in the flow's working memory. Across multiple steps or pages, these notes accumulate. summarizeLearnings compiles all stored notes into a single summary, which is useful for aggregating information gathered from several pages before producing a final result.
Invoking tools directly
You can invoke any tool by name without AI involvement using page.run().