mirror of
https://github.com/slhaf/Partner.git
synced 2026-05-12 16:53:04 +08:00
refactor(RunnerClient): redesign existedMetaActions update strategy
Context: Resource-change events cannot reliably represent tool changes. The previous approach attempted to externalize descriptive content into files, but the meta attribute of McpSchema.Tool can provide this information.
This commit is contained in:
@@ -46,6 +46,22 @@ public class RunnerClientTest {
|
||||
System.out.println(query.toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
void schemaTest() {
|
||||
TestRunnerClient testClient = new TestRunnerClient();
|
||||
RunnerClient.StdioMcpServerParams params = new RunnerClient.StdioMcpServerParams(20, "uvx", Map.of("http_proxy", "http://127.0.0.1:7897", "https_proxy", "http://127.0.0.1:7897"), List.of("mcp-server-fetch"));
|
||||
testClient.registerMcpClient("test", params);
|
||||
McpSyncClient client = testClient.mcpClients.values().stream().toList().getFirst();
|
||||
List<McpSchema.Tool> tools = client.listTools().tools();
|
||||
System.out.println("\r\n ------ \r\n");
|
||||
McpSchema.Tool first = tools.getFirst();
|
||||
Map<String, Object> paramsSchema = first.inputSchema().properties();
|
||||
System.out.println(paramsSchema.toString());
|
||||
System.out.println("\r\n ------ \r\n");
|
||||
Map<String, Object> outputSchema = first.outputSchema();
|
||||
System.out.println(outputSchema);
|
||||
}
|
||||
|
||||
@Test
|
||||
void inProcessMcpTransportTest() {
|
||||
RunnerClient.InProcessMcpTransport.Pair pair = RunnerClient.InProcessMcpTransport.pair();
|
||||
|
||||
Reference in New Issue
Block a user