save_conversation
Save conversation history to enable sharing between ChatGPT and Claude with secure multi-user support. Store messages, metadata, and manage conversations across AI platforms.
Instructions
대화 내역을 저장합니다
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| conversation_id | No | 대화 ID (없으면 자동 생성) | |
| messages | Yes | 저장할 메시지 목록 | |
| metadata | No | 대화에 대한 추가 메타데이터 (제목, 태그 등) |
Implementation Reference
- mcp_server/server.py:30-48 (handler)The core logic implementation of the save_conversation tool which saves the conversation to a JSON file and cache.
def save_conversation(conversation_id: str, messages: List[Dict[str, Any]], metadata: Optional[Dict[str, Any]] = None) -> Dict[str, Any]: """대화를 파일 시스템에 저장""" conversation_data = { "id": conversation_id, "messages": messages, "metadata": metadata or {}, "created_at": datetime.now().isoformat(), "updated_at": datetime.now().isoformat() } # 파일로 저장 file_path = STORAGE_DIR / f"{conversation_id}.json" with open(file_path, 'w', encoding='utf-8') as f: json.dump(conversation_data, f, ensure_ascii=False, indent=2) # 캐시에도 저장 conversation_cache[conversation_id] = conversation_data return conversation_data - mcp_server/server.py:139-155 (registration)MCP tool registration for save_conversation in the list_tools method.
Tool( name="save_conversation", description="대화 내역을 저장합니다", inputSchema={ "type": "object", "properties": { "conversation_id": { "type": "string", "description": "대화 ID (없으면 자동 생성)" }, "messages": { "type": "array", "description": "저장할 메시지 목록", "items": { "type": "object", "properties": { "role": {"type": "string", "enum": ["user", "assistant", "system"]},