Skip to main content
Glama

chronica_get_last_seen

Retrieve the last seen timestamp for specified thread types to maintain context across sessions in persistent memory systems.

Instructions

指定されたスレッドタイプで最後に見た時刻を取得します。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thread_typeYesスレッドタイプ(必須)

Implementation Reference

  • The tool handler for "chronica_get_last_seen" which retrieves the last seen time for a given thread_type from the store.
    elif name == "chronica_get_last_seen":
        thread_type = arguments.get("thread_type")
        if not thread_type:
            return [types.TextContent(
                type="text",
                text=json.dumps({"error": "invalid_thread", "message": "thread_type is required"}, ensure_ascii=False)
            )]
        
        if thread_type not in ["normal", "project"]:
            return [types.TextContent(
                type="text",
                text=json.dumps({"error": "invalid_thread", "message": f"thread_type must be 'normal' or 'project', got: {thread_type}"}, ensure_ascii=False)
            )]
        
        last_seen_time = store.get_last_seen(thread_type)
        result = {"last_seen_time": last_seen_time} if last_seen_time else {"last_seen_time": None}
        return [types.TextContent(
            type="text",
            text=json.dumps(result, ensure_ascii=False)
        )]
  • The helper method that executes the SQLite query to retrieve the last seen timestamp for a specific thread_type.
    def get_last_seen(self, thread_type: str) -> Optional[str]:
        """最後に見た時刻を取得"""
        conn = sqlite3.connect(str(self.db_path))
        cursor = conn.cursor()
        
        cursor.execute("""
            SELECT saved_time FROM entries
            WHERE thread_type = ?
            ORDER BY saved_time DESC
            LIMIT 1
        """, (thread_type,))
        
        row = cursor.fetchone()
        conn.close()
        return row[0] if row else None
  • Tool registration for "chronica_get_last_seen" in the tool list definition.
        name="chronica_get_last_seen",
        description="指定されたスレッドタイプで最後に見た時刻を取得します。",
        inputSchema={
            "type": "object",
            "properties": {
                "thread_type": {
                    "type": "string",
                    "enum": ["normal", "project"],
                    "description": "スレッドタイプ(必須)"
                }
            },
            "required": ["thread_type"]
        }
    ),

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/Nic9dev/Chronica'

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