AI manager tools

Each tool the desktop must run, with the request the stream sends and the result to post back. Server tools are listed so they are not implemented on the device.

How a tool runs

During POST {node_base}/api/agent/agents/{id}/messages, a desktop tool arrives as an SSE event named tool_request. The stream stays open until the result is posted, or 120 seconds pass.

Incoming request:

event: tool_request
data: { "callId": "call_abc", "name": "read_file", "args": { "path": "notes/plan.md" } }

Post the result on the same token:

POST {node_base}/api/agent/runs/{runId}/tool-result
Authorization: Bearer <ai_manager token>
Content-Type: application/json

{
  "callId": "call_abc",
  "ok": true,
  "result": { }
}

On failure:

{
  "callId": "call_abc",
  "ok": false,
  "error": "what went wrong"
}

Success is { "accepted": true }. A result posted after the user stops is also { "accepted": true } and is ignored. A mismatched callId, run, or user is 404 That tool request is not waiting. The body limit is 8MB. File paths are relative to the one folder the user allowed. Paths that leave that folder, and symbolic links, fail.

A server tool does not send tool_request. The stream sends tool with { type, phase, name, detail } instead. Show that in the thread. Do not post a tool result for it.

Files

The app runs these inside the one folder the user allowed. read_file returns text, and extracts text from PDF and Excel. Text files over 1 MB are refused. write_file creates .txt, .md, and .markdown, and a code file the user asked for. A new file is saved immediately. Replacing a whole file asks first. replace_file_content changes one exact passage.

search_files

Request args:

{ "query": "*", "path": "" }

query is a filename or glob. * or *.md returns at most 100 names. path is the folder, or empty for the allowed folder.

Result:

{
  "query": "*",
  "searchedFolder": "/Users/me/Notes",
  "scannedEntries": 40,
  "results": ["plan.md", "meetings/monday.md"],
  "truncated": false
}

read_file_bytes

The model does not call this. When read_document needs a file from the allowed folder, the app receives { "path": "reports/lab.pdf" }. Read that file and post { name, mimeType, base64 }. Refuse a path outside the folder. A result up to 40 MB is accepted.

read_file

Request args:

{ "path": "notes/plan.md" }

Result. Text, markdown, and code are returned as text. PDF and Excel are extracted. Text files over 1 MB, and PDF or Excel over 20 MB, are refused. content is the first 12,000 characters.

{
  "path": "notes/plan.md",
  "content": "# Plan\n...",
  "truncated": false,
  "charactersReturned": 128
}

search_file_content

Request args. query is an exact phrase of 2–200 characters.

{ "path": "notes/plan.md", "query": "release date" }

Result. At most 10 matches, each with two lines of context. line is 1-based.

{
  "path": "notes/plan.md",
  "query": "release date",
  "totalLines": 80,
  "matches": [
    { "line": 12, "snippet": "10: ...\n11: ...\n12: release date is Friday\n13: ...\n14: ..." }
  ],
  "truncated": false
}

search_documents

Request args. query is the phrase. path is the folder, or empty for the allowed folder. Searches .txt, .md, .markdown, .csv, .json, and .log.

{ "query": "release date", "path": "" }

Result. At most 20 matching lines. Does not search PDF or Excel.

{
  "query": "release date",
  "searchedFolder": "/Users/me/Notes",
  "results": [
    { "filePath": "notes/plan.md", "line": 12, "content": "...release date is Friday..." }
  ]
}

list_directory

Request args. Use "." for the allowed folder. One level only.

{ "path": "." }

Result. At most 200 entries. kind is file, directory, link, or other.

{
  "path": ".",
  "searchedFolder": "/Users/me/Notes",
  "entries": [
    { "name": "plan.md", "kind": "file" },
    { "name": "meetings", "kind": "directory" }
  ],
  "truncated": false
}

file_info

Request args:

{ "path": "notes/plan.md" }

Result. Kind and size only. No file text, mime type, or timestamps. Those belong to get_file_metadata.

{
  "path": "notes/plan.md",
  "kind": "file",
  "bytes": 2048
}

More file tools

These also run on the desktop, inside the same allowed folder. A change asks the user before it edits, moves, copies over a file, trashes, extracts, or zips.

