Skip to main content
Glama
EmjayAhn

Pensieve MCP Server

by EmjayAhn

search_conversations

Search through conversation history to find specific discussions or topics across AI platforms. Enter keywords to retrieve relevant past conversations for reference or continuation.

Instructions

대화 내용을 검색합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes검색할 텍스트
limitNo최대 결과 수 (기본값: 20)

Implementation Reference

  • The handler implementation for search_conversations which scans JSON files in the storage directory for the query string.
    def search_conversations(query: str, limit: int = 20) -> List[Dict[str, Any]]:
        """대화 내용 검색"""
        results = []
        query_lower = query.lower()
        
        for file_path in STORAGE_DIR.glob("*.json"):
            try:
                with open(file_path, 'r', encoding='utf-8') as f:
                    data = json.load(f)
                    
                    # 메시지 내용에서 검색
                    for message in data.get("messages", []):
                        content = message.get("content", "").lower()
                        if query_lower in content:
                            results.append({
                                "id": data["id"],
                                "metadata": data.get("metadata", {}),
                                "created_at": data.get("created_at"),
                                "matched_message": message,
                                "message_count": len(data.get("messages", []))
                            })
                            break
  • MCP Tool registration for search_conversations, including its description and input schema.
    Tool(
        name="search_conversations",
        description="대화 내용을 검색합니다",
        inputSchema={
            "type": "object",
            "properties": {
                "query": {
                    "type": "string",
                    "description": "검색할 텍스트"
                },
                "limit": {
                    "type": "integer",
                    "description": "최대 결과 수 (기본값: 20)",

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/EmjayAhn/pensieve-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server