chronica_save_entry
Save entries like memories, decisions, tasks, or events to persistent structured memory for time-aware context across sessions.
Instructions
エントリ(記憶・記録)を保存します。
【使用タイミング】
ユーザーが新しい情報を提供したとき
重要な決定事項があったとき
タスクや未決事項が発生したとき
出来事や質問があったとき
【保存すべきタイミング】
「覚えておいて」「忘れないで」「記録して」などの発言
「今日〇〇をした」「〇〇に決めた」「〇〇をやる予定」
新しい事実・決定・予定・気づき・感情が含まれる発言
迷ったら保存する。保存しすぎるほうが保存漏れより良い。
「保存しました」等の報告は不要。会話を自然に続ける。
【Claude向けの注意】
ユーザーに「保存しました」等の確認は不要
自然に会話を続ける
メタ発言(「Chronicaに保存します」等)は避ける
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entry | Yes | Entry JSON(thread, kind, text, tags は必須) |
Implementation Reference
- src/chronica/tools.py:314-376 (handler)The handler implementation for `chronica_save_entry` within `call_tool`. It validates input, prepares the entry object, and calls `store.save_entry`.
if name == "chronica_save_entry": entry = arguments.get("entry", {}) # バリデーション if not entry: return [types.TextContent( type="text", text=json.dumps({"error": "internal_error", "message": "entry is required"}, ensure_ascii=False) )] # 必須フィールドのチェック if "kind" not in entry or not entry.get("kind"): return [types.TextContent( type="text", text=json.dumps({"error": "validation_error", "message": "entry.kind is required"}, ensure_ascii=False) )] if "text" not in entry or not entry.get("text"): return [types.TextContent( type="text", text=json.dumps({"error": "validation_error", "message": "entry.text is required"}, ensure_ascii=False) )] # threadの処理 thread = entry.get("thread", {}) if not isinstance(thread, dict): # threadが文字列の場合は、それをtypeとして使用 if isinstance(thread, str): thread_type_str = thread thread = {"type": thread_type_str if thread_type_str in ["normal", "project"] else "normal"} else: thread = {"type": "normal"} entry["thread"] = thread thread_type = thread.get("type", "normal") if thread_type not in ["normal", "project"]: thread_type = "normal" thread["type"] = thread_type # tagsの処理(リストでない場合は空リストに) if "tags" not in entry: entry["tags"] = [] elif not isinstance(entry["tags"], list): entry["tags"] = [] if "event_time" in entry and isinstance(entry["event_time"], dict): event_time_raw = entry["event_time"].get("raw") if event_time_raw: anchor_time = entry.get("saved_time") parsed = parse_event_time(event_time_raw, anchor_time) entry["event_time"] = parsed try: entry_id = store.save_entry(entry) return [types.TextContent( type="text", text=json.dumps({"entry_id": entry_id}, ensure_ascii=False) )] except Exception as e: return [types.TextContent( type="text", text=json.dumps({"error": "save_error", "message": str(e)}, ensure_ascii=False) )] - src/chronica/tools.py:20-53 (schema)The MCP tool definition and schema for `chronica_save_entry` in `register_tools`.
types.Tool( name="chronica_save_entry", description=""" エントリ(記憶・記録)を保存します。 【使用タイミング】 - ユーザーが新しい情報を提供したとき - 重要な決定事項があったとき - タスクや未決事項が発生したとき - 出来事や質問があったとき 【保存すべきタイミング】 - 「覚えておいて」「忘れないで」「記録して」などの発言 - 「今日〇〇をした」「〇〇に決めた」「〇〇をやる予定」 - 新しい事実・決定・予定・気づき・感情が含まれる発言 - 迷ったら保存する。保存しすぎるほうが保存漏れより良い。 - 「保存しました」等の報告は不要。会話を自然に続ける。 【Claude向けの注意】 - ユーザーに「保存しました」等の確認は不要 - 自然に会話を続ける - メタ発言(「Chronicaに保存します」等)は避ける """, inputSchema={ "type": "object", "properties": { "entry": { "type": "object", "description": "Entry JSON(thread, kind, text, tags は必須)" } }, "required": ["entry"] } ),