get-user-virtual-time MCP Tool
개요
get-user-virtual-time MCP Tool은 특정 사용자의 가상 시간을 조회하는 도구입니다. TimeMachine 기능이 활성화된 사용자의 경우 가상 시간을, 비활성화된 사용자의 경우 실제 시간을 조회할 수 있습니다.
이 문서에서는 다음 사용 방법을 다룹니다:
- JSON 형식: 구조화된 데이터로 정확한 제어가 필요한 경우
- LLM AI Chat: 자연어로 간편하게 사용하고 싶은 경우
두 방법 모두 같은 결과를 제공하며, 사용자의 선호도와 상황에 따라 선택할 수 있습니다.
도구 정보
- 이름:
get_user_virtual_time - 설명: 특정 사용자의 가상 시간 조회 (TimeMachine 기능)
- 카테고리: 시간 관리 도구
파라미터
필수 파라미터
| 파라미터 | 타입 | 설명 | 예시 |
|---|---|---|---|
userId | string | 대상 사용자 ID (UUID 형식) | "3a5822e5-595e-4bd5-b06a-f46104a34bd5" |
LLM AI Chat에서의 사용법
LLM AI Chat에서는 자연어로 사용자의 가상 시간을 조회할 수 있습니다.
기본 시간 조회
사용자 3a5822e5-595e-4bd5-b06a-f46104a34bd5의 현재 시간을 알려주세요.
또는
이 사용자의 가상 시간을 확인해주세요: 3a5822e5-595e-4bd5-b06a-f46104a34bd5
TimeMachine 상태 확인
사용자 3a5822e5-595e-4bd5-b06a-f46104a34bd5의 TimeMachine이 활성화되어 있는지 확인해주세요.
치료 일차 확인
사용자가 현재 치료 몇 일차인지 알려주세요.
사용자 ID: 3a5822e5-595e-4bd5-b06a-f46104a34bd5
자연어 응답 예시
요청: "사용자 3a5822e5-595e-4bd5-b06a-f46104a34bd5의 현재 시간을 알려주세요."
TimeMachine 활성화된 경우:
Time information for user 3a5822e5-595e-4bd5-b06a-f46104a34bd5:
=== Virtual Time (TimeMachine Active) ===
User is currently using virtual time controlled by TimeMachine
📅 Current Time: 2025-01-15T23:00:00.000Z
🌍 Local Time: 2025-01-16 0:00:00
📊 Day Index: 10
🌍 Time Zone: Europe/Berlin
⚙️ TimeMachine Active: ✅ Yes
📝 Last Changed: 2025-01-08T10:25:30.123Z by 00000000-0000-0000-0000-000000000000
💡 Note: This user is using virtual time. Time may be different from real-world time.
TimeMachine 비활성화된 경우:
Time information for user 3a5822e5-595e-4bd5-b06a-f46104a34bd5:
=== Real Time (TimeMachine Inactive) ===
User is using real-world time (TimeMachine feature is disabled)
📅 Current Time: 2025-01-08T10:30:00.000Z
🌍 Local Time: 2025-01-08 19:30:00
📊 Day Index: 1
🌍 Time Zone: Europe/Berlin
⚙️ TimeMachine Active: ❌ No
📝 Using real-world time
💡 Note: This user has disabled TimeMachine and is using real-world time.
사용 예시 (JSON 형식)
기본 사용자 시간 조회
{
"tool": "get_user_virtual_time",
"arguments": {
"userId": "3a5822e5-595e-4bd5-b06a-f46104a34bd5"
}
}
응답 형식
성공 응답 (TimeMachine 활성화)
{
"content": [
{
"type": "text",
"text": "Time information for user 3a5822e5-595e-4bd5-b06a-f46104a34bd5:\n\n=== Virtual Time (TimeMachine Active) ===\nUser is currently using virtual time controlled by TimeMachine\n\n📅 Current Time: 2025-01-15T23:00:00.000Z\n🌍 Local Time: 2025-01-16 0:00:00\n📊 Day Index: 10\n🌍 Time Zone: Europe/Berlin\n⚙️ TimeMachine Active: ✅ Yes\n📝 Last Changed: 2025-01-08T10:25:30.123Z by 00000000-0000-0000-0000-000000000000\n\n💡 Note: This user is using virtual time. Time may be different from real-world time."
}
]
}
성공 응답 (TimeMachine 비활성화)
{
"content": [
{
"type": "text",
"text": "Time information for user 3a5822e5-595e-4bd5-b06a-f46104a34bd5:\n\n=== Real Time (TimeMachine Inactive) ===\nUser is using real-world time (TimeMachine feature is disabled)\n\n📅 Current Time: 2025-01-08T10:30:00.000Z\n🌍 Local Time: 2025-01-08 19:30:00\n📊 Day Index: 1\n🌍 Time Zone: Europe/Berlin\n⚙️ TimeMachine Active: ❌ No\n📝 Using real-world time\n\n💡 Note: This user has disabled TimeMachine and is using real-world time."
}
]
}
에러 응답
{
"content": [
{
"type": "text",
"text": "❌ Error getting user virtual time: User not found or user has no time information"
}
],
"isError": true
}
사용 시나리오
시나리오 1: 사용자 시간 상태 확인
LLM AI Chat:
테스트 사용자의 현재 시간 상태를 확인해주세요.
사용자 ID: 3a5822e5-595e-4bd5-b06a-f46104a34bd5
JSON 형식:
{
"tool": "get_user_virtual_time",
"arguments": {
"userId": "3a5822e5-595e-4bd5-b06a-f46104a34bd5"
}
}
시나리오 2: 시간 변경 후 확인
LLM AI Chat:
사용자의 시간을 변경한 후 정상적으로 반영되었는지 확인해주세요.
사용자 ID: 3a5822e5-595e-4bd5-b06a-f46104a34bd5
JSON 형식 (순차 실행):
// 1단계: 시간 변경
{
"tool": "change_user_day_index",
"arguments": {
"userId": "3a5822e5-595e-4bd5-b06a-f46104a34bd5",
"dayIndex": 15,
"reason": "테스트 후 확인"
}
}
// 2단계: 변경된 시간 확인
{
"tool": "get_user_virtual_time",
"arguments": {
"userId": "3a5822e5-595e-4bd5-b06a-f46104a34bd5"
}
}
시나리오 3: 여러 사용자 시간 비교
LLM AI Chat:
다음 사용자들의 현재 시간을 비교해주세요:
- 사용자 A: 3a5822e5-595e-4bd5-b06a-f46104a34bd5
- 사용자 B: 4b6933f6-6a6f-5ce6-c17b-g57215b45ce6
JSON 형식 (병렬 실행):
// 사용자 A 시간 조회
{
"tool": "get_user_virtual_time",
"arguments": {
"userId": "3a5822e5-595e-4bd5-b06a-f46104a34bd5"
}
}
// 사용자 B 시간 조회
{
"tool": "get_user_virtual_time",
"arguments": {
"userId": "4b6933f6-6a6f-5ce6-c17b-g57215b45ce6"
}
}
시나리오 4: 치료 진행도 확인
LLM AI Chat:
사용자가 현재 치료 몇 일차인지 확인하고, 관련 설문 데이터도 함께 조회해주세요.
사용자 ID: 3a5822e5-595e-4bd5-b06a-f46104a34bd5
JSON 형식 (순차 실행):
// 1단계: 사용자 시간 확인
{
"tool": "get_user_virtual_time",
"arguments": {
"userId": "3a5822e5-595e-4bd5-b06a-f46104a34bd5"
}
}
// 2단계: 설문 데이터 조회
{
"tool": "questionnaire_data_query",
"arguments": {
"userId": "3a5822e5-595e-4bd5-b06a-f46104a34bd5",
"includeDetails": true
}
}
응답 데이터 해석
주요 정보
| 항목 | 설명 |
|---|---|
| Current Time | 사용자의 현재 시간 (UTC) |
| Local Time | 사용자의 로컬 시간 (타임존 적용) |
| Day Index | 치료 일차 (1부터 시작) |
| Time Zone | 사용자의 타임존 |
| TimeMachine Active | TimeMachine 활성화 여부 |
| Last Changed | 마지막 변경 시각 및 변경자 |
TimeMachine 상태별 의미
TimeMachine 활성화 (Virtual Time)
- 사용자가 가상 시간을 사용 중
- 실제 시간과 다를 수 있음
- 테스트나 시나리오 검증 목적
- 변경 이력 추적 가능
TimeMachine 비활성화 (Real Time)
- 사용자가 실제 시간을 사용 중
- 일반적인 앱 사용 상태
- 변경 이력 없음
문제 해결
일반적인 오류
- 사용자 없음: 존재하지 않는 사용자 ID
- 시간 정보 없음: 사용자에게 시간 정보가 설정되지 않음
- 권한 부족: 사용자 시간 정보 접근 권한 없음
- 인증 실패: Service Account 토큰 문제
에러 유형별 대응
404 에러 (사용자 없음)
{
"content": [
{
"type": "text",
"text": "❌ Error getting user virtual time: User not found or user has no time information"
}
],
"isError": true
}
403 에러 (권한 부족)
{
"content": [
{
"type": "text",
"text": "❌ Error getting user virtual time: Insufficient permissions to access user time information"
}
],
"isError": true
}
디버깅 팁
- 사용자 ID 확인: UUID 형식이 올바른지 확인
- 권한 검증: 해당 사용자의 정보를 조회할 권한이 있는지 확인
- 사용자 등록 상태: 사용자가 정상적으로 등록되었는지 확인
- TimeMachine 설정: 사용자에게 TimeMachine 설정이 있는지 확인
활용 사례
1. 시간 변경 검증
// 시간 변경 전 상태 확인
const beforeChange = await mcpTool.execute({
tool: "get_user_virtual_time",
arguments: { userId: "user-id" }
});
// 시간 변경 실행
await mcpTool.execute({
tool: "change_user_day_index",
arguments: { userId: "user-id", dayIndex: 10 }
});
// 시간 변경 후 상태 확인
const afterChange = await mcpTool.execute({
tool: "get_user_virtual_time",
arguments: { userId: "user-id" }
});
// 변경 결과 비교
console.log("Before:", beforeChange);
console.log("After:", afterChange);
2. 사용자 상태 모니터링
// 여러 사용자의 시간 상태 확인
const userIds = ["user-1", "user-2", "user-3"];
const timeStates = await Promise.all(
userIds.map(userId => mcpTool.execute({
tool: "get_user_virtual_time",
arguments: { userId }
}))
);
// TimeMachine 활성 사용자 필터링
const virtualTimeUsers = timeStates.filter(state =>
state.content[0].text.includes("TimeMachine Active: ✅ Yes")
);
3. 치료 진행도 추적
// 사용자의 치료 진행도 확인
const userTime = await mcpTool.execute({
tool: "get_user_virtual_time",
arguments: { userId: "user-id" }
});
// Day Index 추출
const dayIndexMatch = userTime.content[0].text.match(/Day Index: (\d+)/);
const currentDay = dayIndexMatch ? parseInt(dayIndexMatch[1]) : 1;
// 주간 설문 시점 확인
if (currentDay % 7 === 0) {
console.log("주간 설문 시점입니다.");
}
관련 도구
- change-user-day-index: 사용자 가상 시간 변경
- get-user-timemachine-status: TimeMachine 상태 조회
- enable-user-timemachine: TimeMachine 활성화
- disable-user-timemachine: TimeMachine 비활성화
- get-current-time: 현재 시간 조회