MCPToolExecutor
public class MCPToolExecutor extends BaseSandboxAwareTool<MCPTool, Map<String, Object>, MCPToolExecutor.MCPToolResponse>
io/agentscope/runtime/engine/agents/saa/tools/mcp/MCPToolExecutor.java:48–113MCP 工具执行器,让智能体以受控方式调用外部能力。位于 io.agentscope.runtime.engine.agents.saa.tools.mcp 包,继承自 BaseSandboxAwareTool<MCPTool, Map<String, Object>, MCPToolExecutor.MCPToolResponse>。核心成员包括 apply、buildTool、MCPToolExecutor。
A class in io.agentscope.runtime.engine.agents.saa.tools.mcp that lets agents invoke external capabilities under control. Declared in io.agentscope.runtime.engine.agents.saa.tools.mcp. Extends BaseSandboxAwareTool<MCPTool, Map
嵌套类摘要Nested Class Summary
| 类Class | 类型Kind | 说明Description |
|---|---|---|
MCPToolResponse | 记录record | 承载 MCP 工具响应数据的记录类型。 A record in io.agentscope.runtime.engine.agents.saa.tools.mcp that carries data used when components lets agents invoke external capabilities under control. |
构造器摘要Constructor Summary
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public MCPToolResponse apply(Map<String, Object> arguments, ToolContext toolContext) | 执行 `apply` 方法。 Performs the apply operation. |
public RuntimeFunctionToolCallback buildTool() | 构建工具。 Builds the tool. |
构造器详情Constructor Detail
MCPToolExecutor
public MCPToolExecutor(String name, String toolType, String description, Map<String, Object> schema, Map<String, Object> serverConfigs, SandboxType sandboxType, SandboxManager sandboxManager)
初始化 MCPToolExecutor 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
name | String | 名称(类型 `String`)。The name. |
toolType | String | 工具类型(类型 `String`)。The tool type. |
description | String | 描述(类型 `String`)。The description. |
schema | Map<String, Object> | 模式定义(类型 `Map`)。The schema. |
serverConfigs | Map<String, Object> | 服务端 Configs(类型 `Map`)。The server configs. |
sandboxType | SandboxType | 沙箱类型(类型 `SandboxType`)。The sandbox type. |
sandboxManager | SandboxManager | 沙箱管理器(类型 `SandboxManager`)。The sandbox manager. |
io/agentscope/runtime/engine/agents/saa/tools/mcp/MCPToolExecutor.java:51–63MCPToolExecutor
public MCPToolExecutor(MCPTool mcpTool)
初始化 MCPToolExecutor 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
mcpTool | MCPTool | MCP 工具(类型 `MCPTool`)。The mcp tool. |
io/agentscope/runtime/engine/agents/saa/tools/mcp/MCPToolExecutor.java:65–67方法详情Method Detail
apply
public MCPToolResponse apply(Map<String, Object> arguments, ToolContext toolContext)
执行 apply 方法。
Performs the apply operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
arguments | Map<String, Object> | 参数(类型 `Map`)。The arguments. |
toolContext | ToolContext | 工具上下文(类型 `ToolContext`)。The tool context. |
MCPToolResponseio/agentscope/runtime/engine/agents/saa/tools/mcp/MCPToolExecutor.java:69–82buildTool
public RuntimeFunctionToolCallback buildTool()
构建工具。
Builds the tool.
RuntimeFunctionToolCallbackio/agentscope/runtime/engine/agents/saa/tools/mcp/MCPToolExecutor.java:91–111嵌套类详情Nested Class Detail
MCPToolResponse
public record MCPToolResponse(String result, String message)承载 MCP 工具响应数据的记录类型。位于 io.agentscope.runtime.engine.agents.saa.tools.mcp 包。核心成员包括 result、message、MCPToolResponse。
A record in io.agentscope.runtime.engine.agents.saa.tools.mcp that carries data used when components lets agents invoke external capabilities under control. Declared in io.agentscope.runtime.engine.agents.saa.tools.mcp.