Auto-log episode entries on MCP memory_store (default true)
MCP store was missing the --episode behavior that the CLI had, so episodes stopped being logged when sessions switched to using MCP tools. Now defaults to true with opt-out via episode=false. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
aed98a3cc8
commit
09429eec3a
@ -52,6 +52,10 @@ def create_tools() -> list:
|
||||
"type": "number",
|
||||
"description": "Importance score from 0.0 to 1.0 (default 0.5)",
|
||||
},
|
||||
"episode": {
|
||||
"type": "boolean",
|
||||
"description": "Also log an episode entry for this memory (default true)",
|
||||
},
|
||||
},
|
||||
"required": ["type", "title", "content"],
|
||||
},
|
||||
@ -408,14 +412,32 @@ def handle_tool_call(
|
||||
|
||||
try:
|
||||
if tool_name == "memory_store":
|
||||
mem_type = arguments["type"]
|
||||
title = arguments["title"]
|
||||
tags = arguments.get("tags")
|
||||
memory_id = client.store(
|
||||
type=arguments["type"],
|
||||
title=arguments["title"],
|
||||
type=mem_type,
|
||||
title=title,
|
||||
content=arguments["content"],
|
||||
tags=arguments.get("tags"),
|
||||
tags=tags,
|
||||
importance=arguments.get("importance", 0.5),
|
||||
)
|
||||
return ok({"success": True, "memory_id": memory_id})
|
||||
# Auto-log episode entry (default true, opt-out with episode=false)
|
||||
episode_logged = False
|
||||
if arguments.get("episode", True):
|
||||
client.episode(
|
||||
type=mem_type,
|
||||
title=title,
|
||||
tags=tags,
|
||||
)
|
||||
episode_logged = True
|
||||
return ok(
|
||||
{
|
||||
"success": True,
|
||||
"memory_id": memory_id,
|
||||
"episode_logged": episode_logged,
|
||||
}
|
||||
)
|
||||
|
||||
elif tool_name == "memory_recall":
|
||||
results = client.recall(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user