Skip to content

AtomCode Daemon 工具定义完整 Schema

从 datalog 实际请求中提取的 12 个工具完整定义 2026-06-22


完整工具列表(12 个)

bash

json
{
  "description": "Execute a shell command. Use for: build, test, git, install deps.\nDo NOT use for: reading files (use read_file), searching (use grep), editing (use edit_file).\nFor a long-running process (dev server, watcher, tunnel), set run_in_background=true...\nDefault timeout: 60s. Destructive commands require user confirmation.",
  "name": "bash",
  "parameters": {
    "properties": {
      "command": {"description": "The shell command to execute", "type": "string"},
      "run_in_background": {"description": "Launch detached for long-running processes; returns immediately with log file path", "type": "boolean"},
      "timeout": {"description": "Max wait seconds (default 60, max 300)", "type": "integer"}
    },
    "required": ["command"],
    "type": "object"
  }
}

edit_file

json
{
  "description": "Replace text in a file. ALWAYS prefer this over write_file for existing files.\nTwo modes: 1. Line mode: use start_line + end_line + new_string.\n2. Text mode: use old_string + new_string (default, preferred for small changes).",
  "name": "edit_file",
  "parameters": {
    "properties": {
      "end_line": {"description": "Line mode: last line to replace (inclusive)", "type": "integer"},
      "file_path": {"description": "Path to the file to edit", "type": "string"},
      "new_string": {"description": "Replacement text. Use empty string to delete.", "type": "string"},
      "old_string": {"description": "Text mode: exact text to find and replace", "type": "string"},
      "replace_all": {"description": "Replace ALL occurrences (default: first only). Only for text mode.", "type": "boolean"},
      "start_line": {"description": "Line mode: first line to replace (1-indexed)", "type": "integer"}
    },
    "required": ["file_path"],
    "type": "object"
  }
}

glob

json
{
  "description": "Find files by name pattern. Returns matching file paths.\nPattern examples: **/*.rs, src/**/*.ts, *.json",
  "name": "glob",
  "parameters": {
    "properties": {
      "path": {"description": "Base directory (default: working directory)", "type": "string"},
      "pattern": {"description": "Glob pattern (e.g. **/*.rs, src/**/*.ts)", "type": "string"}
    },
    "required": ["pattern"],
    "type": "object"
  }
}

grep

json
{
  "description": "Search file contents for a pattern. Returns matching lines with surrounding context.\nUse this BEFORE editing to find exact locations.",
  "name": "grep",
  "parameters": {
    "properties": {
      "context": {"description": "Lines of context around each match (default 3)", "type": "integer"},
      "max_results": {"description": "Max results to return (default 50)", "type": "integer"},
      "path": {"description": "Directory or file to search (default: working directory)", "type": "string"},
      "pattern": {"description": "Search pattern (regex by default). Escape dots/parens.", "type": "string"}
    },
    "required": ["pattern"],
    "type": "object"
  }
}

list_directory

json
{
  "description": "List files and directories as a tree structure.\nSkips noise directories (node_modules, .git, target, __pycache__, etc.).",
  "name": "list_directory",
  "parameters": {
    "properties": {
      "depth": {"description": "Max depth to recurse (default 2)", "type": "integer"},
      "path": {"description": "Directory to list (default: working directory)", "type": "string"}
    },
    "required": [],
    "type": "object"
  }
}

read_file

json
{
  "description": "Read a file. Returns full content with line numbers.\nLarge files return a skeleton. Use offset/limit to read sections.\nNEVER use bash (cat/head/tail) to read files.",
  "name": "read_file",
  "parameters": {
    "properties": {
      "file_path": {"description": "Absolute path to the file to read", "type": "string"},
      "limit": {"description": "Max lines to read. Defaults to full file.", "type": "integer"},
      "offset": {"description": "Start line (1-based). Omit to read from beginning.", "type": "integer"}
    },
    "required": ["file_path"],
    "type": "object"
  }
}

search_replace

json
{
  "description": "Search and replace text across multiple files.\nReplaces ALL occurrences in ALL matching files.\nUse for: rename CSS class/variable/import, change colors/sizes across project.",
  "name": "search_replace",
  "parameters": {
    "properties": {
      "glob": {"description": "File pattern to limit scope (default: all files)", "type": "string"},
      "path": {"description": "Directory to search in (default: working directory)", "type": "string"},
      "regex": {"description": "Use regex matching (default: false = literal)", "type": "boolean"},
      "replace": {"description": "Replacement text (use $1, $2 for regex captures)", "type": "string"},
      "search": {"description": "Text or regex pattern to find", "type": "string"}
    },
    "required": ["search", "replace"],
    "type": "object"
  }
}

