Skip to content

Commit f354acf

Browse files
brentkearneyclaudeCaralHsi
authored
fix: send messages in chat format in MCP add_memory tool (#1275)
The /product/add endpoint expects messages as a list of chat message objects, not a plain string. When passed a string, the SimpleStruct MemReader silently skips it and no memory is stored. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: CaralHsi <caralhsi@gmail.com>
1 parent 83ea72e commit f354acf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

examples/mem_mcp/simple_fastmcp_serve.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def add_memory(memory_content: str, user_id: str, cube_id: str | None = None):
2323
"""Add memory using the Server API."""
2424
payload = {
2525
"user_id": user_id,
26-
"messages": memory_content,
26+
"messages": [{"role": "user", "content": memory_content}],
2727
"writable_cube_ids": [cube_id] if cube_id else None,
2828
}
2929
try:

0 commit comments

Comments
 (0)