diff --git a/mcp_server/tools_ops.py b/mcp_server/tools_ops.py index 52a60c04..6ed97295 100644 --- a/mcp_server/tools_ops.py +++ b/mcp_server/tools_ops.py @@ -281,7 +281,7 @@ async def _delete_graph(): ).dict() -async def memory_search_rrf( +async def memory_search( query: str = "", user_id: str = "default", limit: int = 10, @@ -299,7 +299,7 @@ async def memory_search_rrf( sources: "all" (RAG + Wiki), "rag" (RAG only), or "wiki" (Wiki only) """ metrics.inc("tool_calls") - metrics.inc("tool_search_rrf") + metrics.inc("tool_search") app = _get_ctx(ctx) include_rag = sources in ("all", "rag") @@ -316,6 +316,10 @@ async def memory_search_rrf( return SearchResult(results=results, count=len(results), method=strategy).dict() +# Backward compatibility alias +memory_search_rrf = memory_search + + # Register all ops tools _register_tools: dict[str, Any] = { "memory_api_key": memory_api_key, @@ -325,7 +329,7 @@ async def memory_search_rrf( "memory_sync_replica": memory_sync_replica, "memory_cleanup": memory_cleanup, "memory_lucidity_purge": memory_lucidity_purge, - "memory_search_rrf": memory_search_rrf, + "memory_search": memory_search, } for _name, _func in _register_tools.items(): diff --git a/tests/test_auth_backup.py b/tests/test_auth_backup.py index 4b41a763..c2528688 100644 --- a/tests/test_auth_backup.py +++ b/tests/test_auth_backup.py @@ -242,7 +242,7 @@ def test_mcp_tools_are_async(): assert "memory_backup" in tool_names assert "memory_api_key" in tool_names assert "memory_lucidity_purge" in tool_names - assert "memory_search_rrf" in tool_names + assert "memory_search" in tool_names for tool in tools: assert inspect.iscoroutinefunction(tool.fn), f"{tool.name} is not async" diff --git a/tests/test_mcp/test_tools_ops_e2e.py b/tests/test_mcp/test_tools_ops_e2e.py index ea3910bc..fccafb78 100644 --- a/tests/test_mcp/test_tools_ops_e2e.py +++ b/tests/test_mcp/test_tools_ops_e2e.py @@ -3,14 +3,9 @@ import pytest from unittest.mock import MagicMock from mcp_server.tools_ops import ( - memory_api_key, - memory_backup, - memory_saga, - memory_data, - memory_sync_replica, - memory_cleanup, - memory_lucidity_purge, - memory_search_rrf, + memory_api_key, memory_backup, memory_saga, + memory_data, memory_sync_replica, memory_cleanup, + memory_lucidity_purge, memory_search, ) @@ -140,7 +135,7 @@ async def test_lucidity_purge(): @pytest.mark.asyncio -async def test_search_rrf(): +async def test_search(): ctx = _make_ctx() - result = await memory_search_rrf(query="test", ctx=ctx) + result = await memory_search(query="test", ctx=ctx) assert isinstance(result, dict)