diff --git a/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/presentation/McpRouterController.java b/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/presentation/McpRouterController.java index 66b0834..7a2b52a 100644 --- a/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/presentation/McpRouterController.java +++ b/axhub-gateway/src/main/java/io/shinhanlife/axhub/biz/mcp/gateway/presentation/McpRouterController.java @@ -96,7 +96,8 @@ public class McpRouterController { } @GetMapping("/tools/list") - public ResponseEntity listTools() { + public ResponseEntity listTools( + @RequestParam(value = "categoryKey", required = false) String categoryKey) { List activeTools = redisRegistryService.getAllTools() .stream() .filter(ToolMetadata::getVisible) @@ -131,6 +132,12 @@ public class McpRouterController { } } + if (categoryKey != null && !categoryKey.trim().isEmpty()) { + activeTools = activeTools.stream() + .filter(t -> categoryKey.equals(t.getCategoryKey())) + .collect(Collectors.toList()); + } + JsonRpcResponse response = new JsonRpcResponse(); response.setId(UUID.randomUUID().toString()); response.setResult(Map.of("tools", activeTools));