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

@@ -16,4 +16,7 @@ public @interface McpFunction {
// 추가: Redis 자동 등록 및 Heartbeat 대상 여부 제어
boolean register() default true;
// 추가: 툴 목록 노출 여부 제어 (false 시 라우팅은 되나 목록에서 숨김)
boolean visible() default true;
}

View File

@@ -19,5 +19,6 @@ public class McpProperties {
private String prompt;
private String mappingId;
private Boolean register;
private Boolean visible;
}
}

View File

@@ -49,4 +49,9 @@ public class ToolMetadata {
public String getMciServiceId() { return mciServiceId; }
public void setMciServiceId(String mciServiceId) { this.mciServiceId = mciServiceId; }
private boolean visible = true;
public boolean isVisible() { return visible; }
public void setVisible(boolean visible) { this.visible = visible; }
}

View File

@@ -77,6 +77,9 @@ public class ToolRegistryHeartbeatSender {
meta.setMciServiceId(prop != null && prop.getMappingId() != null ? prop.getMappingId() : functionAnnotation.mappingId());
meta.setPodUrl(podUrl);
boolean isVisible = prop != null && prop.getVisible() != null ? prop.getVisible() : functionAnnotation.visible();
meta.setVisible(isVisible);
Map<String, String> prompts = new HashMap<>();
String promptText = prop != null && prop.getPrompt() != null ? prop.getPrompt() : functionAnnotation.prompt();
prompts.put(functionAnnotation.name(), promptText);