Skip to main content
xbot
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage
Edit page

Built-in Tools

xbot includes 50+ built-in tools the agent can invoke during conversations. Every tool is available by default — no configuration needed.

Note
AI-native design: Tools like config and tui_control let the agent adjust its own settings and UI. You can say “switch to dark theme” or “resize the sidebar” and the agent handles it.

File Operations

ToolDescription
ReadRead file content with line numbers. Supports offset and max_lines for pagination. Binary files are rejected (NUL byte / non-UTF-8 payload) with a hint to inspect them via Shell (xxd / head -c / base64) — raw binary bytes are not text and cannot be persisted by every backend.
FileCreateCreate new files (and parent directories). Errors if file already exists unless rewrite is set.
FileReplaceFind-and-replace in files: exact string match or RE2 regex. Supports replace_all, line range restriction.
GlobFind files by glob pattern with ** recursive matching.
GrepSearch file contents with RE2 regex. Supports include filter, ignore_case, context_lines.
CdChange working directory. Persists across tool calls within the session.
DownloadFileDownload files from Feishu messages or web/OSS URLs.

Execution

ToolDescription
ShellExecute shell commands. Configurable timeout (default 120s, max 600s), background mode for long-running tasks. run_as available when permission control is enabled.
Note

Background mode: Set background: true for dev servers or build processes. The agent receives a task ID and continues working. Use task_status to check progress — but don’t poll repeatedly.

Promote to background (Web UI): while a foreground shell command is still running, click the “转后台” (promote) button below its terminal card — the command immediately moves to the background, the agent continues its iteration, and the output is injected into the conversation when it finishes. Timed-out commands are auto-promoted the same way (the live process is adopted in place, never re-executed). Manage promoted tasks with task_wait / task_status / task_kill.

Missing working directory: if the session’s working directory is deleted or moved while the session is alive (machine migration, git worktree cleanup, temporary-directory reclamation), Shell fails immediately with working directory "<path>" is not accessible: …; use the Cd tool to change to an existing directory. This is not a missing/broken shell binary (older versions misreported it as fork/exec <shell>: no such file or directory), and xbot deliberately does not fall back to your home or a parent directory — running git/rm in the wrong place is worse than an explicit failure. Recover by calling Cd with an existing absolute path; Shell works again right away.

ToolDescription
FetchFetch web URL content, convert HTML to markdown via readability, truncate with tiktoken.
WebSearchWeb search via Tavily API with configurable depth and max results.
search_toolsSemantic search for available tools using embedding similarity.
share_filePublish a local file as a web-accessible URL (web channel only): local storage copies it to uploads/agent/<uuid>/<name>; cloud storage (qiniu/s3) uploads and returns a signed URL
Note

share_file (web-only): charts, reports and screenshots produced by the agent can be embedded straight into a reply — the tool returns ready-to-paste Markdown (![name](url) renders inline for images, [name](url) is a download link).

  • The returned URL is the same-origin endpoint /api/files/download?key=agent%2F<uuid>%2F<name>, protected by the session cookie. The key contains an unguessable uuid, so unshared files have no reachable path.
  • Local storage (default, no cloud OSS configured): the file is copied to <XBOT_HOME>/uploads/agent/<uuid>/<name>; the URL never expires.
  • Cloud storage: uploaded through the storage provider and returned as a signed URL.
  • Registered only when the web channel is active (invisible to other channels).
  • In the Web UI the call renders as a dedicated card: icon + file name + inline image preview + Open / Copy-link; the collapsed tool pill uses a dedicated upload glyph and the “write” category colour (no longer the generic “unknown tool” wrench).

Context & Session

ToolDescription
context_editEdit conversation context: list turns, delete turn/message, truncate, regex replace.
ChatHistoryRetrieve recent messages from group chats.
recallRetrieve offloaded or masked observation content with pagination.
recall_maskedRetrieve masked observations. List all masked items or retrieve by ID.
offload_recallRetrieve offloaded tool result content by offload ID, with offset and limit pagination.
Info
Why offload? Large tool outputs are automatically stored to disk instead of clogging the context window. The agent sees a summary + an offload ID. Use offload_recall when you need the full content.

Scheduling & Events

ToolDescription
CronManage scheduled tasks: add (interval/delay/cron expression/at), list, remove.
EventTriggerManage webhook event triggers with Go template support and HMAC-SHA256 verification.

Interactive Cards (Feishu)

