Files
nexus/wiki/concepts/TOOLS.md
2026-04-17 09:34:39 +08:00

41 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "TOOLS.md"
type: concept
tags: [OpenClaw, Agent]
---
## 定义
TOOLS.md 是 OpenClaw workspace 中的工具权限声明与使用规范文件,定义 Agent 可用工具及其使用原则。
## 职责
- 列出可用工具Read/Write/Edit、Bash、Glob/Grep、sessions_spawn、memory_get/memory_search 等)
- 规定工具使用原则(优先使用文件操作工具、避免硬编码路径、批量修改前先确认内容)
- 明确受限工具browser、文件删除操作需要用户授权
## 核心价值
- **减少工具误用**:明确说明什么情况下不用某个工具
- **降低权限越界风险**:把限制规则固化在 workspace 里
- **与 openclaw.json 形成互补**:系统层决定"能不能用"TOOLS.md 帮助理解"该不该用"
## 典型结构
```markdown
# TOOLS
## 可用工具
- **Read / Write / Edit**:文件读写
- **Bash**:执行 shell 命令
- **Glob / Grep**:文件搜索
## 使用原则
- 文件操作优先用 Read/Write/Edit避免直接用 Bash 的 cat/echo
- 路径操作使用相对路径,不要硬编码绝对路径
## 受限工具
- **browser**:网页浏览,只在用户明确要求时调用
```
## 来源
- [[万字讲透OpenClaw🦞从"能用"到"真好用"的分水岭Workspace 深度解析]]
## 相关
- [[Workspace]]:包含 TOOLS.md 的工作台目录
- [[AGENTS.md]]:与 TOOLS.md 配合定义 Agent 行为