Remove route key from initialize metadata
All checks were successful
Deploy Gateway / deploy (push) Successful in 2m27s

This commit is contained in:
2026-09-02 17:28:38 +09:00
parent 9905d52db3
commit 8a6c3617b4
2 changed files with 2 additions and 6 deletions

View File

@@ -8,7 +8,6 @@ import io.shinhanlife.dat.biz.mcp.context.McpRequestContext;
import io.shinhanlife.dat.biz.mcp.jsonrpc.JsonRpcRequest;
import io.shinhanlife.dat.biz.mcp.jsonrpc.JsonRpcResponse;
import io.shinhanlife.dat.biz.mcp.registry.ToolRegistryClient;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
@@ -118,9 +117,6 @@ public class InitializeHandler implements McpMethodHandlerRegistry.Handler {
}
List<JsonNode> routingManifests =
registryClient.fetchRoutingManifests(routeKey, routingHintsProperties.manifestPath());
Map<String, Object> meta = new LinkedHashMap<>();
meta.put("routeKey", routeKey);
meta.put("toolServers", routingManifests);
return meta;
return Map.of("toolServers", routingManifests);
}
}

View File

@@ -110,7 +110,7 @@ class InitializeHandlerTest {
var response = handler.handle(request, io.shinhanlife.dat.biz.mcp.TestFixtures.context());
var serialized = io.shinhanlife.dat.biz.mcp.TestFixtures.OBJECT_MAPPER.valueToTree(response.result());
assertThat(serialized.path("_meta").path("routeKey").asText()).isEqualTo("external");
assertThat(serialized.path("_meta").has("routeKey")).isFalse();
assertThat(serialized.path("_meta").path("toolServers"))
.singleElement()
.isEqualTo(routingManifest);