ToolRequestResult
replace_file_contentpath, targetContent, replacementContent, startLine, endLine. Use 0 for both line fields to search the whole file. The passage must match once.{ path, replacements, lineDelta, snippet }
append_to_filepath, content{ path, bytesAppended, created }
apply_patchpatch, a unified diff{ files: [{ path, changed }] }. Nothing is written if a hunk does not match.
move_filesourcePath, destinationPath{ from, to, bytes }
copy_filesourcePath, destinationPath, overwrite{ from, to, bytes }
trash_filepath{ path, trashed: true }. The item goes to the system trash.
create_directorypath{ path, created: true }
read_file_linespath, startLine, lineCount (1–200){ path, startLine, lineCount, totalLines, content }
directory_treepath, maxDepth (1–4).{ path, tree, truncated }
regex_search_filespattern, path, fileExtension, caseSensitive.{ pattern, matches: [{ filePath, line, text }], truncated }. At most 20 matches.
diff_filespathA, pathB{ pathA, pathB, diff }
extract_archivearchivePath, destinationPath. Empty destination extracts next to the archive.{ archivePath, destinationPath, entries, truncated }
create_archivesourcePaths, outputZipPath. The zip must not already exist.{ outputZipPath, sources, bytes }
rename_fileSame as move_file: sourcePath, destinationPath. The destination must not already exist.{ from, to }
copy_directorySame as copy_file.{ from, to }
read_file_rangeSame as read_file_lines: path, startLine, lineCount.{ path, startLine, lineCount, content }
get_file_metadatapath{ path, kind, bytes, createdAt, modifiedAt, mimeType }
get_file_hashpath, algorithm of sha256, sha1, or md5{ path, algorithm, hash }
find_duplicate_filespath{ groups: [{ hash, paths }] }
read_file_previewpath, maxCharacters (1–4000){ path, preview, truncated }
read_file_encodingpath{ path, encoding }
make_directorySame as create_directory.{ path, created: true }
read_imagepath. png, jpg, jpeg, gif, or webp.Image bytes so the model can see the picture.
convert_filesourcePath, destinationPath, targetFormat.{ sourcePath, destinationPath, targetFormat }
merge_filessourcePaths, destinationPath.{ destinationPath, sources }
split_filepath, destinationDirectory, rule.{ path, files }
delete_filepath. Confirm every call. Permanent.{ path, deleted: true }
restore_filepath, destinationPath. Empty destination uses the original path.{ path, restored: true }
open_filepath.{ path, opened: true }
reveal_file_in_explorerpath.{ path, revealed: true }
get_recent_filespath, limit, kind.{ files }
filter_filespath, extension, name, minBytes, maxBytes, days.{ files, truncated }
bulk_rename_filespath, extension, pattern. Confirm first.{ renamed }
bulk_move_filessourcePaths, destinationDirectory. Confirm first.{ moved }
bulk_copy_filessourcePaths, destinationDirectory. Confirm first.{ copied }
compare_file_contentpathA, pathB.{ pathA, pathB, summary }
validate_filepath, format.{ path, valid, format, problems }
extract_file_metadatapath.{ path, metadata }
preview_filepath.{ path, preview }

write_file

Request args. .txt, .md, and .markdown, or a code file the user asked for. content is at most 200,000 characters. Missing parent folders are created. A new file is saved immediately. Replacing an existing file asks the user first. A partial edit uses replace_file_content.

{ "path": "notes/plan.md", "content": "# Plan\n" }

A new file is saved immediately. If the file already exists, ask the user before replacing it. Cancel posts a failure and leaves the file unchanged:

{
  "callId": "call_abc",
  "ok": false,
  "error": "The user declined to replace that file."
}

Result after a save:

{
  "path": "notes/plan.md",
  "bytes": 8,
  "replaced": false,
  "searchedFolder": "/Users/me/Notes"
}

Terminal

The app runs this inside the allowed folder. Show the exact command and folder and ask Allow or Deny. The command cannot read keyboard input. The server waits up to 15 minutes.

run_command

Request args. command is the program or the full shell line. args is an extra argument list, or empty. cwd is relative to the allowed folder. Empty or "." uses that folder. Confirm every call.

