xbot 内置 50+ 工具,Agent 在对话中可以随时调用。所有工具默认可用,无需额外配置。
Note
AI 原生设计 :像 config 和 tui_control 这样的工具让 Agent 可以自行调整设置和 UI。你可以直接说「切换到暗色主题」或「调整侧边栏宽度」,Agent 会帮你完成。
Tool Description ReadRead file content with line numbers, optional offset/limit FileCreateCreate new files (errors if file already exists) FileReplaceSearch-and-replace in files (exact or RE2 regex, line range, replace_all) GlobFind files by glob pattern (** recursive matching) GrepSearch file contents with RE2 regex, include filter, ignore_case, context_lines CdChange working directory (persists across tool calls) DownloadFileDownload files from Feishu messages or web/OSS URLs
Tool Description Shell执行 Shell 命令。可配置 timeout(默认 120s,最大 600s),background 模式用于长时间任务。启用权限控制时支持 run_as。
Note
后台模式 :设置 background: true 用于开发服务器或构建进程。Agent 会收到任务 ID 并继续工作。使用 task_status 查看进度——但不要反复轮询。
Tool Description Fetch获取网页内容,通过 readability 转 Markdown + tiktoken 截断 WebSearch通过 Tavily API 搜索网页,可配置深度和最大结果数 search_tools通过嵌入向量相似度进行工具语义搜索
Tool Description 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 only offload_recall通过 offload ID 检索 offload 工具结果,支持 offset 和 limit 分页
Info
为什么需要 offload? 大型工具输出会自动存入磁盘,而不是塞满上下文窗口。Agent 看到的是摘要 + offload ID。需要完整内容时使用 offload_recall。
Tool Description CronManage scheduled tasks: add (interval/delay/cron_expr/at), list, remove EventTriggerManage webhook event triggers with Go template support and HMAC-SHA256 verification
Interactive Cards (Feishu) Tool Description card_create创建交互式卡片会话 card_add_content添加内容(markdown、div、image、table、chart) card_add_interactive添加交互元素(button、input、select、date_picker) card_add_container添加容器(column_set、form、collapsible_panel) card_preview预览卡片 JSON card_send发送卡片到聊天
Tool Description feishu_docx_create创建飞书文档 feishu_docx_get_content读取文档内容 feishu_docx_get_block按 ID 获取特定块 feishu_docx_list_blocks列出文档中的所有块 feishu_docx_find_block查找符合条件的块 feishu_docx_insert_block插入新块 feishu_docx_delete_blocks按 ID 删除块 feishu_bitable_fields列出/管理多维表格字段 feishu_bitable_record读/写多维表格记录 feishu_bitable_list列出多维表格数据表 feishu_bitable_batch_create批量创建记录 feishu_list_all_bitables列出机器人可访问的所有多维表格 feishu_wiki_list_spaces列出知识库空间 feishu_wiki_list_nodes列出空间中的知识库节点 feishu_wiki_get_node获取知识库节点内容 feishu_wiki_move_node移动知识库节点 feishu_wiki_create_node创建知识库节点 feishu_search_wiki跨知识库空间搜索 feishu_download_file从飞书下载文件 feishu_upload_file上传文件到飞书 feishu_list_files列出飞书云盘文件 feishu_add_permission为文件/文件夹添加权限 feishu_send_file发送文件到聊天
可用工具取决于 memory provider。详见 Memory System 。
Tool Description memory_write写入基于文件的内存存储 memory_list列出当前内存内容
Tool Description core_memory_append追加到核心内存块(persona/human/working_context) core_memory_replace替换核心内存块内容 rethink重新审视和演变核心内存(A-Mem 风格自反思) archival_memory_insert插入到档案(向量支持)长期内存 archival_memory_search通过嵌入向量进行档案内存语义搜索 recall_memory_search按日期范围搜索对话历史(FTS5 全文搜索)
Tool Description SubAgent委派任务给子 Agent:支持单次或交互式多轮会话,foreground/background 模式,model tier 选择,控制操作(send、unload、inspect、interrupt) CreateChat创建 Agent 私聊或主持群聊(Meeting Mode,通过 @提及控制发言) SendMessage向 Agent、群组、Peer Group、会话或 IM 渠道(飞书)发送消息 Skill发现并加载来自 ~/.xbot/skills/ 或项目 .xbot/skills/ 的技能
Tool Description configAI 读取/修改 xbot 配置(config.json 和运行时设置)。敏感键(API key、token)在读取时被遮盖 ——Agent 看到的是 sk-a*** 而非真实密钥。写入不被阻止。 tui_controlAI 操作 TUI:切换/关闭会话、调整侧边栏、更换主题、发送斜杠命令、管理布局
Multi-Agent Collaboration Tool Description WorktreeGit worktree 多 Agent 工作区隔离。支持 init、cleanup、status。 JoinGroup加入 Peer Group 进行异步广播通信 LeaveGroup离开 Peer Group ListGroupMembers列出 Peer Group 成员
Tool Description task_statusCheck background task status task_killTerminate a running background task task_readRead background task output
Tool Description ManageTools添加/移除/列出/重载 MCP 服务器
Tool Description AskUserAsk user a multiple-choice question TodoWrite / TodoListStructured TODO management with cross-session persistence LogsList/read xbot log files with filtering oauth_authorizeSend OAuth authorization card to user
启用权限控制时,Shell、FileCreate 和 FileReplace 获得以下额外参数:
参数 说明 run_as以指定 OS 用户身份执行(如 root),需要审批 reason使用 run_as 时必填的理由,显示在审批提示中
所有工具在配置的沙箱内运行:
沙箱 行为 none(默认)工具直接在本机执行——完全访问文件系统 docker工具在隔离的 Docker 容器中执行 remote工具在远程 Runner(沙箱服务器)上执行
文件工具遵循工作区范围:默认情况下,操作仅限于项目目录及其子目录。Read、FileCreate、FileReplace、Glob 和 Grep 都执行此边界约束。
xbot has a full lifecycle hooks system that fires on 17 events (PreToolUse, PostToolUse, UserPromptSubmit, etc.). Supports command/http/mcp_tool/callback handlers with JSON configuration. See Hooks System Design for details.