feat: Separate tool routing (register) from UI visibility (visible)

This commit is contained in:
jade
2026-07-08 16:19:37 +09:00
parent 2b432c701a
commit 056447075c
8 changed files with 29 additions and 18 deletions

View File

@@ -84,7 +84,10 @@ public class McpRouterController {
@GetMapping("/tools/list")
public ResponseEntity<JsonRpcResponse> listTools() {
List<ToolMetadata> activeTools = redisRegistryService.getAllTools();
List<ToolMetadata> activeTools = redisRegistryService.getAllTools()
.stream()
.filter(ToolMetadata::isVisible)
.collect(java.util.stream.Collectors.toList());
JsonRpcResponse response = new JsonRpcResponse();
response.setId(UUID.randomUUID().toString());
@@ -95,7 +98,10 @@ public class McpRouterController {
@GetMapping(value = "/tools/docs/markdown", produces = "text/markdown;charset=UTF-8")
public ResponseEntity<String> generateToolsMarkdown() {
List<ToolMetadata> tools = redisRegistryService.getAllTools();
List<ToolMetadata> tools = redisRegistryService.getAllTools()
.stream()
.filter(ToolMetadata::isVisible)
.collect(java.util.stream.Collectors.toList());
StringBuilder md = new StringBuilder();
md.append("# \uD83E\uDD16 Shinhan AI Tool Catalog\n\n");

View File

@@ -40,6 +40,9 @@ public class ToolMetadata {
// 2-3. Pod 실행 URL (독립적인 Microservice 라우팅용, 예: http://localhost:8082)
private String podUrl;
// 2-4. 가시성 여부
private boolean visible;
// 3. 연동 아키텍처 구분 (DIRECT / MCI_EAI)
private String integrationType; // 연동 타입: "DIRECT" 또는 "MCI_EAI"

View File

@@ -37,17 +37,8 @@ public class ToolPlanner {
var toolMetadata = redisRegistryService.getTool(toolName);
if (toolMetadata == null) {
log.warn(" [Planner] 등록되지 않은 툴 요청: {}. 레지스트리를 참조하지 않고 강제 연동 모드로 전환합니다.", toolName);
// 히든 툴(register=false)에 대한 강제 라우팅 폴백
String fallbackPodUrl = "http://tool-other:8084"; // 기본값 (get_template_file_url 등)
if (toolName.contains("email")) fallbackPodUrl = "http://tool-email:8083";
else if (toolName.contains("sms")) fallbackPodUrl = "http://tool-sms:8082";
toolMetadata = ToolMetadata.builder()
.toolName(toolName)
.integrationType("DIRECT")
.podUrl(fallbackPodUrl)
.build();
log.warn(" [Planner] 등록되지 않은 툴 요청: {}", toolName);
throw new RuntimeException("해당 툴(" + toolName + ")이 레지스트리에 존재하지 않습니다.");
}
// 2-1. [신규] 도메인 그룹핑 기반 권한 검증