{ "command": "python3", "args": ["main.py"], "cwd": "." }

If the user denies it:

{
  "callId": "call_abc",
  "ok": false,
  "error": "The user declined to run this command."
}

Result. Keep the last 8000 characters of each stream.

{ "exitCode": 0, "stdout": "ok\n", "stderr": "" }

Browser

The app runs these in its own browser. Open a page before reading, clicking, or listing links. Viewport for screenshots and coordinate clicks is 1280 by 720.

browser_open

Request args. HTTP or HTTPS only, 1–2048 characters, no username or password in the URL.

{ "url": "https://example.com" }

Result:

{ "url": "https://example.com/", "title": "Example Domain", "status": 200 }

browser_get_text

Request args:

{ }

Result. text is the first 12,000 characters of the visible page text.

{
  "url": "https://example.com/",
  "title": "Example Domain",
  "text": "Example Domain\n...",
  "truncated": false
}

browser_click

Request args. text is the exact visible text, 1–200 characters, and must match one element.

{ "text": "More information" }

Result:

{ "clicked": "More information", "url": "https://example.com/more", "title": "More" }

browser_fill

Request args. label is the exact accessible label, 1–200 characters, and must match one field. value is at most 2,000 characters.

{ "label": "Email", "value": "user@example.com" }

Result:

{ "filled": "Email", "url": "https://example.com/login", "title": "Sign in" }

browser_screenshot

Request args:

{ }

Result. screenshotBase64 is a PNG of the current viewport. The model sees the image. The stored event keeps the size only.

{
  "url": "https://example.com/",
  "title": "Example Domain",
  "width": 1280,
  "height": 720,
  "screenshotBase64": "<png base64>"
}

browser_click_at

Request args. Integers inside the 1280 by 720 viewport. Use coordinates from a recent screenshot.

{ "x": 640, "y": 360 }

Result:

{ "clickedAt": { "x": 640, "y": 360 }, "url": "https://example.com/", "title": "Example Domain" }

browser_press_key

Request args. One key, or one of Enter, Tab, Escape, Backspace, Delete, Space, the arrow keys, Home, End, PageUp, PageDown, Control+L, Control+A, Control+C, Control+V, Control+F, Meta+L, Meta+A, Shift+Tab.

{ "key": "Enter" }

Result:

{ "pressedKey": "Enter", "url": "https://example.com/", "title": "Example Domain" }

browser_scroll

Request args. direction is up or down (about one viewport), or top or bottom.

{ "direction": "down" }

Result:

{ "direction": "down", "url": "https://example.com/", "title": "Example Domain" }

browser_back

Request args:

{ }

Result:

{ "url": "https://example.com/", "title": "Example Domain", "status": 200 }

browser_wait_for

Request args. Pass "" for a condition you are not using. state is visible, attached, hidden, or networkidle. timeout_ms of 0 waits 10 seconds. The maximum is 30000.

{ "text": "Order Confirmed", "selector": "", "state": "visible", "timeout_ms": 0 }

Result:

{
  "found": true,
  "condition": "text: Order Confirmed",
  "elapsed_ms": 1420,
  "url": "https://example.com/checkout",
  "title": "Checkout Complete"
}

browser_tab_manager

Request args. action is list_tabs, get_active_tab, switch_tab, new_tab, duplicate_tab, or close_tab. Use tab_index -1 when the action does not need an index, or to close or duplicate the active tab. url is empty except when new_tab should open a page. At most 8 tabs.

{ "action": "switch_tab", "tab_index": 1, "url": "" }

Result:

{
  "action": "switch_tab",
  "active_tab_index": 1,
  "tabs": [
    { "index": 0, "title": "Dashboard", "url": "https://example.com/app" },
    { "index": 1, "title": "OAuth Login", "url": "https://auth.example.com/login" }
  ]
}

browser_select_option

Request args. label is the accessible label, or selector is a CSS selector. Leave the unused one empty. value is the visible option text or the option value.

{ "label": "State", "selector": "", "value": "California" }

Result:

{
  "selected": "California",
  "value": "CA",
  "label": "State",
  "url": "https://example.com/shipping",
  "title": "Shipping Details"
}

