From 6457c2739175929701eef8d8dd0b3ca2a64e8903 Mon Sep 17 00:00:00 2001 From: jade Date: Sat, 11 Jul 2026 00:42:13 +0900 Subject: [PATCH] fix(McpBridge): prevent duplicate name key in tools/list response by mapping name to displayName --- McpBridge.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/McpBridge.java b/McpBridge.java index 0f78109..a4492d4 100644 --- a/McpBridge.java +++ b/McpBridge.java @@ -44,7 +44,7 @@ public class McpBridge { String rawJson = response.body(); // For simplicity, we can just proxy the response if it matches closely, but it doesn't. // Let's just do a naive conversion by replacing "subToolName" with "name" and "parametersSchema" with "inputSchema" - String transformed = rawJson.replace("\"subToolName\"", "\"name\"").replace("\"parametersSchema\"", "\"inputSchema\""); + String transformed = rawJson.replace("\"name\"", "\"displayName\"").replace("\"subToolName\"", "\"name\"").replace("\"parametersSchema\"", "\"inputSchema\""); // Add type: "object" to inputSchema if missing - too complex with string replace, let's hope axhub-gateway already provides correct schema // The result format expects: {"tools": [ ... ]} @@ -120,3 +120,6 @@ public class McpBridge { return line.substring(start, end); } } + + +