HigressToolSearchResult
public class HigressToolSearchResult
io/agentscope/extensions/higress/HigressToolSearchResult.java:61–243Higress 工具搜索结果,把智能体接入外部消息渠道与企业平台。位于 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)
设置解析。
Parses the tool search result from MCP CallToolResult.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
callToolResult | McpSchema.CallToolResult | 调用工具结果(类型 `McpSchema.CallToolResult`)。the result from calling x_higress_tool_search |
HigressToolSearchResultio/agentscope/extensions/higress/HigressToolSearchResult.java:81–114isSuccess
public boolean isSuccess()
判断是否成功。
Returns whether the search was successful.
booleanio/agentscope/extensions/higress/HigressToolSearchResult.java:180–182getErrorMessage
public String getErrorMessage()
返回错误消息 if 搜索失败。
Returns the error message if the search failed.
Stringio/agentscope/extensions/higress/HigressToolSearchResult.java:189–191getTools
public List<ToolInfo> getTools()
获取工具。
Returns the list of recommended tools.
List<ToolInfo>io/agentscope/extensions/higress/HigressToolSearchResult.java:198–200getToolNames
public List<String> getToolNames()
获取 getToolNames。
Returns the names of all found tools.
List<String>io/agentscope/extensions/higress/HigressToolSearchResult.java:207–209toString
public String toString()
返回 toString 结果。
Returns the to string.
Stringio/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.