More browser tools

These also run in the app browser. A selector is a CSS selector of 1–300 characters. timeout_ms of 0 waits 10 seconds, and the maximum is 30000. Downloads, copying selected text, saving the page, uploading files, reading or clearing cookies, and reading or changing page storage ask the user first.

ToolRequestResult
browser_reload{ "tab_index": -1, "ignore_cache": false }. -1 is the active tab. ignore_cache true is a hard reload.{ url, title }
browser_forward{ }{ url, title }
browser_get_url{ }{ url }
browser_get_title{ }{ title }
browser_get_page_info{ }{ url, title, readyState }
browser_find_text{ "text": "Release date" }{ found, count }
browser_get_element_text{ "selector": "h1" }{ text }
browser_get_element_attribute{ "selector": "a", "attribute": "href" }{ attribute, value }
browser_get_dom{ "selector": "" }. Empty is the whole page.{ dom, truncated }. At most 12000 characters.
browser_wait_for_navigation{ "timeout_ms": 0 }{ url, title }
browser_wait_for_load_state{ "state": "networkidle", "timeout_ms": 0 }{ state, url }
browser_hover{ "selector": ".menu", "text": "" }. One of selector or visible text. Leave the other empty.{ hovered: true }
browser_double_click{ "selector": ".row", "text": "" }{ url, title }
browser_right_click{ "selector": ".row", "text": "" }{ opened: true }
browser_type{ "selector": "input[name=q]", "text": "hello", "delay_ms": 0, "clear": false }. Empty selector types into the focused field.{ typed: true }
browser_clear{ "selector": "input[name=q]", "label": "" }{ cleared: true }
browser_check{ "selector": "#agree", "label": "", "text": "" }{ checked: true }
browser_uncheck{ "selector": "#agree", "label": "", "text": "" }{ checked: false }
browser_select_text{ "selector": "p", "text": "", "start": -1, "end": -1 }. text is a substring. -1 means that offset is unused.{ selected: true }
browser_copy_text{ "selector": "" }. Empty copies the selection. Ask first.{ copied: true, characters }
browser_download_file{ "url": "https://example.com/report.pdf", "selector": "" }. Empty url clicks the selector instead. Ask first.{ url, path }
browser_get_downloads{ "limit": 0 }. 0 means 20. Maximum 50.{ downloads: [{ url, path, status }] }
browser_upload_multiple_files{ "file_paths": ["a.pdf"], "selector": "" }. 1 to 10 relative paths. Empty selector uses the first file input. Ask first.{ uploaded: true, files }
browser_upload_filefile_path, selector. One relative path. Empty selector uses the first file input. Ask first.{ uploaded: true, files }
browser_wait_for_download{ "filename": "", "directory": "", "timeout_ms": 0 }. Empty filename or directory means unused.{ status, path }
browser_get_active_tab{ }{ index, url, title, total }
browser_close_tab{ "tab_index": -1 }. -1 closes the active tab.{ closed: true }
browser_duplicate_tab{ "tab_index": -1 }{ index, url, title }
browser_navigate_history{ "steps": -1 }. The history delta, from -20 to 20, excluding 0.{ url, title }
browser_save_page{ "path": "pages/example.html", "format": "html" }. Format is html, pdf, text, or png. Empty path lets the browser choose a name. Ask first.{ path, format, bytes }
browser_wait_for_element{ "selector": "h1", "state": "visible", "timeout_ms": 0 }. State is visible, hidden, attached, or detached.{ found, state, url }
browser_get_cookies{ "domain": "", "name": "" }. Empty domain is the current page. Empty name is every cookie for that site. Other sites are not returned. Ask first.{ url, domain, cookies: [{ name, value, domain, path, httpOnly, secure }], truncated }
browser_clear_cookies{ "domain": "", "name": "" }. Empty domain is the current page. Empty name clears every cookie for that site. Ask first.{ cleared, domain, name }
browser_get_storage{ "storage": "local", "key": "" }. storage is local or session. Empty key returns up to 50 entries for the current page. Ask first.{ url, storage, items: [{ key, value, truncated }], total }
browser_set_storage{ "storage": "local", "key": "theme", "value": "dark" }. Current page only. Ask first.{ updated: true, storage, key, url }
browser_get_console_logs{ "level": "", "limit": 0 }. Empty level is every level. 0 means 50. Maximum 200.{ count, logs: [{ level, text, url, at }] }
browser_get_network_errors{ "url": "", "limit": 0 }. Empty url is every failed request. 0 means 50. Maximum 200.{ count, errors: [{ url, method, status, error, resourceType, at }] }

