AS AgentScopeAPI 手册 / API Reference

HigressToolSearchResult

public class HigressToolSearchResult
源码Source io/agentscope/extensions/higress/HigressToolSearchResult.java:61–243

Higress 工具搜索结果,把智能体接入外部消息渠道与企业平台。位于 io.agentscope.extensions.higress 包。核心成员包括 parse、isSuccess、getErrorMessage、getTools、getToolNames、toString。

Represents the result of calling the x_higress_tool_search tool.

The x_higress_tool_search tool returns a list of recommended tools based on semantic similarity to the query. This class provides methods to parse and access the search results.

Example response structure from Higress:

`{
"content": [
{
"type": "text",
"text": "{\"tools\":[...]}"
}
],
"structuredContent": {
"tools": [
{
"name": "map___maps_weather",
"description": "根据城市名称或者标准adcode查询指定城市的天气",
"title": "maps_weather",
"inputSchema": {...},
"outputSchema": {}
}
]
}
}
`

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
ToolInfo记录record
承载工具信息数据的记录类型。
Represents a single tool returned from the search.

方法摘要Method Summary

方法Method说明Description
public static HigressToolSearchResult parse(McpSchema.CallToolResult callToolResult)
static
设置解析。
Parses the tool search result from MCP CallToolResult.
public boolean isSuccess()
判断是否成功。
Returns whether the search was successful.
public String getErrorMessage()
返回错误消息 if 搜索失败。
Returns the error message if the search failed.
public List<ToolInfo> getTools()
获取工具。
Returns the list of recommended tools.
public List<String> getToolNames()
获取 `getToolNames`。
Returns the names of all found tools.
public String toString()
返回 `toString` 结果。
Returns the to string.

方法详情Method Detail

parse

public static HigressToolSearchResult parse(McpSchema.CallToolResult callToolResult)
static

设置解析。

Parses the tool search result from MCP CallToolResult.

参数Parameters
名称Name类型Type说明Description
callToolResultMcpSchema.CallToolResult调用工具结果(类型 `McpSchema.CallToolResult`)。the result from calling x_higress_tool_search
返回Returns HigressToolSearchResult
返回HigressToolSearchResult。parsed HigressToolSearchResult
源码Source io/agentscope/extensions/higress/HigressToolSearchResult.java:81–114

isSuccess

public boolean isSuccess()

判断是否成功。

Returns whether the search was successful.

返回Returns boolean
返回布尔值,表示判断结果。true if successful
源码Source io/agentscope/extensions/higress/HigressToolSearchResult.java:180–182

getErrorMessage

public String getErrorMessage()

返回错误消息 if 搜索失败。

Returns the error message if the search failed.

返回Returns String
返回字符串结果。error message, or null if successful
源码Source io/agentscope/extensions/higress/HigressToolSearchResult.java:189–191

getTools

public List<ToolInfo> getTools()

获取工具。

Returns the list of recommended tools.

返回Returns List<ToolInfo>
返回列出。list of tools, never null but may be empty
源码Source io/agentscope/extensions/higress/HigressToolSearchResult.java:198–200

getToolNames

public List<String> getToolNames()

获取 getToolNames。

Returns the names of all found tools.

返回Returns List<String>
返回列出。list of tool names
源码Source io/agentscope/extensions/higress/HigressToolSearchResult.java:207–209

toString

public String toString()

返回 toString 结果。

Returns the to string.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/extensions/higress/HigressToolSearchResult.java:211–217

嵌套类详情Nested Class Detail

ToolInfo

public record ToolInfo( String name, String description, String title, Map<String, Object> inputSchema, Map<String, Object> outputSchema)

承载工具信息数据的记录类型。位于 io.agentscope.extensions.higress 包。核心成员包括 name、description、title、inputSchema、outputSchema。

Represents a single tool returned from the search.

基于官方固定版本源码静态生成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.