跳转至

Reference: Tool Presets

目的:速查 所有内置工具及其 preset 配置


1. 工具分类

类别 工具数(推测) 例子
文件 ~5 Read, Edit, Write, NotebookEdit
Bash ~3 Bash, KillBash, BashOutput
Agent ~3 Agent, SendUserMessage, BriefTool
Web ~3 WebFetch, WebSearch, WebBrowserTool
Todo ~2 TodoWrite, TaskCreate / Update
Skill ~1 Skill
特殊 ~5+ AskUserQuestion, ListMcpResources, SyntheticOutput

~22 类别


2. 5 大文件工具

2.1 Read

// tools/FileReadTool/FileReadTool.ts
{
  name: 'Read',
  description: 'Read a file',
  inputSchema: { file_path: string, offset?: number, limit?: number }
}

读文件

2.2 Edit

// tools/EditTool
{
  name: 'Edit',
  description: 'Edit a file',
  inputSchema: { file_path: string, old_string: string, new_string: string }
}

精确编辑

2.3 Write

{
  name: 'Write',
  description: 'Write a file',
  inputSchema: { file_path: string, content: string }
}

写文件

2.4 NotebookEdit

{
  name: 'NotebookEdit',
  description: 'Edit Jupyter notebook',
  inputSchema: { ... }
}

notebook 编辑

2.5 MultiEdit (推测)

{
  name: 'MultiEdit',
  description: 'Edit multiple files',
  inputSchema: { edits: [...] }
}

多文件编辑


3. 3 大 Bash 工具

3.1 Bash

{
  name: 'Bash',
  description: 'Run a bash command',
  inputSchema: { command: string, timeout?: number, run_in_background?: boolean }
}

Bash

3.2 KillBash (推测)

{
  name: 'KillBash',
  description: 'Kill a background bash',
  inputSchema: { shell_id: string }
}

Kill

3.3 BashOutput (推测)

{
  name: 'BashOutput',
  description: 'Get output of background bash',
  inputSchema: { shell_id: string, blocking?: boolean }
}

Output


4. 3 大 Agent 工具

4.1 Agent

{
  name: 'Agent',
  description: 'Start a sub-agent',
  inputSchema: { name: string, prompt: string }
}

Sub-agent

4.2 SendUserMessage (KAIROS)

{
  name: 'SendUserMessage',
  description: 'Send a message to the user (assistant mode)',
  inputSchema: { message: string }
}

Send to user

4.3 BriefTool (ANT-ONLY)

{
  name: 'BriefTool',
  description: 'Brief assistant tool',
  inputSchema: { ... }
}

Brief


5. 3 大 Web 工具

5.1 WebFetch

{
  name: 'WebFetch',
  description: 'Fetch a URL',
  inputSchema: { url: string, prompt?: string }
}

Fetch URL

5.2 WebSearch (推测)

{
  name: 'WebSearch',
  description: 'Search the web',
  inputSchema: { query: string }
}

Search

5.3 WebBrowserTool (FEATURE_GATED)

{
  name: 'WebBrowser',
  description: 'Browse the web interactively',
  inputSchema: { action: string, ... }
}

Browse


6. 2 大 Todo 工具

6.1 TodoWrite

{
  name: 'TodoWrite',
  description: 'Write todo list',
  inputSchema: { todos: TodoItem[] }
}

写 todo

6.2 TaskCreate / TaskUpdate

{
  name: 'TaskCreate',
  description: 'Create a task',
  inputSchema: { description: string }
}

{
  name: 'TaskUpdate',
  description: 'Update a task',
  inputSchema: { task_id: string, status: string }
}

Task 系统


7. 1 大 Skill 工具

{
  name: 'Skill',
  description: 'Trigger a skill',
  inputSchema: { skill: string }
}

Skill


8. 5 个特殊工具

8.1 AskUserQuestion

{
  name: 'AskUserQuestion',
  description: 'Ask the user a question',
  inputSchema: { question: string, options: string[] }
}

Ask user

8.2 ListMcpResources (MCP)

{
  name: 'ListMcpResources',
  description: 'List MCP resources',
  inputSchema: { server: string }
}

List MCP

8.3 SyntheticOutputTool

{
  name: 'SyntheticOutput',
  description: 'Output synthetic data',
  inputSchema: { ... }
}

Synthetic output

8.4 ListAgents (推测)

{
  name: 'ListAgents',
  description: 'List available agents',
  inputSchema: {}
}

List agents

8.5 Quit / Exit (推测)

{
  name: 'Quit',
  description: 'Exit Claude Code',
  inputSchema: {}
}

Exit


9. 工具 preset 模式

9.1 隐式 enabled

# 默认
Read, Edit, Write, Bash, Glob, Grep, Agent

默认

9.2 显式 enabled

# --tools
claude --tools "Read,Bash"

显式

9.3 disable

# --tools ""
claude --tools ""

禁用

9.4 default

claude --tools default
# = "Read,Edit,Write,Bash,Glob,Grep,Agent,..."

default


10. 5 个工具 preset 模板

10.1 Read-only

claude --tools "Read,Glob,Grep"

只读

10.2 Code editor

claude --tools "Read,Edit,Write,Glob,Grep"

编辑器

10.3 Bash expert

claude --tools "Read,Bash,Glob,Grep"

Bash 专家

10.4 Full power

claude --tools "default"

全功能

10.5 Zero tools

claude --tools ""

无工具


11. 工具 tool_use_id 关联

// Claude API 返回
{
  type: 'tool_use',
  id: 'toolu_xxx',  // ← 唯一
  name: 'Bash',
  input: { command: 'ls' }
}

关联

11.1 tool_result 关联

{
  type: 'tool_result',
  tool_use_id: 'toolu_xxx',  // ← 关联
  content: '...',
  is_error: false
}

关联


12. 工具权限 preset

{
  "allow": [
    "Read", "Edit", "Write", "Bash", "Glob", "Grep"
  ],
  "deny": [
    "Bash(rm -rf:*)", "WebFetch"
  ]
}

preset


13. 速查

工具               类别    风险
──────────────────────────────
Read              文件    低
Edit              文件    中
Write             文件    中
Bash              shell   高
Glob              文件    低
Grep              文件    低
Agent             meta    中
WebFetch          网络    中
WebSearch         网络    低
WebBrowser        网络    中
TodoWrite         meta    低
TaskCreate/Update meta    低
Skill             meta    低
AskUserQuestion   meta    低
ListMcpResources  MCP     中
SyntheticOutput   meta    低

16 工具


14. 总结

工具 preset = 预定义工具集合

核心: - ~22 工具分类 - 8 类别 - 5 preset 模板 - 工具 tool_use_id 关联

下一步: - 选 preset - 测试 - 写自定义工具