browser_links

Request args:

{ }

Result. At most 40 http or https links. text is at most 120 characters.

{
  "url": "https://example.com/",
  "title": "Example Domain",
  "links": [
    { "text": "More information", "href": "https://www.iana.org/domains/example" }
  ]
}

System

The app runs these on the user's computer. capture_screen, request_permission, cancel_operation, and run_command confirm every call. If the user declines, post ok: false. Process results include the program name, pid, CPU, and memory. Do not include command lines, environment variables, or addresses.

ToolRequestResult
get_system_info{ }{ operatingSystem, platform, release, arch, cpuModel, cpuCount, totalMemoryBytes, freeMemoryBytes, uptimeSeconds }
get_disk_usage{ "drive": "" }. Empty reports every main disk. C reports that disk.{ drives: [{ mount, totalBytes, usedBytes, availableBytes }] }
list_running_processesname, sort (empty, memory, or cpu), limit. limit 0 means 60.{ query, total, listed, processes: [{ pid, name, cpuPercent, memoryBytes }] }
get_process_infopid, name. Use pid 0 with a name, or a pid with an empty name.{ pid, name, state, cpuPercent, memoryBytes, elapsed }. If it is not running, No process with that id is running.
launch_application{ "application": "Safari" }. The installed name, with no path.{ application, opened: true }. Missing app: That application is not installed.
get_installed_applicationsquery, limit. Empty query lists apps. limit 0 means 200.{ total, listed, applications }
get_clipboard_text{ }. Needs clipboard permission when the system requires it.{ text, truncated }. At most 8000 characters.
set_clipboard_text{ "text": "hello" }. 1–8000 characters.{ updated: true, characters }
show_desktop_notification{ "title": "Done", "body": "The report is ready." }. Title at most 80 characters, body at most 200.{ shown: true, title }
open_system_settingspane. Empty opens the main window. Otherwise general, wifi, network, bluetooth, notifications, privacy, sound, display, battery, keyboard, mouse, trackpad, accessibility, users, printers, datetime, or storage.{ pane, opened: true }
get_environment_info{ }{ runtime: { node, platform, arch, appName, appVersion }, environment }. environment may include only HOME, USER, LOGNAME, SHELL, LANG, LC_ALL, TMPDIR, TEMP, and TMP.
get_network_status{ }{ online, interfaces: [{ name, connected }] }
get_battery_status{ }{ available, percent, charging, state, powerSource }. available: false when there is no battery.
get_active_window{ }{ available: true, application, title, pid }. Without accessibility permission: { available: false, permission: "denied" }.
capture_screenoutput_path. Empty lets the desktop choose the file. A path is relative. Confirm every call. Requires screen-capture permission.{ mediaType: "image/png", imageBase64, path }. Decline: The user declined to capture the screen. Missing permission: Screen capture permission is not granted.
request_permission{ "permission": "screen" }. One of clipboard, screen, notifications, accessibility. Confirm every call.{ permission, status }. status is granted, denied, not_determined, or unavailable.
get_permission_statusSame permission value. Do not prompt.Same result as request_permission.
get_app_version{ }{ name, version, build } for this desktop app.
get_operation_statusoperation_id. Empty lists tracked operations.{ operations: [{ operationId, status }] } or one { operationId, status }. Status is running, finished, or not_running.
cancel_operationoperation_id. Required. Confirm every call.{ operationId, cancelled: true }. If it cannot be cancelled: That operation is not running.

Tasks

The desktop runs these. They record and control tracked work. Creating a task or workflow does not run it. Starting, cancelling, retrying, and rolling back ask the user first. Reminders and repeating jobs use the server schedule_task.

