MemOS icon indicating copy to clipboard operation
MemOS copied to clipboard

fix: 官方MCP服务器中memos-mcp-search_memory工具 filter 为空则调用失败

Open franvz9 opened this issue 6 months ago • 0 comments

Pre-submission checklist | 提交前检查

  • [x] I have searched existing issues and this hasn't been mentioned before | 我已搜索现有问题,确认此问题尚未被提及
  • [x] I have read the project documentation and confirmed this issue doesn't already exist | 我已阅读项目文档并确认此问题尚未存在
  • [x] This issue is specific to MemOS and not a general software issue | 该问题是针对 MemOS 的,而不是一般软件问题

Bug Description | 问题描述

官方MCP服务器中memos-mcp-search_memory工具 filter 为空则调用失败

{ "params": { "query": "ICH 分析进展 NGNBL OLG IFN composition", "filter": {}, "knowledgebase_ids": [], "include_preference": true, "preference_limit_number": 5, "include_tool_memory": false, "tool_memory_limit_number": 3, "include_skill": false, "skill_limit_number": 3, "relativity": 0, "conversation_first_message": "结合知识库和mcphub中的memos记忆,我们的ICH分析进行到哪里了", "memory_limit_number": 5 }, "response": { "content": [ { "type": "text", "text": "Error: HTTP 400 Bad Request: {"code":40000,"data":null,"message":"Invalid request parameters: filter object cannot be empty"}" } ], "isError": true } }

在官方 MCP 服务器中,memos-mcp-search_memory 工具在普通对话模式下会固定传入 filter: {}。
而后端接口不接受空对象 filter,返回:

Invalid request parameters: filter object cannot be empty

这导致 search_memory 在对话模式下无法正常使用。

已确认:

  • 在 agent 模式下,如果请求中省略 filter 字段,则可以正常调用;
  • 在普通对话模式下,因只能使用完整封装工具,请求会包含 filter: {},从而稳定触发 400。

因此怀疑问题出在 MCP 工具封装层或参数序列化层,而不是 search_memory 后端接口本身。

How to Reproduce | 如何重现

1)在cherry studio中添加memos mcp服务器 2)在助手对话模式,启用这个mcp服务器 3)调用memos-mcp-search_memory 搜索记忆 4)filter 为空,则报错

Image

Environment | 环境信息

  • macOS 15
  • cherry studio 5.19
  • 对话模式

Additional Context | 其他信息

No response

Willingness to Implement | 实现意愿

  • [ ] I'm willing to implement this myself | 我愿意自己解决
  • [ ] I would like someone else to implement this | 我希望其他人来解决

franvz9 avatar May 13 '26 02:05 franvz9