todo

json
{
  "description": "Manage a task list to track progress on multi-step work.",
  "name": "todo",
  "parameters": {
    "properties": {
      "action": {"description": "Action: 'add' a new task, 'update' a task's status, or 'list' all tasks", "type": "string"},
      "content": {"description": "Task description (required for 'add')", "type": "string"},
      "id": {"description": "Task ID (required for 'update')", "type": "integer"},
      "status": {"description": "New status (required for 'update')", "type": "string"}
    },
    "required": ["action"],
    "type": "object"
  }
}

use_skill

json
{
  "description": "Load a skill's instruction template into context.\nAvailable skills listed in system prompt (47 skills).",
  "name": "use_skill",
  "parameters": {
    "properties": {
      "arguments": {"description": "Arguments passed to the skill. Replaces $ARGUMENTS in template.", "type": "string"},
      "name": {"description": "Skill name (without leading slash)", "type": "string"}
    },
    "required": ["name"],
    "type": "object"
  }
}

web_fetch

json
{
  "description": "Fetch a web page and return its content as Markdown.\nHTML is converted to Markdown by default.",
  "name": "web_fetch",
  "parameters": {
    "properties": {
      "format": {"description": "Output format (default markdown). Use 'html' for raw source.", "type": "string"},
      "max_chars": {"description": "Truncate to N characters; omit to return full content.", "type": "integer"},
      "url": {"description": "Absolute http(s) URL to fetch", "type": "string"}
    },
    "required": ["url"],
    "type": "object"
  }
}
json
{
  "description": "Search the web for information. Returns titles, URLs, and snippets.\nUse for: find documentation, look up APIs, research libraries.",
  "name": "web_search",
  "parameters": {
    "properties": {
      "max_results": {"description": "Max results (default 8)", "type": "integer"},
      "query": {"description": "Search query", "type": "string"}
    },
    "required": ["query"],
    "type": "object"
  }
}

write_file

json
{
  "description": "Write content to a file. Creates new files or overwrites existing ones.\nFor small edits to existing files, prefer edit_file instead.",
  "name": "write_file",
  "parameters": {
    "properties": {
      "content": {"description": "The full content to write", "type": "string"},
      "file_path": {"description": "Absolute path to the file", "type": "string"}
    },
    "required": ["file_path", "content"],
    "type": "object"
  }
}

参数类型统计

类型出现次数工具
string15bash(command), edit_file(file_path,old_string,new_string), glob(pattern,path), grep(pattern,path), list_directory(path), read_file(file_path), search_replace(search,replace,glob,path), todo(action,content,status), use_skill(name,arguments), web_fetch(url,format), web_search(query), write_file(file_path,content)
integer9bash(timeout), edit_file(start_line,end_line), grep(context,max_results), list_directory(depth), read_file(limit,offset), todo(id), web_fetch(max_chars), web_search(max_results)
boolean3bash(run_in_background), edit_file(replace_all), search_replace(regex)

工具分组(按功能)

工具功能
文件读取read_file, glob, grep, list_directory读取文件、搜索文件
文件编辑edit_file, search_replace, write_file修改文件内容
命令执行bash执行 shell 命令
任务管理todo任务列表跟踪
网络web_search, web_fetch搜索和获取网页
技能use_skill加载内置技能模板
文件系统list_directory浏览目录结构

工具调用上限

限制
并发工具parallel_edit 上限 12 文件
bash 超时默认 60s,最大 300s
grep 结果默认 50 条
web_search 结果默认 8 条
list_directory 深度默认 2 层

逆向命令索引

bash
# 提取所有工具结构体
strings atomcode.bin.bak | grep -oP 'struct \w+Args with \d+ element' | sort -u

# 提取工具超时配置
strings atomcode.bin.bak | grep -iE "timeout|stream_timeout|first_token" | grep -v "https\?://" | sort -u | head -10

# 禁用工具 --disable-tools 机制
strings atomcode.bin.bak | grep -E "disable.*tools|DISABLE_TOOLS" | sort -u

基于 VitePress 构建 · AtomCode v4.25.3 逆向工程分析文档