Skip to main content

Built-in Tools Reference

The Agent has a set of built-in tools that the AI can call automatically during a conversation. These tools are available by default in persistent conversations, and script developers usually don't need to call them directly — the AI automatically picks the right tool based on the user's intent.

Understanding what these tools can do helps you write better system prompts and custom tools.

Web Data Fetching​

web_fetch​

Fetches the content of a URL, supporting HTML-to-text extraction and LLM summarization.

ParameterTypeRequiredDescription
urlstringYesTarget URL (http/https only)
promptstringNoSummarization prompt (when provided, the LLM is used to distill the content)
max_lengthnumberNoMaximum character count for the content

Behavior details:

  • 30-second request timeout
  • HTML content automatically extracts the main body (removing navigation, sidebars, etc.)
  • JSON responses are automatically parsed
  • Plain text is returned as-is
  • When prompt is provided, the fetched content is sent to the LLM for summarization

Return value:

{
"url": "https://example.com",
"content_type": "text/html",
"content": "The extracted body content...",
"truncated": false,
"final_url": "https://example.com/redirected"
}

Queries a search engine and returns structured search results.

ParameterTypeRequiredDescription
querystringYesThe search keywords
max_resultsnumberNoMaximum number of results (defaults to 5, capped at 10)

Supported search engines:

EngineDescriptionConfiguration required
DuckDuckGoThe default engineNo configuration needed
BingMicrosoft Bing SearchRequires an API Key
BaiduBaidu SearchNo API Key needed
Google Custom SearchGoogle Custom SearchRequires an API Key + CSE ID

Search engines are configured in the dashboard under Agent → Settings.

Return value:

[
{
"title": "Search result title",
"url": "https://example.com/result",
"snippet": "Result snippet text..."
}
]

get_tab_content​

Reads the rendered page content of a given tab, converting it into structured Markdown with CSS-selector annotations.

ParameterTypeRequiredDescription
tab_idnumberYesTab ID
selectorstringNoA CSS selector; only extracts the matching part
promptstringNoSummarization prompt
max_lengthnumberNoMaximum character count for the content

Difference from web_fetch: get_tab_content reads the page as already rendered by the browser (including dynamic JS content), while web_fetch makes a new HTTP request.

Return value:

{
"tab_id": 123,
"url": "https://example.com",
"title": "Page title",
"content": "Structured content...",
"truncated": false,
"used_selector": "main"
}

Tab Management​

list_tabs​

Queries open tabs, supporting several filter conditions.

ParameterTypeRequiredDescription
url_patternstringNoA regex to match the URL
title_patternstringNoA regex to match the title
activebooleanNoOnly return the active tab
window_idnumberNoA specific window
audiblebooleanNoOnly return tabs currently playing audio

open_tab​

Opens a new tab or navigates an existing one.

ParameterTypeRequiredDescription
urlstringYesTarget URL
tab_idnumberNoAn existing tab ID (when provided, navigates that tab; otherwise a new tab is opened)
activebooleanNoWhether to activate it (defaults to true)
window_idnumberNoA specific window
wait_until_loadedbooleanNoWhether to wait for the page to finish loading (defaults to true)

close_tab​

Closes a tab.

ParameterTypeRequiredDescription
tab_idnumberYesTab ID

activate_tab​

Activates a tab and focuses its window.

ParameterTypeRequiredDescription
tab_idnumberYesTab ID

File System (OPFS)​

opfs_write​

Writes a file to the workspace.

ParameterTypeRequiredDescription
pathstringYesFile path
contentstringYesFile content (supports binary via a data URL)

opfs_read​

Reads a file from the workspace. By default it auto-detects the file type: text files return their content, binary files return a blob URL.

ParameterTypeRequiredDescription
pathstringYesFile path
modestringNo"text" / "blob" / "auto" (default), forces the return mode
offsetnumberNoStarting line number (1-based), text mode only
limitnumberNoNumber of lines to read, text mode only (pagination is required once text exceeds 200 lines)

opfs_list​

Lists the contents of a directory.

ParameterTypeRequiredDescription
pathstringNoDirectory path (defaults to the root directory)

opfs_delete​

Deletes a file or directory.

ParameterTypeRequiredDescription
pathstringYesFile/directory path

User Interaction​

ask_user​

Asks the user a question, supporting either free-form input or a structured choice.

ParameterTypeRequiredDescription
questionstringYesThe question content
optionsstring[]NoA list of choices (when provided, this becomes a multiple-choice question)
multiplebooleanNoWhether multiple selection is allowed (defaults to false)

Timeout: returns { answer: null, reason: "timeout" } after 5 minutes without a response.

Return value:

{ "answer": "The user's answer text" }

execute_script​

Executes JavaScript code on the page or in the sandbox.

ParameterTypeRequiredDescription
codestringYesThe JavaScript code
targetstringYes"page" or "sandbox"
tab_idnumberNoThe target tab when target is page (defaults to the current active tab)
worldstringNo"MAIN" or "ISOLATED" (default), page mode only

Execution environment comparison:

EnvironmentDOMPage JSExtension blob URLsUse case
page + ISOLATEDYesNoYesReading the DOM, extracting content
page + MAINYesYesNoCalling page functions
sandboxNoNoNoPure computation

Sub-agents​

agent​

Spawns an independent sub-agent to handle a complex sub-task.

ParameterTypeRequiredDescription
promptstringYesThe sub-task description
descriptionstringNoA short label (3-5 words, used in the UI)
typestringNoThe sub-agent type (see below); defaults to "general"
tab_idnumberNoA tab ID passed to the sub-agent, which will operate on that tab

Sub-agent types:

typeDescriptionAvailable tools
researcherInformation retrieval (read-only)web_search, web_fetch, reading page content
page_operatorBrowser automationTab management, DOM operations, page interaction
generalGeneral-purpose (default)All tools

Characteristics:

  • A sub-agent has its own independent conversation context
  • It cannot use ask_user or agent (to prevent recursion)
  • The sub-agent's events are passed to the parent conversation via sub_agent_event

Task Management​

This group of tools manages a temporary task list within a conversation (in-memory, not persisted).

create_task​

ParameterTypeRequiredDescription
subjectstringYesTask title
descriptionstringNoDetailed description

get_task​

ParameterTypeRequired
task_idstringYes

update_task​

ParameterTypeRequiredDescription
task_idstringYesTask ID
statusstringNo"pending" / "in_progress" / "completed"
subjectstringNoNew title
descriptionstringNoNew description

list_tasks​

Takes no parameters; returns a brief list of all tasks.

delete_task​

ParameterTypeRequired
task_idstringYes

The task management tools mainly let the AI track its own progress while working through complex, multi-step tasks; task data is not persisted.