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:

  1. allowedTools — restrict which tools the AI is allowed to use for a specific call (see below).
  2. page.run(toolName, ...) — invoke a tool directly, bypassing the AI entirely (see page.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 nameDescriptionKey parameters
analyzePageTextReads and analyses the raw text content of the current pageanalysisToRun: string, additionalRelevantContext: string
assertEvaluates a natural-language assertion about the current page stateassertionToTestFor: string
assertPageEvaluates a page-level assertion (URL, title, visibility, etc.)type: "url" | "title" | "content", expected: string
changeWebBrowserTabSwitches to another open browser tab by URLtabUrl: string
chooseSelectOptionSelects an option from a <select> dropdown elementselector: ElementSelector, optionValues: string[]
clickClicks an element identified by a selectorselector: ElementSelector
doubleClickDouble-clicks an elementselector: ElementSelector
goForwardOrBackNavigates the browser history forward or backwarddirection: "FORWARD" | "BACK"
goToWebpageNavigates to a URLurl: string
handleBrowserDialogAccepts or dismisses browser dialogs (alert, confirm, prompt)text: string | null
hoverOverElementMoves the mouse over an element without clickingselector: ElementSelector
inputRandomizedEmailAddressTypes a randomly generated email address into an input fieldbaseEmail: string, selector: ElementSelector
inputTextTypes text into an input field, clearing any existing value firstselector: ElementSelector, text: string
makeCommentRecords an explanatory note in the flow log without interacting with the pagecomment: string
markObjectiveCompleteSignals that the instruction has been fulfilled — ends the flow successfully(none)
markObjectiveNotCompletableSignals that the instruction cannot be completed — ends the flow with a non-success state(none)
pressKeySimulates a keyboard key press (e.g. Enter, Escape, Tab)selector: ElementSelector, key: string
rememberPageTextStores a piece of page text in the flow's working memory for use in later stepsname: string, selector: ElementSelector
scrollPageScrolls the page in a given directiondirection: "UP" | "DOWN" | "LEFT" | "RIGHT"
setRunModeSwitches the flow between autonomous and manual replay modesrunMode: string
waitWaits for a specified number of millisecondsseconds: 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 nameDescriptionKey parameters
acknowledgeUserInstructionAcknowledges a direct instruction from the user during a paused flowinstruction: string
assertPageTextAsserts that specific text appears (or does not appear) in the page contenttext: string, shouldExist: boolean
createBrowserCookieReportGenerates a structured report of all cookies in the current browser session(none)
detectBrokenLinksScans the current page for links that return error responses(none)
downloadPdfDownloads a PDF from a URLurl: string
pauseForUserInteractionPauses the flow and waits for a human to interact with the browser(none)
reloadPageReloads the current page(none)
runAccessibilityTestRuns an axe-core accessibility audit on the current page(none)
runInlineJavaScriptCodeExecutes a JavaScript snippet directly in the browser page contextcode: string
runSandboxedJavaScriptCodeExecutes a JavaScript snippet in an isolated sandbox (no DOM access)code: string
saveWebpageAsPdfSaves the current page as a PDF filepath: string
summarizeLearningsCompiles and summarises information gathered in previous rememberPageText steps(none)
triggerDonobuFlowInvokes another Donobu flow by ID as a sub-flowflowId: 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().