AS AgentScopeAPI 手册 / API Reference

NacosMcpTool

public class NacosMcpTool implements AgentTool
源码Source io/agentscope/extensions/nacos/mcp/tool/NacosMcpTool.java:41–91

Nacos MCP 工具,封装可被智能体调用的能力。位于 io.agentscope.extensions.nacos.mcp.tool 包,实现 AgentTool。核心成员包括 getName、getDescription、getParameters、callAsync、NacosMcpTool。

Extension Implementation of io.agentscope.core.tool.mcp.McpTool for Nacos.

This Mcp Tool supported auto-updated from Nacos when MCP Server or Tools changed.

This Mcp Tool will get Tool spec from Nacos according to input tool name and Nacos MCP client.

构造器摘要Constructor Summary

构造器Constructor说明Description
public NacosMcpTool(String toolName, NacosMcpClientWrapper mcpClient)
初始化 `NacosMcpTool` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public String getName()
获取名称。
Returns the name.
public String getDescription()
获取 `getDescription`。
Returns the description.
public Map<String, Object> getParameters()
获取参数。
Returns the parameters.
public Mono<ToolResultBlock> callAsync(ToolCallParam param)
调用异步。
Calls the async.

构造器详情Constructor Detail

NacosMcpTool

public NacosMcpTool(String toolName, NacosMcpClientWrapper mcpClient)

初始化 NacosMcpTool 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
toolNameString工具名称(类型 `String`)。The tool name.
mcpClientNacosMcpClientWrapperMCP 客户端(类型 `NacosMcpClientWrapper`)。The mcp client.
源码Source io/agentscope/extensions/nacos/mcp/tool/NacosMcpTool.java:51–59

方法详情Method Detail

getName

public String getName()

获取名称。

Returns the name.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/nacos/mcp/tool/NacosMcpTool.java:61–64

getDescription

public String getDescription()

获取 getDescription。

Returns the description.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/nacos/mcp/tool/NacosMcpTool.java:66–69

getParameters

public Map<String, Object> getParameters()

获取参数。

Returns the parameters.

返回Returns Map<String, Object>
返回映射。Returns map.
源码Source io/agentscope/extensions/nacos/mcp/tool/NacosMcpTool.java:71–74

callAsync

public Mono<ToolResultBlock> callAsync(ToolCallParam param)

调用异步。

Calls the async.

参数Parameters
名称Name类型Type说明Description
paramToolCallParam参数(类型 `ToolCallParam`)。The param.
返回Returns Mono<ToolResultBlock>
返回Mono。Returns mono.
源码Source io/agentscope/extensions/nacos/mcp/tool/NacosMcpTool.java:76–79

继承成员Inherited Members

继承自Methods inherited from AgentTool
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.