ToolDescription
card_createCreate interactive card sessions.
card_add_contentAdd content blocks: markdown, div, image, table, chart.
card_add_interactiveAdd interactive elements: button, input, select, date picker.
card_add_containerAdd containers: column set, form, collapsible panel.
card_previewPreview card JSON before sending.
card_sendSend card to a Feishu chat.

Feishu Docs & Drive

ToolDescription
feishu_docx_createCreate a new Feishu document.
feishu_docx_get_contentRead document content.
feishu_docx_get_blockGet a specific block by ID.
feishu_docx_list_blocksList all blocks in a document.
feishu_docx_find_blockFind blocks matching criteria.
feishu_docx_insert_blockInsert a new block.
feishu_docx_delete_blocksDelete blocks by ID.
feishu_bitable_fieldsList/manage Bitable fields.
feishu_bitable_recordRead/write Bitable records.
feishu_bitable_listList Bitable tables.
feishu_bitable_batch_createBatch create records.
feishu_list_all_bitablesList all Bitables accessible to the bot.
feishu_wiki_list_spacesList wiki spaces.
feishu_wiki_list_nodesList wiki nodes in a space.
feishu_wiki_get_nodeGet wiki node content.
feishu_wiki_move_nodeMove a wiki node.
feishu_wiki_create_nodeCreate a wiki node.
feishu_search_wikiSearch across wiki spaces.
feishu_download_fileDownload a file from Feishu.
feishu_upload_fileUpload a file to Feishu.
feishu_list_filesList files in Feishu Drive.
feishu_add_permissionAdd permission to a file/folder.
feishu_send_fileSend a file to a chat.

Memory Tools

Tools available depend on the memory provider. See Memory System for details.

Flat Provider (default)

ToolDescription
memory_writeWrite to the file-based memory store.
memory_listList current memory contents.

Letta Provider

ToolDescription
core_memory_appendAppend to core memory blocks (persona / human / working_context).
core_memory_replaceReplace content in core memory blocks.
rethinkRe-examine and evolve core memory (A-Mem style self-reflection).
archival_memory_insertInsert into archival (vector-backed) long-term memory.
archival_memory_searchSemantic search archival memory via embeddings.
recall_memory_searchSearch conversation history by date range (FTS5 full-text search).

SubAgents & Skills

ToolDescription
SubAgentDelegate tasks to sub-agents: one-shot or interactive multi-turn sessions. Supports foreground/background, model tier selection, and control actions (send, unload, inspect, interrupt).
CreateChatCreate agent private chats or moderated group chats (Meeting Mode with @mentions).
SendMessageSend messages to agents, groups, peer groups, sessions, or IM channels (Feishu).
SkillDiscover and load skills from ~/.xbot/skills/ or project .xbot/skills/.

Multi-Agent Collaboration

ToolDescription
WorktreeGit worktree-based multi-agent workspace isolation. Supports init, cleanup, status.
JoinGroupJoin a peer group for async broadcast communication.
LeaveGroupLeave a peer group.
ListGroupMembersList members of a peer group.

AI-Native Configuration

ToolDescription
configAI reads/modifies xbot config (config.json & runtime settings). Sensitive keys (API keys, tokens) are masked on read — the agent sees sk-a*** instead of the real key. Writes are not blocked.
tui_controlAI operates the TUI: switch/close sessions, resize sidebar, change theme, send slash commands, manage layout.

Background Tasks

ToolDescription
task_statusCheck background task status (shell commands run with background: true).
task_killTerminate a running background task.
task_readRead background task output.

MCP Integration

ToolDescription
ManageToolsAdd/remove/list/reload MCP servers dynamically.

Other

ToolDescription
AskUserAsk the user a multiple-choice question. Blocks until the user responds.
TodoWriteWrite/update the structured TODO list.
TodoListList current TODOs with status.
LogsList/read xbot log files with filtering.
oauth_authorizeSend an OAuth authorization card to the user (Feishu).

Permission Control

When permission control is enabled, Shell, FileCreate, and FileReplace gain additional parameters:

ParameterDescription
run_asOS user to execute as (e.g., root). Requires approval.
reasonRequired reason when using run_as. Displayed in the approval prompt.

Tool Execution Model

All tools run within the configured sandbox:

SandboxBehavior
none (default)Tools execute directly on the host — full access to filesystem.
dockerTools execute in an isolated Docker container.
remoteTools execute on a remote runner (sandbox server).

File tools respect workspace scope: by default, operations are limited to the project directory and its subdirectories. Read, FileCreate, FileReplace, Glob, and Grep enforce this boundary.

See also

  • Skills & Agents — extend the agent with custom roles
  • MCP — connect external tools via MCP
  • Plugins — hooks, widgets, custom tools