适用版本:ChengOS v0.1.0+ | 最后核对:2026-08-13 | 来源:crates/cheng-nodes/src/nodes/builtin/tools
Hub 是用一个节点代表许多可调用操作,这样智能体能拿到一整箱工具,而画布不必为每个工具长出一个节点。 tools/tool_hub 暴露的工具,要么来自当前生效的 Skill 声明,要么来自工作流作者的配置。 tools/mcp_hub 对 MCP Server 提供的工具做同样的事,tools/skills_hub 则负责发现和管理 Skill 本身。 预设相关的两个节点更小:列出可用预设,以及请求切换。
工具中心 — tools/tool_hub
策略受控的统一工具执行网关。在 skill 模式下,可用工具由所选 Skill 的规范 Tool Hub 声明确定(请使用 Skills Hub 的 list/search/describe 来发现并描述工具);在 user 模式下,可用工具由工作流作者在 enabled_tools 中显式启用。execute 操作需要 action=”execute”、tool、必要的 operation 以及与该工具 schema 匹配的 arguments;skill 模式下还需指定 skill_name。禁止猜测工具标识、操作或参数 schema——所有调用在执行前都会重新校验当前受信作用域与运行时策略。
输入
| 字段 |
类型 |
必填 |
默认值 |
说明 |
action |
enum |
✅ |
— |
Tool Hub 的动作:list_tools(列出可执行工具,仅 user 模式)或 execute(在受信作用域内执行一条具体命令)。 取值:list_tools (List the executable tools of this node instance (user mode only).), execute (Execute one concrete tool command inside the trusted scope.) |
skill_name |
string |
— |
null |
用于授权本次 execute 的 Skill slug(skill 模式必填;user 模式会被忽略并产生警告)。 |
tool |
string |
— |
null |
要执行的工具节点类型 id,必须与 Skills Hub describe 或 Tool Hub list_tools 返回的一致(例如 tools/http)。 |
operation |
string |
— |
null |
Hub 风格工具的操作/动作(例如 request、view_file);当工具 schema 需要时必填。 |
arguments |
any |
— |
null |
execute 的工具参数对象。直接传 JSON 对象,不要传 JSON 编码字符串。使用所选工具的输入 schema 填充 arguments 中的字段。 |
mode |
enum |
— |
user |
工具来源模式:skill(由所选 Skill 的 tool_hub.tools 声明确定作用域)或 user(由工作流作者在 enabled_tools 中配置)。 取值:skill (The selected Skill’s canonical tool_hub.tools declaration defines the executable scope; list_tools is unavailable (use Skills Hub describe).), user (The workflow author’s enabled_tools rows define the scope. The default: with no rows enabled the scope is empty (deny-all).) |
enabled_tools |
array<object> |
— |
[] |
工作流作者启用的工具行(仅 user 模式生效;skill 模式下被忽略)。 |
输出
| 字段 |
类型 |
说明 |
status |
string |
Tool Hub 状态码(闭合枚举,详见节点文档)。 |
mode |
string |
本节点的静态工具来源模式(skill 或 user)。 |
tools |
array<object> |
当前可执行的工具描述符(user 模式 list_tools 的输出)。 |
unavailable_tools |
array<object> |
已配置但当前不可用的工具(诊断信息,不会作为可执行项返回)。 |
result |
object |
execute 命令的运行时工具结果。 |
approval |
object |
稳定的审批续传令牌与不含敏感信息的动作摘要(仅在 approval_required 时出现)。 |
errors |
array<string> |
阻断性错误信息列表。 |
warnings |
array<string> |
非阻断性警告信息列表。 |
error_details |
any |
结构化失败详情,例如接收到的参数与期望 schema(用于 schema 不匹配等场景)。 |
MCP中心 — tools/mcp_hub
MCP Hub: 以服务器列表方式统一管理多个 MCP 服务器,每个服务器支持独立开关,独立表单编辑或 JSON 编辑,并将连接状态,发现结果和调用结果统一输出到单个结果端口.
输入
| 字段 |
类型 |
必填 |
默认值 |
说明 |
server_registry |
array<object> |
— |
[] |
MCP 服务器列表.每个服务器支持名称,描述,类型,命令,参数,环境变量,长时间运行模式,超时以及 JSON 配置等独立编辑. 控件:mcp-server-manager |
tool_name |
string |
— |
"" |
工具调用.对于多服务器配置,使用”server:tool”格式,对于单服务器配置,仅使用”tool_name”格式.启用”仅发现”时忽略. |
arguments |
object \ |
array \ |
string \ |
number \ |
tool_visibility |
string |
— |
null |
工具可见性配置(JSON字符串,可选,旧版兼容字段,建议使用可见性配置). 控件:textarea |
visibility_config |
object |
— |
null |
结构化工具可见性配置(推荐). 控件:mcp-visibility-editor |
discover_only |
boolean |
— |
false |
启用后,列出已配置服务器中的所有可用工具,而不是调用一个. 控件:switch |
timeout_ms |
integer |
— |
null |
请求超时(毫秒,0 或留空表示不限时). 控件:number |
env_vars |
object |
— |
null |
来自 utils/credential 节点输出的环境变量映射(可选).会优先覆盖 ${env:KEY} 占位符,适用于 URL,Authorization,Headers,Args,Env 等所有字符串字段. |
输出
| 字段 |
类型 |
说明 |
result |
any |
统一结果对象,包含配置摘要,服务器连接状态,发现到的工具以及可选的工具调用输出 |
技能中心 — tools/skills_hub
工作区 Skill 集成的统一网关。 操作: – list:列出当前工作区可发现的 Skill。 – search:按能力、名称、描述或标签查找 Skill。 – describe:返回 Skill 的完整描述符、所需输入、执行要求和声明的 Tool Hub 工具。 – credential_status:检查所需凭证是否可用。 – approval_status:检查执行是否需要人工审批。 – execute:使用 input_data 执行 Skill。 Skill 目录是动态的。使用 list 或 search 发现 Skill,不要假设哪些 Skill 存在。在调用 Skill 声明的工具前,先调用 describe 并使用返回的工具标识符、允许的操作和参数 schema 与 Tool Hub 配合。不要猜测 Skill 或工具契约。
输入
| 字段 |
类型 |
必填 |
默认值 |
说明 |
operation |
enum |
✅ |
— |
Hub 要执行的操作(必填). 取值:list (List discoverable skills in the workspace (paginated, with optional filters).), search (Free-text search across discoverable skills.), describe (Full secret-free descriptor for one skill, including its Tool Hub tool declarations with filtered input schemas.), credential_status (Check whether the required credentials for a skill are bound and resolvable.), approval_status (Check whether a high-risk skill still needs human approval before execute.), execute (Execute a skill by slug (forwards to the shared execute pipeline).) |
skill_name |
string |
— |
null |
目标技能的 slug 标识 |
query |
string |
— |
null |
搜索关键字(匹配名称/描述) |
category |
string |
— |
null |
按目录过滤 |
tags |
array<string> |
— |
[] |
标签过滤(多个为 AND 关系) |
backend_type |
string |
— |
null |
按后端类型过滤 |
input_data |
any |
— |
null |
传递给技能工作流的输入数据 |
timeout_seconds |
integer |
— |
3600 |
执行超时时间(秒),默认 3600 |
async_execution |
boolean |
— |
false |
为 true 时启动工作流后立即返回,不等待完成 |
env_vars |
object |
— |
null |
由凭据注入节点传入的临时凭据环境变量 |
limit |
integer |
— |
50 |
发现结果分页大小,默认 50 |
cursor |
string |
— |
null |
发现结果的分页游标 |
audience |
enum |
— |
llm |
发现可见性受众:llm(默认,面向模型)或 human. 取值:llm (Model-facing: excludes both hidden and llm_hidden. The default.), human (Human-facing: shows llm_hidden (still hides hidden).) |
输出
| 字段 |
类型 |
说明 |
status |
string |
技能执行状态码(详见 SkillOutput::status 文档的闭合枚举与前端映射) |
skill_id |
string |
匹配到的技能 UUID |
skill_name |
string |
匹配到的技能名称 |
execution_id |
string |
工作流执行 ID(如已启动) |
outputs |
any |
工作流输出数据 |
instructions |
string |
技能使用说明(无关联工作流时返回) |
next_action |
string |
建议的下一步操作(供 LLM 参考) |
error |
string |
错误信息 |
missing_binaries |
array |
PATH 上未找到的必要二进制文件;安装它们或在使用它们的宿主机上运行技能 |
missing_credentials |
array |
无法解析的凭据绑定列表;渲染到凭据设置界面 |
approval_outcome |
string |
高风险技能的审批门结果 |
normalization_status |
string |
执行时规范规范的规范化状态 |
policy_warnings |
array<string> |
运行时策略警告 |
operation |
string |
产生本输出的 Hub 操作(list / search / credential_status / approval_status / execute) |
data |
any |
操作特定的载荷(发现结果页或状态报告) |
列出可用预设 — tools/list_available_presets
作用域内省:列出 LLM 可请求切换的节点预设,限于当前工作流、与调用代理并排连接的工具、以及标记为对 LLM 可见的预设。
输入
| 字段 |
类型 |
必填 |
默认值 |
说明 |
target_node_id |
string |
— |
null |
可选目标工具节点 ID,用于限定预设列表范围。 |
输出
| 字段 |
类型 |
说明 |
presets |
array<object> |
请求代理可见的可用预设列表 |
count |
integer |
返回的预设数量 |
error |
string |
操作失败时的错误信息 |
请求预设切换 — tools/request_preset_switch
为与调用代理并排连接的工具节点请求审批控制的预设切换。预设仅在用户批准后应用;LLM 永远不能直接应用。
输入
| 字段 |
类型 |
必填 |
默认值 |
说明 |
target_node_id |
string |
— |
null |
目标工具节点 ID。如果只有一个该预设类型的节点则可省略。 |
preset_id |
string |
— |
"" |
要切换到的预设 ID。通过 list_available_presets 发现可用 ID。 |
reason |
string |
— |
null |
切换的可选原因,显示给审批者。 |
输出
| 字段 |
类型 |
说明 |
status |
string |
结果状态:applied、rejected、out_of_scope 或 error |
applied |
boolean |
预设是否已应用 |
request_id |
string |
审批请求标识 |
message |
string |
人类可读的结果消息 |
change_summary |
any |
逐键差异({key: {from, to}}),已提交审批 |
下一步
暂无评论内容