OpenClaw TOOLS.md 说明
在 OpenClaw 中,TOOLS.md 是 工作区(workspace)中的一个说明文件,用来记录 AI代理可以使用的工具以及你本地环境中这些工具的使用规则或备注。它本质上是给 AI 和开发者看的 工具说明/操作备忘录。 (OpenClaw Consult)
下面用比较清晰的结构解释。
一、TOOLS.md 是什么
一句话理解:
TOOLS.md= AI 代理的“工具说明书 / 工具使用笔记”。
它会被 OpenClaw 自动注入到模型上下文,让 AI 在思考时知道:
-
• 可以使用哪些工具 -
• 每个工具是干什么的 -
• 在什么情况下应该使用 -
• 有哪些注意事项或限制 (HowToUseOpenClaw)
二、TOOLS.md 里一般写什么
通常写 工具信息 + 本地环境规则,例如:
1 工具列表
例如:
## Tools### execute_shellRun shell commands in sandbox.Use for automation scripts only.Never run destructive commands like rm -rf.### search_webSearch the web using API.Use for external information lookup.
作用:
-
• 告诉 AI 有什么工具 -
• 告诉 AI 什么时候用
2 本地环境说明
例如:
## CalendarWe use Google Calendar.Timezone: Asia/Shanghai.## EmailSend via Resend API.Never send emails automatically without approval.
作用:
-
• 告诉 AI 你的系统是怎么配置的
3 设备 / 服务名称
例如:
## SSH Hostshome-server → 192.168.1.100gpu-server → 10.0.0.5## Camerasfront-door → entrance cameragarage → garage cam
三、TOOLS.md 的真正作用
它其实是 AI行为约束 + 工具菜单。
可以理解为:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AI 只能点菜单里的菜。如果不写进去,AI通常不会主动使用。 (OpenClaw Consult)
四、一个完整示例
典型 TOOLS.md 可能是这样:
# TOOLS.md## Shellexecute_shell- Run commands in sandbox- Use for automation scripts- Never run destructive commands## Websearch_web- Search information online- Prefer official sources## Emailsend_email- Use Resend API- Ask for approval before sending## Notes- Default timezone: Asia/Shanghai- Use markdown formatting
五、和其他文件的区别(非常重要)
在 OpenClaw workspace 里常见几个文件:
|
|
|
AGENTS.md |
|
SOUL.md |
|
IDENTITY.md |
|
USER.md |
|
TOOLS.md |
|
MEMORY.md |
|
其中:
TOOLS.md 只负责工具信息,不负责流程。 (OpenClaw Guide)
六、很多人误解的一点
TOOLS.md并不会真正启用工具。
工具是否能用,是由:
openclaw.json
里的 tools 配置决定的。 (开放爪学习)
TOOLS.md 只是:
告诉 AI “这些工具该怎么用”。
七、一个高级用法(很多高手会这么做)
你可以在 TOOLS.md 里写 操作策略:
例如:
When searching the web:1. search_web2. read_url3. summarizeNever summarize without reading the page.
这样 AI 的 工具调用成功率会大幅提升。
✅ 总结
TOOLS.md 本质是:
OpenClaw 代理的 工具知识库 + 使用说明书
作用:
-
1. 列出工具 -
2. 描述工具用途 -
3. 规定使用规则 -
4. 记录本地环境信息
如果你愿意,我可以再给你一份 真正实用的 OpenClaw TOOLS.md 模板(高手版),很多人用它可以让 agent 稳定度提升 10 倍。
夜雨聆风