2 Commits

Author SHA1 Message Date
jade
ba39a23b09 Fix: Add missing @Service annotations to MCP Tool use case implementations
Some checks failed
Deploy to OCIWP / deploy (push) Has been cancelled
2026-07-27 10:45:09 +09:00
jade
579979b5fe Refactor: Move MCP tool annotations to interface level 2026-07-27 10:21:24 +09:00
30 changed files with 186 additions and 156 deletions

View File

@@ -26,4 +26,4 @@ public interface ZtUsacUseCase {
* @return 인사정보
*/
ZtUsacOutDto selectZtUsac(ZtUsacInDto dto);
}
}

View File

@@ -179,12 +179,35 @@ public class ToolScaffolder {
String serviceInterfaceContent = """
package %s.usecase;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import %s.dto.%sRequest;
@McpTool(
routingType = "%s",
categoryKey = "%s"
)
public interface %sUseCase {
@McpFunction(
displayName = "%s 툴",
name = "%s",
description = "%s",
prompt = "%s",
mappingId = "%s",
register = %s,
requiresApproval = false,
openWorldHint = true
)
Object execute(%sRequest req);
}
""".formatted(bizPackage, bizPackage, baseName, baseName, baseName);
""".formatted(
bizPackage,
bizPackage, baseName,
routingType, group.toLowerCase(),
baseName,
baseName, toolName, description, description + " 해줘.", interfaceId, register,
baseName
);
Files.writeString(usecaseDir.resolve(baseName + "UseCase.java"), serviceInterfaceContent);
@@ -194,8 +217,6 @@ public class ToolScaffolder {
serviceImplContent = """
package %s.usecase.impl;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import %s.dto.%sRequest;
import %s.dto.%sResponse;
import %s.usecase.%sUseCase;
@@ -225,26 +246,12 @@ public class ToolScaffolder {
@Slf4j
@Service
@RequiredArgsConstructor
@McpTool(
routingType = "%s",
categoryKey = "%s"
)
public class %sUseCaseImpl implements %sUseCase {
private final AxhubMciComponent mci;
private final %sLegacyConverter converter;
@Override
@McpFunction(
displayName = "%s 툴",
name = "%s",
description = "%s",
prompt = "%s",
mappingId = "%s",
register = %s,
requiresApproval = false,
openWorldHint = true
)
public Object execute(%sRequest req) {
log.info("[MCI Tool] {} 요청 수신.", "%s");
try {
@@ -269,18 +276,14 @@ public class ToolScaffolder {
bizPackage, baseName,
bizPackage, baseName,
bizPackage, baseName,
bizPackage, baseName,
BASE_PACKAGE, group.toLowerCase(), interfaceId,
bizPackage, baseName,
author,
createDate,
createDate, author,
routingType, group.toLowerCase(),
baseName, baseName,
baseName,
baseName, toolName, description, description + " 해줘.", interfaceId, register,
baseName,
interfaceId,
baseName, toolName,
interfaceId,
interfaceId
);
@@ -288,8 +291,6 @@ public class ToolScaffolder {
serviceImplContent = """
package %s.usecase.impl;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import %s.dto.%sRequest;
import %s.dto.%sResponse;
import %s.usecase.%sUseCase;
@@ -316,24 +317,11 @@ public class ToolScaffolder {
@Slf4j
@Service
@RequiredArgsConstructor
@McpTool(
routingType = "%s",
categoryKey = "%s"
)
public class %sUseCaseImpl extends AbstractMcpToolUseCase implements %sUseCase {
private final %sLegacyConverter converter;
@Override
@McpFunction(
displayName = "%s 툴",
name = "%s",
description = "%s",
prompt = "%s",
mappingId = "%s",
register = %s,
requiresApproval = false
)
public Object execute(%sRequest req) {
// %sLegacyRequest legacyRequest = converter.toLegacyRequest(req);
return executeLegacy("%s", "%s", req); // Or pass legacyRequest
@@ -348,10 +336,8 @@ public class ToolScaffolder {
author,
createDate,
createDate, author,
routingType, group.toLowerCase(),
baseName, baseName,
baseName,
baseName, toolName, description, description + " 해줘.", interfaceId, register,
baseName,
baseName,
routingType, interfaceId

View File

@@ -28,7 +28,7 @@ import java.util.stream.Stream;
public class ToolSourceUpdater {
public static void updateToolSource(String toolName, String domainGroup, String description, boolean register, Boolean requiresApproval) throws Exception {
// 1. Find all *Service.java files in axhub-tool-* directories
// 1. Find all *UseCase.java files in dap-tool-* directories
String envSourceDir = System.getenv("AXHUB_SOURCE_DIR");
Path rootDir = envSourceDir != null ? Paths.get(envSourceDir) : Paths.get(".");
@@ -36,8 +36,8 @@ public class ToolSourceUpdater {
try (Stream<Path> paths = Files.walk(rootDir)) {
javaFiles = paths
.filter(Files::isRegularFile)
.filter(p -> p.toString().endsWith("Service.java"))
.filter(p -> p.toString().contains("axhub-tool-"))
.filter(p -> p.toString().endsWith("UseCase.java"))
.filter(p -> p.toString().contains("dap-tool-") || p.toString().contains("axhub-tool-"))
.collect(Collectors.toList());
}

View File

@@ -94,8 +94,8 @@ public class BusinessToolController {
outerLoop:
for (Object bean : allBeans.values()) {
Class<?> targetClass = AopUtils.getTargetClass(bean);
for (Method method : targetClass.getDeclaredMethods()) {
McpFunction mcpFunc = AnnotationUtils.findAnnotation(method, McpFunction.class);
for (Method targetMethodOfClass : targetClass.getDeclaredMethods()) {
McpFunction mcpFunc = AnnotationUtils.findAnnotation(targetMethodOfClass, McpFunction.class);
if (mcpFunc != null) {
String baseName = mcpFunc.name();
String expectedName = mcpProperties.getNamespace() != null && !mcpProperties.getNamespace().isEmpty()
@@ -104,7 +104,11 @@ public class BusinessToolController {
if (expectedName.equals(functionName) || baseName.equals(functionName)) {
targetBean = bean;
targetMethod = method;
try {
targetMethod = bean.getClass().getMethod(targetMethodOfClass.getName(), targetMethodOfClass.getParameterTypes());
} catch (NoSuchMethodException e) {
targetMethod = targetMethodOfClass;
}
targetFunctionAnnotation = mcpFunc;
break outerLoop;
}

View File

@@ -92,4 +92,4 @@ public abstract class AbstractMcpToolUseCase {
return error;
}
}
}
}

View File

@@ -76,11 +76,18 @@ public class ToolRegistryHeartbeatSender {
Map<String, Object> allBeans = applicationContext.getBeansOfType(Object.class);
for (Object bean : allBeans.values()) {
Class<?> targetClass = AopUtils.getTargetClass(bean);
// 클래스 또는 프록시(인터페이스)에서 @McpTool 스캔
McpTool toolAnnotation = AnnotationUtils.findAnnotation(targetClass, McpTool.class);
if (toolAnnotation == null) {
toolAnnotation = AnnotationUtils.findAnnotation(bean.getClass(), McpTool.class);
}
for (Method method : targetClass.getDeclaredMethods()) {
// 메서드, 수퍼클래스, 인터페이스를 모두 뒤져서 @McpFunction 스캔
McpFunction functionAnnotation = AnnotationUtils.findAnnotation(method, McpFunction.class);
if (functionAnnotation != null) {
if (functionAnnotation != null && toolAnnotation != null) {
String baseName = functionAnnotation.displayName();
String rawSubToolName = functionAnnotation.name();
String subToolName = mcpProperties.getNamespace() != null && !mcpProperties.getNamespace().isEmpty()

View File

@@ -1,7 +1,15 @@
package io.shinhanlife.dap.mcc.biz.cmm.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.cmm.dto.*;
@McpTool(routingType = "MCI", categoryKey = "cmm")
public interface BalanceUseCase {
@McpFunction(register = false, displayName = "balance 툴", name = "balance",
description = "고객의 계좌 잔액을 조회합니다.",
prompt = "고객 계좌 잔액을 조회해줘.",
mappingId = "ACC_001"
)
Object execute(BalanceRequest req);
}

View File

@@ -1,7 +1,16 @@
package io.shinhanlife.dap.mcc.biz.cmm.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.cmm.dto.*;
@McpTool(
routingType = "MCI",
categoryKey = "claim"
)
public interface BillingProcessUseCase {
Object getStatus(BillingStatusRequest req);
@McpFunction(register = false, displayName = "process 툴", name = "process", description = "청구 처리", prompt = "현재 접수된 청구건에 대한 심사 처리를 진행해.", mappingId = "BILL_002")
Object processBilling(BillingProcessRequest data);
}

View File

@@ -1,7 +1,16 @@
package io.shinhanlife.dap.mcc.biz.cmm.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.cmm.dto.*;
@McpTool(
routingType = "EAI",
categoryKey = "policy"
)
public interface BondIssueUseCase {
Object check(BondCheckRequest req);
@McpFunction(displayName = "issue 툴", name = "issue", register = false, description = "증권 발행 테스트1", prompt = "디지털 증권 발행 프로세스를 실행해.", mappingId = "BOND_002")
Object issue(BondIssueRequest data);
}

View File

@@ -1,7 +1,19 @@
package io.shinhanlife.dap.mcc.biz.cmm.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.cmm.dto.*;
@McpTool(
routingType = "HTTP",
categoryKey = "hr"
)
public interface CommonUtilityUseCase {
Object registerVacation(VacationRegisterRequest req);
@McpFunction(register = false, displayName = "get_leave_count 툴", name = "get_leave_count", description = "연차 갯수 조회", prompt = "현재 사용 가능한 남은 연차 일수를 알려줘.", mappingId = "HR_VAC_02")
Object getLeaveCount(LeaveCountRequest data);
@McpFunction(register = false, displayName = "secret_tool 툴", name = "secret_tool", description = "비공개 툴 테스트", prompt = "숨겨진 툴 강제 호출", mappingId = "SECRET_001", visible = false)
Object secretTool(LeaveCountRequest data);
}

View File

@@ -1,7 +1,16 @@
package io.shinhanlife.dap.mcc.biz.cmm.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.cmm.dto.*;
@McpTool(
routingType = "HTTP",
categoryKey = "contract"
)
public interface ContractInquiryUseCase {
Object getStatus(ContractStatusRequest req);
@McpFunction(register = false, displayName = "contract_detail 툴", name = "contract_detail", description = "계약상세 조회", prompt = "김신한 고객의 계약 상세 내역을 알려줘.", mappingId = "CNTR_002")
Object getDetail(ContractDetailRequest data);
}

View File

@@ -1,7 +1,16 @@
package io.shinhanlife.dap.mcc.biz.cmm.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.cmm.dto.*;
@McpTool(
routingType = "TCP",
categoryKey = "customer"
)
public interface CustomerInfoUseCase {
Object getGrade(CustomerGradeRequest req);
@McpFunction(register = false, displayName = "detail 툴", name = "detail", description = "고객상세 정보 조회", prompt = "이 고객의 상세 기본정보(주소, 연락처 등)를 알려줘.", mappingId = "CRM_002")
Object getDetail(CustomerDetailRequest data);
}

View File

@@ -1,7 +1,19 @@
package io.shinhanlife.dap.mcc.biz.cmm.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.cmm.dto.*;
@McpTool(
routingType = "HTTP",
categoryKey = "cmm"
)
public interface TemplateUtilityUseCase {
@McpFunction(
displayName = "템플릿 유틸리티",
name = "get_template_file_url",
description = "요청한 템플릿(엑셀, 워드 등) 파일(양식)을 다운로드 받을 수 있는 시스템 URL을 반환합니다. AI는 이 URL을 사용자에게 마크다운 링크 형태로 제공해야 합니다.",
prompt = "요청하신 템플릿 양식 파일 다운로드 URL은 다음과 같습니다. 클릭하여 다운로드하세요:"
)
java.util.Map<String, Object> getTemplateFileUrl(TemplateDownloadRequest req);
}

View File

@@ -15,8 +15,6 @@ package io.shinhanlife.dap.mcc.biz.cmm.usecase.impl;
*
* </pre>
*/
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.mcc.biz.cmm.usecase.BalanceUseCase;
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
import io.shinhanlife.dap.mcc.biz.cmm.dto.BalanceRequest;
@@ -27,14 +25,9 @@ import java.util.Map;
@Slf4j
@Service
@McpTool(routingType = "MCI", categoryKey = "cmm")
public class BalanceUseCaseImpl extends AbstractMcpToolUseCase implements BalanceUseCase {
@McpFunction(register = false, displayName = "balance 툴", name = "balance",
description = "고객의 계좌 잔액을 조회합니다.",
prompt = "고객 계좌 잔액을 조회해줘.",
mappingId = "ACC_001"
)
@Override
public Object execute(BalanceRequest req) {
log.info("[Balance] 계좌 잔액 조회 요청 수신. 계좌번호: {}", req.getAccountNumber());

View File

@@ -2,20 +2,16 @@ package io.shinhanlife.dap.mcc.biz.cmm.usecase.impl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.mcc.biz.cmm.usecase.BillingProcessUseCase;
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
import org.springframework.stereotype.Service;
import io.shinhanlife.dap.mcc.biz.cmm.dto.BillingProcessRequest;
import io.shinhanlife.dap.mcc.biz.cmm.dto.BillingStatusRequest;
import java.util.HashMap;
import java.util.Map;
@McpTool(
routingType = "MCI",
categoryKey = "claim"
)
/**
* @package io.shinhanlife.dap.mcc.service
* @className BillingProcessService
@@ -31,15 +27,16 @@ import java.util.Map;
* </pre>
*/
@lombok.extern.slf4j.Slf4j
@Service
public class BillingProcessUseCaseImpl extends AbstractMcpToolUseCase implements BillingProcessUseCase {
@McpFunction(register = false, displayName = "status 툴", name = "status", description = "청구심사 상태 조회", prompt = "현재 접수된 청구건 상태를 알려줘.", mappingId = "BILL_001")
@Override
public Object getStatus(BillingStatusRequest data) {
return executeBillingLogic("BILL_001", data);
}
@McpFunction(register = false, displayName = "process 툴", name = "process", description = "청구 처리", prompt = "현재 접수된 청구건에 대한 심사 처리를 진행해.", mappingId = "BILL_002")
@Override
public Object processBilling(BillingProcessRequest data) {
return executeBillingLogic("BILL_002", data);
}

View File

@@ -1,16 +1,12 @@
package io.shinhanlife.dap.mcc.biz.cmm.usecase.impl;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.mcc.biz.cmm.usecase.BondIssueUseCase;
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
import org.springframework.stereotype.Service;
import io.shinhanlife.dap.mcc.biz.cmm.dto.BondCheckRequest;
import io.shinhanlife.dap.mcc.biz.cmm.dto.BondIssueRequest;
@McpTool(
routingType = "EAI",
categoryKey = "policy"
)
/**
* @package io.shinhanlife.dap.mcc.service
* @className BondIssueService
@@ -25,15 +21,16 @@ import io.shinhanlife.dap.mcc.biz.cmm.dto.BondIssueRequest;
*
* </pre>
*/
@Service
public class BondIssueUseCaseImpl extends AbstractMcpToolUseCase implements BondIssueUseCase {
@McpFunction(displayName = "check 툴", name = "check", register = false, description = "발행 가능 여부 조회 테스트", prompt = "디지털 증권 발행 한도가 충분한지 확인해줘.", mappingId = "BOND_001")
@Override
public Object check(BondCheckRequest data) {
return executeLegacy("EAI", "BOND_001", data);
}
@McpFunction(displayName = "issue 툴", name = "issue", register = false, description = "증권 발행 테스트1", prompt = "디지털 증권 발행 프로세스를 실행해.", mappingId = "BOND_002")
@Override
public Object issue(BondIssueRequest data) {
return executeLegacy("EAI", "BOND_002", data);
}

View File

@@ -1,16 +1,12 @@
package io.shinhanlife.dap.mcc.biz.cmm.usecase.impl;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.mcc.biz.cmm.usecase.CommonUtilityUseCase;
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
import org.springframework.stereotype.Service;
import io.shinhanlife.dap.mcc.biz.cmm.dto.LeaveCountRequest;
import io.shinhanlife.dap.mcc.biz.cmm.dto.VacationRegisterRequest;
@McpTool(
routingType = "HTTP",
categoryKey = "hr"
)
/**
* @package io.shinhanlife.dap.mcc.service
* @className CommonUtilityService
@@ -25,20 +21,21 @@ import io.shinhanlife.dap.mcc.biz.cmm.dto.VacationRegisterRequest;
*
* </pre>
*/
@Service
public class CommonUtilityUseCaseImpl extends AbstractMcpToolUseCase implements CommonUtilityUseCase {
@McpFunction(register = false, displayName = "register_vacation 툴", name = "register_vacation", description = "휴가 등록", prompt = "내일 하루 연차 휴가를 등록해줘.", mappingId = "HR_VAC_01")
@Override
public Object registerVacation(VacationRegisterRequest data) {
return executeLegacy("HTTP", "HR_VAC_01", data);
}
@McpFunction(register = false, displayName = "get_leave_count 툴", name = "get_leave_count", description = "연차 갯수 조회", prompt = "현재 사용 가능한 남은 연차 일수를 알려줘.", mappingId = "HR_VAC_02")
@Override
public Object getLeaveCount(LeaveCountRequest data) {
return executeLegacy("HTTP", "HR_VAC_02", data);
}
@McpFunction(register = false, displayName = "secret_tool 툴", name = "secret_tool", description = "비공개 툴 테스트", prompt = "숨겨진 툴 강제 호출", mappingId = "SECRET_001", visible = false)
@Override
public Object secretTool(LeaveCountRequest data) {
return executeLegacy("HTTP", "SECRET_001", data);
}

View File

@@ -1,16 +1,12 @@
package io.shinhanlife.dap.mcc.biz.cmm.usecase.impl;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.mcc.biz.cmm.usecase.ContractInquiryUseCase;
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
import org.springframework.stereotype.Service;
import io.shinhanlife.dap.mcc.biz.cmm.dto.ContractDetailRequest;
import io.shinhanlife.dap.mcc.biz.cmm.dto.ContractStatusRequest;
@McpTool(
routingType = "HTTP",
categoryKey = "contract"
)
/**
* @package io.shinhanlife.dap.mcc.service
* @className ContractInquiryService
@@ -25,15 +21,16 @@ import io.shinhanlife.dap.mcc.biz.cmm.dto.ContractStatusRequest;
*
* </pre>
*/
@Service
public class ContractInquiryUseCaseImpl extends AbstractMcpToolUseCase implements ContractInquiryUseCase {
@McpFunction(register = false, displayName = "contract_status 툴", name = "contract_status", description = "계약상태 조회", prompt = "김신한 고객의 현재 계약 상태를 조회해줘.", mappingId = "CNTR_001")
@Override
public Object getStatus(ContractStatusRequest data) {
return executeLegacy("HTTP", "CNTR_001", data);
}
@McpFunction(register = false, displayName = "contract_detail 툴", name = "contract_detail", description = "계약상세 조회", prompt = "김신한 고객의 계약 상세 내역을 알려줘.", mappingId = "CNTR_002")
@Override
public Object getDetail(ContractDetailRequest data) {
return executeLegacy("HTTP", "CNTR_002", data);
}

View File

@@ -1,16 +1,12 @@
package io.shinhanlife.dap.mcc.biz.cmm.usecase.impl;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.mcc.biz.cmm.usecase.CustomerInfoUseCase;
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
import org.springframework.stereotype.Service;
import io.shinhanlife.dap.mcc.biz.cmm.dto.CustomerDetailRequest;
import io.shinhanlife.dap.mcc.biz.cmm.dto.CustomerGradeRequest;
@McpTool(
routingType = "TCP",
categoryKey = "customer"
)
/**
* @package io.shinhanlife.dap.mcc.service
* @className CustomerInfoService
@@ -25,15 +21,16 @@ import io.shinhanlife.dap.mcc.biz.cmm.dto.CustomerGradeRequest;
*
* </pre>
*/
@Service
public class CustomerInfoUseCaseImpl extends AbstractMcpToolUseCase implements CustomerInfoUseCase {
@McpFunction(register = false, displayName = "grade 툴", name = "grade", description = "고객등급 조회", prompt = "이 고객의 VIP 등급을 조회해줘.", mappingId = "CRM_001")
@Override
public Object getGrade(CustomerGradeRequest req) {
return executeLegacy("TCP", "CRM_001", req);
}
@McpFunction(register = false, displayName = "detail 툴", name = "detail", description = "고객상세 정보 조회", prompt = "이 고객의 상세 기본정보(주소, 연락처 등)를 알려줘.", mappingId = "CRM_002")
@Override
public Object getDetail(CustomerDetailRequest data) {
return executeLegacy("TCP", "CRM_002", data);
}

View File

@@ -1,7 +1,5 @@
package io.shinhanlife.dap.mcc.biz.cmm.usecase.impl;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.mcc.biz.cmm.usecase.TemplateUtilityUseCase;
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
import io.shinhanlife.dap.mcc.biz.cmm.dto.TemplateDownloadRequest;
@@ -14,10 +12,7 @@ import java.util.Map;
@Slf4j
@Service
@McpTool(
routingType = "HTTP",
categoryKey = "cmm"
)
/**
* @package io.shinhanlife.dap.mcc.service
* @className TemplateUtilityService
@@ -35,10 +30,6 @@ import java.util.Map;
public class TemplateUtilityUseCaseImpl extends AbstractMcpToolUseCase implements TemplateUtilityUseCase {
@Override
@McpFunction(register = false, displayName = "get_template_file_url 툴", name = "get_template_file_url",
description = "특정 템플릿의 양식 파일(엑셀, 워드 등)을 다운로드 받을 수 있는 시스템 URL을 반환합니다. AI는 이 URL을 사용자에게 마크다운 링크 형태로 제공해야 합니다.",
prompt = "요청하신 템플릿 양식 파일 다운로드 URL은 다음과 같습니다. 클릭하여 다운로드하세요:"
)
public Map<String, Object> getTemplateFileUrl(TemplateDownloadRequest data) {
try {
String templateId = (data != null && data.getTemplateId() != null) ? data.getTemplateId().toLowerCase() : "default";

View File

@@ -1,7 +1,10 @@
package io.shinhanlife.dap.mcc.biz.oth.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.oth.dto.*;
@McpTool(routingType = "MCI", categoryKey = "oth")
public interface OnnbaMciToolUseCase {
Object callOnnba3011(Onnba3011Request req);
}

View File

@@ -1,8 +1,6 @@
package io.shinhanlife.dap.mcc.biz.oth.usecase.impl;
import io.shinhanlife.dap.mcc.infra.itrf.mci.cfp.a.MciCfpaClient;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.mcc.biz.oth.usecase.OnnbaMciToolUseCase;
import io.shinhanlife.dap.mcc.biz.oth.dto.Onnba3011Request;
import lombok.RequiredArgsConstructor;
@@ -26,7 +24,6 @@ import org.springframework.stereotype.Service;
@Slf4j
@Service
@RequiredArgsConstructor
@McpTool(routingType = "MCI", categoryKey = "oth")
public class OnnbaMciToolUseCaseImpl implements OnnbaMciToolUseCase {
private static final String INTERFACE_CODE_3011 = "CLCNNB00001";
@@ -38,14 +35,7 @@ public class OnnbaMciToolUseCaseImpl implements OnnbaMciToolUseCase {
* AI Agent가 호출하게 될 메서드입니다.
* @McpFunction 어노테이션 하나로 AI 도구로 자동 노출 및 라우팅됩니다.
*/
@McpFunction(
register = false,
name = "calculate_subscription_limit",
displayName = "보종By가입설계한도계산조회",
description = "MCI 연동을 통해 보종By가입설계한도계산조회를 수행합니다.",
prompt = "가입설계 한도를 계산하고 조회해줘.",
mappingId = INTERFACE_CODE_3011
)
@Override
public Object callOnnba3011(Onnba3011Request req) {
log.info("[MCI Tool] 보종By가입설계한도계산조회 요청 수신.");

View File

@@ -1,8 +1,19 @@
package io.shinhanlife.dap.mcc.biz.smp.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.smp.dto.DailyQuoteRequest;
import io.shinhanlife.dap.mcc.biz.smp.dto.DailyQuoteResponse;
@McpTool(
routingType = "DIRECT",
categoryKey = "smp"
)
public interface DailyQuoteToolUseCase {
@McpFunction(register = false, displayName = "랜덤 명언 툴", name = "daily_quote",
description = "무작위로 영감을 주는 명언을 하나 가져옵니다.",
prompt = "오늘의 명언 하나 알려줘, 동기부여 명언 등",
mappingId = "QUOTE_001"
)
DailyQuoteResponse execute(DailyQuoteRequest req);
}

View File

@@ -1,8 +1,21 @@
package io.shinhanlife.dap.mcc.biz.smp.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.smp.dto.ExchangeRateRequest;
import io.shinhanlife.dap.mcc.biz.smp.dto.ExchangeRateResponse;
import io.shinhanlife.dap.mcc.biz.smp.dto.ExchangeRateRequest;
import io.shinhanlife.dap.mcc.biz.smp.dto.ExchangeRateResponse;
@McpTool(
routingType = "DIRECT",
categoryKey = "smp"
)
public interface ExchangeRateToolUseCase {
@McpFunction(register = false, displayName = "실시간 환율 조회 툴", name = "exchange_rate",
description = "원하는 통화의 실시간 환율을 조회합니다. (예: USD, EUR, JPY)",
prompt = "현재 달러 환율 알려줘, 엔화 환율은?",
mappingId = "EXCHANGE_001"
)
ExchangeRateResponse execute(ExchangeRateRequest req);
}

View File

@@ -1,7 +1,18 @@
package io.shinhanlife.dap.mcc.biz.smp.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.smp.dto.*;
@McpTool(
routingType = "DIRECT",
categoryKey = "smp"
)
public interface WeatherToolUseCase {
@McpFunction(register = false, displayName = "날씨 조회 툴", name = "weather",
description = "특정 도시의 현재 날씨, 온도, 풍속 정보를 조회합니다.",
prompt = "서울 날씨 알려줘, 부산 기온 알려줘 등 실시간 기상 조회",
mappingId = "WEATHER_001"
)
WeatherResponse execute(WeatherRequest req);
}

View File

@@ -1,7 +1,5 @@
package io.shinhanlife.dap.mcc.biz.smp.usecase.impl;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.mcc.biz.smp.dto.DailyQuoteRequest;
import io.shinhanlife.dap.mcc.biz.smp.dto.DailyQuoteResponse;
import io.shinhanlife.dap.mcc.biz.smp.usecase.DailyQuoteToolUseCase;
@@ -28,10 +26,6 @@ import java.util.Random;
*/
@Slf4j
@Service
@McpTool(
routingType = "DIRECT",
categoryKey = "smp"
)
public class DailyQuoteToolUseCaseImpl extends AbstractMcpToolUseCase implements DailyQuoteToolUseCase {
private final List<DailyQuoteResponse> quotes = List.of(
@@ -42,11 +36,6 @@ public class DailyQuoteToolUseCaseImpl extends AbstractMcpToolUseCase implements
);
@Override
@McpFunction(register = false, displayName = "랜덤 명언 툴", name = "daily_quote",
description = "무작위로 영감을 주는 명언을 하나 가져옵니다.",
prompt = "오늘의 명언 하나 알려줘, 동기부여 명언 등",
mappingId = "QUOTE_001"
)
public DailyQuoteResponse execute(DailyQuoteRequest req) {
int index = new Random().nextInt(quotes.size());
DailyQuoteResponse selected = quotes.get(index);

View File

@@ -1,7 +1,5 @@
package io.shinhanlife.dap.mcc.biz.smp.usecase.impl;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.mcc.biz.smp.dto.ExchangeRateRequest;
import io.shinhanlife.dap.mcc.biz.smp.dto.ExchangeRateResponse;
import io.shinhanlife.dap.mcc.biz.smp.usecase.ExchangeRateToolUseCase;
@@ -26,10 +24,6 @@ import org.springframework.web.client.RestClient;
*/
@Slf4j
@Service
@McpTool(
routingType = "DIRECT",
categoryKey = "smp"
)
public class ExchangeRateToolUseCaseImpl extends AbstractMcpToolUseCase implements ExchangeRateToolUseCase {
private final RestClient restClient;
@@ -39,11 +33,6 @@ public class ExchangeRateToolUseCaseImpl extends AbstractMcpToolUseCase implemen
}
@Override
@McpFunction(register = false, displayName = "실시간 환율 조회 툴", name = "exchange_rate",
description = "원하는 통화의 실시간 환율을 조회합니다. (예: USD, EUR, JPY)",
prompt = "현재 달러 환율 알려줘, 엔화 환율은?",
mappingId = "EXCHANGE_001"
)
public ExchangeRateResponse execute(ExchangeRateRequest req) {
String targetCurrency = req.currencyCode() != null ? req.currencyCode().toUpperCase().trim() : "USD";

View File

@@ -2,8 +2,6 @@ package io.shinhanlife.dap.mcc.biz.smp.usecase.impl;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.mcc.biz.smp.usecase.WeatherToolUseCase;
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
import io.shinhanlife.dap.mcc.biz.smp.dto.WeatherRequest;
@@ -31,10 +29,6 @@ import java.time.format.DateTimeFormatter;
*/
@Slf4j
@Service
@McpTool(
routingType = "DIRECT",
categoryKey = "smp"
)
public class WeatherToolUseCaseImpl extends AbstractMcpToolUseCase implements WeatherToolUseCase {
private final RestClient restClient;
@@ -42,12 +36,6 @@ public class WeatherToolUseCaseImpl extends AbstractMcpToolUseCase implements We
public WeatherToolUseCaseImpl() {
this.restClient = RestClient.create();
}
@McpFunction(register = false, displayName = "날씨 조회 툴", name = "weather",
description = "특정 도시의 현재 날씨, 온도, 풍속 정보를 조회합니다.",
prompt = "서울 날씨 알려줘, 부산 기온 알려줘 등 실시간 기상 조회",
mappingId = "WEATHER_001"
)
public WeatherResponse execute(WeatherRequest req) {
String city = req.city() != null ? req.city().trim() : "서울";

View File

@@ -1,7 +1,10 @@
package io.shinhanlife.dap.mcc.biz.sms.usecase;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.mcc.biz.sms.dto.*;
@McpTool(routingType = "EAI", categoryKey = "notification")
public interface SmsToolUseCase {
Object sendSms(SmsSendRequest req);
}

View File

@@ -1,9 +1,8 @@
package io.shinhanlife.dap.mcc.biz.sms.usecase.impl;
import io.shinhanlife.dap.lib.annotation.McpFunction;
import io.shinhanlife.dap.lib.annotation.McpTool;
import io.shinhanlife.dap.mcc.biz.sms.usecase.SmsToolUseCase;
import io.shinhanlife.dap.mcc.usecase.AbstractMcpToolUseCase;
import org.springframework.stereotype.Service;
import io.shinhanlife.dap.mcc.biz.sms.converter.SmsLegacyConverter;
import io.shinhanlife.dap.mcc.biz.sms.dto.SmsSendRequest;
import io.shinhanlife.dap.mcc.biz.sms.legacy.SmsLegacyRequest;
@@ -28,12 +27,12 @@ import java.util.Map;
*/
@Slf4j
@RequiredArgsConstructor
@McpTool(routingType = "EAI", categoryKey = "notification")
@Service
public class SmsToolUseCaseImpl extends AbstractMcpToolUseCase implements SmsToolUseCase {
private final SmsLegacyConverter converter;
@McpFunction(register = false, displayName = "send_sms 툴", name = "send_sms", description = "SMS 발송", prompt = "고객에게 SMS 메시지를 발송해줘.", mappingId = "SMS_SEND_001")
@Override
public Object sendSms(SmsSendRequest req) {
log.info("[SMS] SMS 발송 요청 수신. 수신자: {}", req.getPhoneNumber());