前言
在前两篇文章里面,介绍了Manus的Prompt Manus AI 原理深度解析第一篇:Prompt以及 Modules & Agent Loop Manus AI 原理深度解析第二篇:Modules & Agent Loop,那么这一篇就介绍剩下的Tools了。
Tools 是 Manus 与外部环境交互的具体执行单元,覆盖文件、终端、浏览器、网络等操作,支持多语言和多场景需求。接下来不多废话,直入主题分析。
Message Tools
用于处理用户消息的工具类。
message_notify_user
向用户发送一条无需回复的消息的工作。
用于确认收到消息、提供进度更新、报告任务完成情况或解释方法变更。
{
"type": "function",
"function": {
"name": "message_notify_user",
"description": "Send a message to user without requiring a response. Use for acknowledging receipt of messages, providing progress updates, reporting task completion, or explaining changes in approach.",
"parameters": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Message text to display to user"
},
"attachments": {
"anyOf": [
{
"type": "string"},
{
"items": {
"type": "string"}, "type": "array"}
],
"description": "(Optional) List of attachments to show to user, can be file paths or URLs"
}
},
"required": ["text"]
}
}
}
message_ask_user
向用户提问并等待回复的工具。
用于请求澄清、确认或收集更多信息。
{
"type": "function",
"function": {
"name": "message_ask_user",
"description": "Ask user a question and wait for response. Use for requesting clarification, asking for confirmation, or gathering additional information.",
"parameters": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Question text to present to user"
},
"attachments": {
"anyOf": [
{
"type": "string"},
{
"items": {
"type": "string"}, "type": "array"}
],
"description": "(Optional) List of question-related files or reference materials"
},
"suggest_user_takeover": {
"type": "string",
"enum": ["none", "browser"],
"description": "(Optional) Suggested operation for user takeover"
}
},
"required": ["text"]
}
}
}
File Processing Tools
用于处理文件的工具类。
file_read
读取文件内容的工具。
用于检查文件内容、分析日志或读取配置文件。
{
"type": "function",
"function": {
"name": "file_read",
"description": "Read file content. Use for checking file contents, analyzing logs, or reading configuration files.",
"parameters": {
"type": "object",
"properties": {
"file": {
"type": "string",
"description": "Absolute path of the file to read"
},
"start_line": {
"type": "integer",
"description": "(Optional) Starting line to read from, 0-based"
},
"end_line": {
"type": "integer",
"description": "(Optional) Ending line number (exclusive)"
},
"sudo": {
"type": "boolean",
"description": "(Optional) Whether to use sudo privileges"
}
},
"required": ["file"]
}
}
}
file_write
覆盖或附加内容到文件的工具。
用于创建新文件、附加内容或修改现有文件。
{
"type": "function",
"function": {
"name": "file_write",
"description": "Overwrite or append content to a file. Use for creating new files, appending content, or modifying existing files.",
"parameters": {
"type": "object",
"properties": {
"file": {
"type": "string",
"description": "Absolute path of the file to write to"
},
"content": {
"type": "string",
"description": "Text content to write"
},
"append": {
"type": "boolean",
"description": "(Optional) Whether to use append mode"
},
"leading_newline": {
"type": "boolean",
"description": "(Optional) Whether to add a leading newline"
},
"trailing_newline": {
"type": "boolean",
"description": "(Optional) Whether to add a trailing newline"
},
"sudo": {
"type": "boolean",
"description": "(Opt

最低0.47元/天 解锁文章
1794

被折叠的 条评论
为什么被折叠?



