chronica_summarize
Generate structured summaries from memory data using time ranges and thread types to organize information for review.
Instructions
サマリーパックを生成します(Summary Pack v0.1.2)。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | モード | |
| range_start | Yes | 範囲開始時刻(ISO文字列、JST) | |
| range_end | Yes | 範囲終了時刻(ISO文字列、JST) | |
| thread_type | Yes | スレッドタイプ |
Implementation Reference
- src/chronica/tools.py:457-490 (handler)The handler logic for 'chronica_summarize' which validates arguments and calls the 'summarize' helper.
elif name == "chronica_summarize": mode = arguments.get("mode") range_start = arguments.get("range_start") range_end = arguments.get("range_end") thread_type = arguments.get("thread_type") if not all([mode, range_start, range_end, thread_type]): return [types.TextContent( type="text", text=json.dumps({"error": "invalid_range", "message": "mode, range_start, range_end, and thread_type are required"}, ensure_ascii=False) )] if mode not in ["daily", "weekly", "decision"]: return [types.TextContent( type="text", text=json.dumps({"error": "invalid_range", "message": f"mode must be 'daily', 'weekly', or 'decision', got: {mode}"}, 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) )] summary_pack = summarize( mode=mode, range_start=range_start, range_end=range_end, thread_type=thread_type, store=store ) return [types.TextContent( type="text", text=json.dumps(summary_pack, ensure_ascii=False, indent=2) - src/chronica/tools.py:228-250 (schema)MCP tool definition and input schema for 'chronica_summarize'.
types.Tool( name="chronica_summarize", description="サマリーパックを生成します(Summary Pack v0.1.2)。", inputSchema={ "type": "object", "properties": { "mode": { "type": "string", "enum": ["daily", "weekly", "decision"], "description": "モード" }, "range_start": { "type": "string", "description": "範囲開始時刻(ISO文字列、JST)" }, "range_end": { "type": "string", "description": "範囲終了時刻(ISO文字列、JST)" }, "thread_type": { "type": "string", "enum": ["normal", "project"], "description": "スレッドタイプ" - src/chronica/summarize.py:8-40 (helper)The actual implementation logic for 'summarize'.
def summarize( mode: str, range_start: str, range_end: str, thread_type: str, store: Store ) -> Dict[str, Any]: """サマリーパックを生成""" entries = store.timeline( start_time=range_start, end_time=range_end, thread_type=thread_type ) stats = { "total_entries": len(entries), "by_kind": {} } for entry in entries: kind = entry.get("kind", "unknown") stats["by_kind"][kind] = stats["by_kind"].get(kind, 0) + 1 timeline_items = [] for entry in entries: item = { "entry_id": entry["entry_id"], "saved_time": entry["saved_time"], "kind": entry["kind"], "title": entry.get("title"), "text": entry.get("text", "")[:200] } if "event_time" in entry: item["event_time"] = entry["event_time"]