Skip to content

Fix: Serialize response to JSON in add_memories MCP tool#3523

Merged
prateekchhikara merged 1 commit intomem0ai:mainfrom
frederikb96:fix-mcp-add-memories-json-return
Sep 30, 2025
Merged

Fix: Serialize response to JSON in add_memories MCP tool#3523
prateekchhikara merged 1 commit intomem0ai:mainfrom
frederikb96:fix-mcp-add-memories-json-return

Conversation

@frederikb96
Copy link
Copy Markdown
Contributor

The add_memories tool was returning a raw dict instead of a JSON string, causing MCP clients to fail with -32602 error. This aligns the return format with search_memory and list_memories which use json.dumps().

Fixes #3400

Super easy oneliner change...

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

The add_memories tool was returning a raw dict instead of a JSON string,
causing MCP clients to fail with -32602 error. This aligns the return
format with search_memory and list_memories which use json.dumps().

Fixes mem0ai#3400
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Sep 30, 2025

CLA assistant check
All committers have signed the CLA.

@parshvadaftari
Copy link
Copy Markdown
Contributor

Hey @frederikb96 Thanks for raising the PR, can you please sign the CLA inorder to get things started?

@frederikb96
Copy link
Copy Markdown
Contributor Author

@parshvadaftari Thanks for super fast response 👍 I signed it 🙂

Copy link
Copy Markdown
Contributor

@parshvadaftari parshvadaftari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@prateekchhikara prateekchhikara merged commit cbf5647 into mem0ai:main Sep 30, 2025
1 of 2 checks passed
garciaba79 pushed a commit to garciaba79/mem0 that referenced this pull request Feb 12, 2026
jamebobob pushed a commit to jamebobob/mem0-vigil-recall that referenced this pull request Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenMemory MCP not working with Claude Desktop or Claude Code

4 participants