MCP标准协议中,对于 tools/list 已经支持了 outputSchema;
在使用 agentscope-java时,按照文档介绍使用方式:
McpClientWrapper httpClient = McpClientBuilder.create("http-mcp")
.streamableHttpTransport("https://mcp.example.com/http")
.header("X-API-Key", apiKey)
.queryParam("queryKey", "queryValue")
.buildAsync()
.block();
toolkit.registerMcpClient(httpClient ).block();
// 调用
List<ToolSchema> allSchemas = toolkit.getToolSchemas();
getToolSchemas() 方法返回 List,ToolSchema的定义为:
public class ToolSchema {
private final String name;
private final String description;
private final Map<String, Object> parameters;
private final Boolean strict;
}
从类结构定义,以及真实测试之后,应该是 parameters对应了 inputSchema,但是没有 outputSchema。
在某些特殊情况下,比如 会在outputSchema的说明里面定义各种单位,可能不同的tool的单位定义不一样;如果获取不到 outputSchema,agent/llm 拿不到具体的 output定义,返回的推理和结论可能就会出现问题。
参考 腾讯 solon ai 中,在 MethodFunctionTool 是实现了 outputSchema 的支持的:
public class MethodFunctionTool implements FunctionTool {
static final Logger log = LoggerFactory.getLogger(MethodFunctionTool.class);
private final BeanWrap beanWrap;
private final MethodWrap methodWrap;
private final Type returnType;
private final String name;
private final String title;
private final String description;
private final Map<String, Object> meta = new HashMap();
private final boolean returnDirect;
private final Map<String, ParamDesc> params;
private final ToolCallResultConverter resultConverter;
private final String inputSchema;
private String outputSchema;
}
请问这块是否有考虑支持或者计划支持呢。
MCP标准协议中,对于 tools/list 已经支持了 outputSchema;
在使用 agentscope-java时,按照文档介绍使用方式:
getToolSchemas() 方法返回 List,ToolSchema的定义为:
从类结构定义,以及真实测试之后,应该是 parameters对应了 inputSchema,但是没有 outputSchema。
在某些特殊情况下,比如 会在outputSchema的说明里面定义各种单位,可能不同的tool的单位定义不一样;如果获取不到 outputSchema,agent/llm 拿不到具体的 output定义,返回的推理和结论可能就会出现问题。
参考 腾讯 solon ai 中,在 MethodFunctionTool 是实现了 outputSchema 的支持的:
请问这块是否有考虑支持或者计划支持呢。