ToolRequestResult
create_taskname, instruction, inputs. Empty inputs are allowed.{ taskId }
run_tasktask_id. An id or a name. Ask first.{ taskId, status }
pause_tasktask_id{ taskId, status: "paused" }
resume_tasktask_id{ taskId, status: "running" }
cancel_tasktask_id. Ask first. Completed steps stay done.{ taskId, status: "cancelled" }
get_task_statustask_id{ taskId, status, progress }. Status is queued, running, paused, succeeded, failed, or cancelled.
get_task_historylimit (1–50), status, name, days. Empty status or name, and days 0, mean that filter is unused.{ tasks: [{ taskId, name, status, at }] }
retry_failed_tasktask_id. Ask first.{ taskId, status }
get_task_logstask_id, severity (empty, error, warn, or info), step_id (empty for every step).{ taskId, logs }
request_user_confirmationoperation_id, message. Empty operation id is allowed.{ operationId, approved }
create_workflowname, steps (1–30 strings).{ workflowId }
run_workflowworkflow_id, inputs. Empty inputs are allowed. Ask first.{ workflowId, status }
validate_workflowworkflow_id. Does not run it.{ workflowId, valid, problems }
get_workflow_statusworkflow_id, run_id. Empty run id means the latest run.{ workflowId, runId, status, progress }
rollback_operationoperation_id. Ask first.{ operationId, rolledBack: true }. If none exists: That operation cannot be rolled back.
get_approval_statusoperation_id{ operationId, status }. Status is granted, denied, pending, or expired.

Server tools

These run on the AI manager. Do not handle them as tool_request.

ToolRequest the model sendsResult the server keeps
calculate { "operation": "add", "a": 2, "b": 2 }. operation is add, subtract, multiply, or divide. The number, for example 4.
current_time { } { "iso": "2026-10-15T08:00:00.000Z" }
open_connectors { "connectors": ["jira"] } { "tools": [ { "name", "description", "input_schema" } ] }. If an app is not connected, also not_connected and message, and the stream sends connect_required.
connector_call { "tool": "jira__get_issue", "arguments": "{\"issue_key\":\"RC-1\"}" }. arguments is a JSON object string. Read actions only. The parsed data from that app.
research_notes { "known", "missing", "leads", "next" }, each a string. { "saved": true, "next": "..." }
delegate_to_agent { "agent_type": "file_specialist", "instruction": "List the notes folder." } The specialist's findings. The chat assistant does not use this tool.
show_code kind (page, script, or project), title, files (each path, language, content), sample_input, sample_output, output_verified. HTML for the code card shown under the answer.
schedule_task name, action (agent or notify), instruction, title, body, run_at or cron_expression, timezone, ends_at, plus watch fields when the user wants something watched. { scheduled: true, task }. Results are posted in the chat and listed by GET /api/agent/notifications.
view_image { "url": "https://example.com/shot.png" }. A direct HTTP or HTTPS image URL. The image, shown to the model. Private Slack or Jira files use that app's own tool.
create_file kind (pdf, docx, pptx, xlsx, or csv), filename, and html, slides, or sheets for that kind. A downloadable file and a file_id that can be attached to mail, Slack, or a ticket.
read_document source (a file_... id, a path in the allowed folder, or an HTTP link) and page_images. Text, tables, slides, sheets, and images inside the file. A folder path is read through read_file_bytes.

Connected apps

When an app is not connected, the message stream sends:

event: connect_required
data: {
  "type": "connect_required",
  "apps": [
    {
      "id": "jira",
      "name": "Jira",
      "connect_path": "plugins/jira-connect",
      "title": "Connect Jira"
    }
  ]
}

Show a Connect button. The list for settings is:

GET {node_base}/api/agent/connectors

{
  "apps": [
    { "id": "jira", "name": "Jira", "connected": true },
    { "id": "slack", "name": "Slack", "connected": false }
  ]
}

Opening a connect page:

POST {node_base}/api/agent/connectors/link
{ "connector": "jira" }

{ "url": "https://ah.merge.dev/link/..." }

Open url in the system browser. Bitbucket does not use this link. Its response is 400 Bitbucket connects from its own plugin. After the user finishes in the browser, send the original question again so the assistant reads the app.