McpFunction에 MCP 표준 힌트 4개 추가
This commit is contained in:
@@ -71,6 +71,18 @@ public class ToolMetadata {
|
|||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Boolean requiresApproval = false;
|
private Boolean requiresApproval = false;
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
|
private Boolean readOnlyHint = false;
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
|
private Boolean destructiveHint = false;
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
|
private Boolean idempotentHint = false;
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
|
private Boolean openWorldHint = false;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 3. 연동 아키텍처 구분 (DIRECT / MCI_EAI)
|
// 3. 연동 아키텍처 구분 (DIRECT / MCI_EAI)
|
||||||
@@ -113,4 +125,4 @@ public class ToolMetadata {
|
|||||||
if (parametersSchema == null || !parametersSchema.containsKey("required")) return Set.of();
|
if (parametersSchema == null || !parametersSchema.containsKey("required")) return Set.of();
|
||||||
return new HashSet<>((List<String>) parametersSchema.get("required"));
|
return new HashSet<>((List<String>) parametersSchema.get("required"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,12 @@ public class RegistryMcpToolSpecificationFactory {
|
|||||||
.name(entry.getName())
|
.name(entry.getName())
|
||||||
.description(description(entry))
|
.description(description(entry))
|
||||||
.inputSchema(inputSchema(entry))
|
.inputSchema(inputSchema(entry))
|
||||||
|
.annotations(McpSchema.ToolAnnotations.builder()
|
||||||
|
.readOnlyHint(Boolean.TRUE.equals(entry.getReadOnlyHint()))
|
||||||
|
.destructiveHint(Boolean.TRUE.equals(entry.getDestructiveHint()))
|
||||||
|
.idempotentHint(Boolean.TRUE.equals(entry.getIdempotentHint()))
|
||||||
|
.openWorldHint(Boolean.TRUE.equals(entry.getOpenWorldHint()))
|
||||||
|
.build())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
return McpServerFeatures.SyncToolSpecification.builder()
|
return McpServerFeatures.SyncToolSpecification.builder()
|
||||||
|
|||||||
@@ -39,5 +39,10 @@ public @interface McpFunction {
|
|||||||
// 추가: HITL 승인 체계 지원 (실행 전 사용자 승인 필요 여부)
|
// 추가: HITL 승인 체계 지원 (실행 전 사용자 승인 필요 여부)
|
||||||
boolean requiresApproval() default false;
|
boolean requiresApproval() default false;
|
||||||
|
|
||||||
|
boolean readOnlyHint() default false;
|
||||||
|
boolean destructiveHint() default false;
|
||||||
|
boolean idempotentHint() default false;
|
||||||
|
boolean openWorldHint() default false;
|
||||||
|
|
||||||
// 추가: 툴 별 기본 Timeout 설정 (기본 300초 = 300000ms)
|
// 추가: 툴 별 기본 Timeout 설정 (기본 300초 = 300000ms)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,6 +58,17 @@ public class ToolMetadata {
|
|||||||
@Builder.Default
|
@Builder.Default
|
||||||
private Boolean requiresApproval = false;
|
private Boolean requiresApproval = false;
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
|
private Boolean readOnlyHint = false;
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
|
private Boolean destructiveHint = false;
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
|
private Boolean idempotentHint = false;
|
||||||
|
|
||||||
|
@Builder.Default
|
||||||
|
private Boolean openWorldHint = false;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -107,6 +107,10 @@ public class ToolRegistryHeartbeatSender {
|
|||||||
meta.setVisible(isVisible);
|
meta.setVisible(isVisible);
|
||||||
meta.setIsRegistered(isRegister);
|
meta.setIsRegistered(isRegister);
|
||||||
meta.setRequiresApproval(functionAnnotation.requiresApproval());
|
meta.setRequiresApproval(functionAnnotation.requiresApproval());
|
||||||
|
meta.setReadOnlyHint(functionAnnotation.readOnlyHint());
|
||||||
|
meta.setDestructiveHint(functionAnnotation.destructiveHint());
|
||||||
|
meta.setIdempotentHint(functionAnnotation.idempotentHint());
|
||||||
|
meta.setOpenWorldHint(functionAnnotation.openWorldHint());
|
||||||
|
|
||||||
Map<String, String> prompts = new HashMap<>();
|
Map<String, String> prompts = new HashMap<>();
|
||||||
String promptText = functionAnnotation.prompt();
|
String promptText = functionAnnotation.prompt();
|
||||||
@@ -174,4 +178,4 @@ public class ToolRegistryHeartbeatSender {
|
|||||||
log.error(" [HeartbeatSender] 툴 등록 실패: {}", ex.getMessage());
|
log.error(" [HeartbeatSender] 툴 등록 실패: {}", ex.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user