Catalog ครบถ้วนของ agent tools ทั้ง ~40 รายการใน Claude Code
ภาพรวม
ทุก tool อยู่ใน src/tools/<ToolName>/ เป็น module ที่มีความสมบูรณ์ในตัวเอง แต่ละ tool นิยาม:
- Input schema — พารามิเตอร์ที่ validate ด้วย Zod
- Permission model — สิ่งที่ต้องการการอนุมัติจาก user
- Execution logic — การ implement ของ tool
- UI components — การ render ใน terminal สำหรับการเรียกใช้และผลลัพธ์
- Concurrency safety — สามารถทำงานพร้อมกันได้หรือไม่
Tools ลงทะเบียนใน src/tools.ts และถูกเรียกใช้โดย Query Engine ระหว่าง LLM tool-call loops
export const MyTool = buildTool({
name: 'MyTool',
aliases: ['my_tool'],
description: 'สิ่งที่ tool นี้ทำ',
inputSchema: z.object({
param: z.string(),
}),
async call(args, context, canUseTool, parentMessage, onProgress) {
// Execute และคืนค่า { data: result, newMessages?: [...] }
},
async checkPermissions(input, context) { /* Permission checks */ },
isConcurrencySafe(input) { /* ทำงานพร้อมกันได้? */ },
isReadOnly(input) { /* ไม่ทำลายข้อมูล? */ },
prompt(options) { /* System prompt injection */ },
renderToolUseMessage(input, options) { /* UI สำหรับการเรียกใช้ */ },
renderToolResultMessage(content, progressMessages, options) { /* UI สำหรับผลลัพธ์ */ },
})
โครงสร้างไดเรกทอรีต่อ tool:
src/tools/MyTool/
├── MyTool.ts # การ implement หลัก
├── UI.tsx # Terminal rendering
├── prompt.ts # System prompt contribution
└── utils.ts # Helper เฉพาะ tool
| Tool | คำอธิบาย | Read-Only |
|---|
| FileReadTool | อ่านเนื้อหาไฟล์ (text, images, PDFs, notebooks) รองรับ line ranges | ใช่ |
| FileWriteTool | สร้างหรือเขียนทับไฟล์ | ไม่ |
| FileEditTool | แก้ไขไฟล์บางส่วนผ่าน string replacement | ไม่ |
| GlobTool | ค้นหาไฟล์ที่ตรงกับ glob patterns (เช่น **/*.ts) | ใช่ |
| GrepTool | ค้นหาเนื้อหาด้วย ripgrep (รองรับ regex) | ใช่ |
| NotebookEditTool | แก้ไข Jupyter notebook cells | ไม่ |
| TodoWriteTool | เขียนไปยัง structured todo/task file | ไม่ |
| Tool | คำอธิบาย | Read-Only |
|---|
| BashTool | Execute shell commands ใน bash | ไม่ |
| PowerShellTool | Execute PowerShell commands (Windows) | ไม่ |
| REPLTool | รัน code ใน REPL session (Python, Node ฯลฯ) | ไม่ |
| Tool | คำอธิบาย | Read-Only |
|---|
| AgentTool | Spawn sub-agent สำหรับงานที่ซับซ้อน | ไม่ |
| SendMessageTool | ส่ง messages ระหว่าง agents | ไม่ |
| TeamCreateTool | สร้างทีม parallel agents | ไม่ |
| TeamDeleteTool | ลบ team agent | ไม่ |
| EnterPlanModeTool | สลับเป็น planning mode (ไม่ execute) | ไม่ |
| ExitPlanModeTool | ออกจาก planning mode กลับสู่ execution | ไม่ |
| EnterWorktreeTool | แยกงานใน git worktree | ไม่ |
| ExitWorktreeTool | ออกจาก worktree isolation | ไม่ |
| SleepTool | หยุดชั่วคราว (proactive mode) | ใช่ |
| SyntheticOutputTool | สร้าง structured output | ใช่ |
| Tool | คำอธิบาย | Read-Only |
|---|
| TaskCreateTool | สร้าง background task ใหม่ | ไม่ |
| TaskUpdateTool | อัปเดตสถานะหรือรายละเอียดของ task | ไม่ |
| TaskGetTool | ดูรายละเอียดของ task เฉพาะ | ใช่ |
| TaskListTool | แสดงรายการ tasks ทั้งหมด | ใช่ |
| TaskOutputTool | ดู output จาก task ที่เสร็จสิ้น | ใช่ |
| TaskStopTool | หยุด task ที่กำลังทำงาน | ไม่ |
| Tool | คำอธิบาย | Read-Only |
|---|
| WebFetchTool | ดึงเนื้อหาจาก URL | ใช่ |
| WebSearchTool | ค้นหาในเว็บ | ใช่ |
MCP (Model Context Protocol) Tools
| Tool | คำอธิบาย | Read-Only |
|---|
| MCPTool | เรียกใช้ tools บน MCP servers ที่เชื่อมต่อ | ขึ้นอยู่กับ |
| ListMcpResourcesTool | แสดง resources ที่ MCP servers เปิดเผย | ใช่ |
| ReadMcpResourceTool | อ่าน MCP resource เฉพาะ | ใช่ |
| McpAuthTool | จัดการ MCP server authentication | ไม่ |
| ToolSearchTool | ค้นพบ deferred/dynamic tools จาก MCP servers | ใช่ |
| Tool | คำอธิบาย | Read-Only |
|---|
| LSPTool | Language Server Protocol operations (go-to-definition, find references ฯลฯ) | ใช่ |
| SkillTool | Execute skill ที่ลงทะเบียนไว้ | ขึ้นอยู่กับ |
Scheduling & Triggers
| Tool | คำอธิบาย | Read-Only |
|---|
| ScheduleCronTool | สร้าง scheduled cron trigger | ไม่ |
| RemoteTriggerTool | เรียก remote trigger | ไม่ |
| Tool | คำอธิบาย | Read-Only |
|---|
| AskUserQuestionTool | ขอข้อมูลจาก user ระหว่างการ execute | ใช่ |
| BriefTool | สร้าง brief/summary | ใช่ |
| ConfigTool | อ่านหรือแก้ไข Claude Code configuration | ไม่ |
Permission Model
ทุก tool invocation ผ่านระบบ permission (src/hooks/toolPermission/) โหมด permission:
| โหมด | พฤติกรรม |
|---|
default | แจ้งให้ user อนุมัติสำหรับแต่ละ operation ที่อาจทำลายข้อมูล |
plan | แสดง plan ทั้งหมด ขออนุมัติครั้งเดียว |
bypassPermissions | อนุมัติทุกอย่างอัตโนมัติ (อันตราย) |
auto | ML-based classifier ตัดสินใจ |
Permission rules ใช้ wildcard patterns:
Bash(git *) # อนุญาต git commands ทั้งหมด
FileEdit(/src/*) # อนุญาตแก้ไขทุกอย่างใน src/
FileRead(*) # อนุญาตอ่านทุกไฟล์
แต่ละ tool implement checkPermissions() คืนค่า { granted: boolean, reason?, prompt? }
Tools ถูกจัดกลุ่มเป็น presets ใน src/tools.ts สำหรับ context ต่างๆ (เช่น read-only tools สำหรับ code review, full toolset สำหรับการพัฒนา)
ดูเพิ่มเติม