feat: Separate tool routing (register) from UI visibility (visible)
This commit is contained in:
@@ -16,4 +16,7 @@ public @interface McpFunction {
|
||||
|
||||
// 추가: Redis 자동 등록 및 Heartbeat 대상 여부 제어
|
||||
boolean register() default true;
|
||||
|
||||
// 추가: 툴 목록 노출 여부 제어 (false 시 라우팅은 되나 목록에서 숨김)
|
||||
boolean visible() default true;
|
||||
}
|
||||
|
||||
@@ -19,5 +19,6 @@ public class McpProperties {
|
||||
private String prompt;
|
||||
private String mappingId;
|
||||
private Boolean register;
|
||||
private Boolean visible;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user