Skip to content

Commit 86d36ce

Browse files
committed
refactor: rename server/tools/admin.py to stats.py
only contained read-only reporting tools (, ), not actual admin operations. The name better reflects its read-only introspection purpose and disambiguates from 's tool.
1 parent 4c1bdd1 commit 86d36ce

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

.claude/CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ All server code lives under `server/`. The system has two main phases: **ingesti
5757
- `store/qdrant.py` runs hybrid search via Qdrant `FusionQuery(fusion=RRF)` — combines dense and BM25 sparse results
5858
using Reciprocal Rank Fusion
5959
- `store/commit_store.py` handles commit search (dense-only)
60-
- `tools/` contains the MCP tool implementations: `search.py`, `index.py`, `history.py`, `admin.py`
60+
- `tools/` contains the MCP tool implementations: `search.py`, `index.py`, `history.py`, `stats.py`
6161

6262
### MCP interface (`server/main.py`)
6363

server/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ async def combined(scope_app: Starlette) -> AsyncIterator[None]:
9292
def main() -> None:
9393
from server.tools.search import register_search_tools
9494
from server.tools.index import register_index_tools
95-
from server.tools.admin import register_admin_tools
95+
from server.tools.stats import register_stats_tools
9696
from server.tools.history import register_history_tools
9797
from server.prompts.service import register_service_prompts
9898
from server.prompts.system import register_system_prompts
9999
from server.routes.reindex import register_http_routes
100100

101101
register_search_tools(mcp)
102102
register_index_tools(mcp)
103-
register_admin_tools(mcp)
103+
register_stats_tools(mcp)
104104
register_history_tools(mcp)
105105
register_service_prompts(mcp)
106106
register_system_prompts(mcp)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
logger = logging.getLogger(__name__)
1212

1313

14-
def register_admin_tools(mcp: FastMCP) -> None:
14+
def register_stats_tools(mcp: FastMCP) -> None:
1515

1616
@mcp.tool()
1717
async def list_indexed_services() -> str:
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
from unittest.mock import AsyncMock, patch
44

55
from server.config import ServiceConfig
6-
from server.tools.admin import register_admin_tools
6+
from server.tools.stats import register_stats_tools
77
from tests.tools.conftest import get_tool
88

99

1010
def _tool(name: str):
11-
return get_tool(register_admin_tools, name)
11+
return get_tool(register_stats_tools, name)
1212

1313

1414
async def test_list_indexed_services_reports_when_empty() -> None:
1515
list_indexed_services = _tool("list_indexed_services")
1616
store = AsyncMock()
1717
store.get_service_stats.return_value = []
1818

19-
with patch("server.tools.admin.get_store", return_value=store):
19+
with patch("server.tools.stats.get_store", return_value=store):
2020
result = await list_indexed_services()
2121

2222
assert "No services indexed yet" in result
@@ -42,7 +42,7 @@ async def test_list_indexed_services_formats_stats_sorted_by_name() -> None:
4242
},
4343
]
4444

45-
with patch("server.tools.admin.get_store", return_value=store):
45+
with patch("server.tools.stats.get_store", return_value=store):
4646
result = await list_indexed_services()
4747

4848
assert result.index("alpha") < result.index("zebra")
@@ -55,8 +55,8 @@ async def test_index_stats_reports_qdrant_error() -> None:
5555
store.collection_info.side_effect = RuntimeError("connection refused")
5656

5757
with (
58-
patch("server.tools.admin.get_store", return_value=store),
59-
patch("server.tools.admin.settings") as mock_settings,
58+
patch("server.tools.stats.get_store", return_value=store),
59+
patch("server.tools.stats.settings") as mock_settings,
6060
):
6161
mock_settings.load_services.return_value = []
6262
result = await index_stats()
@@ -77,8 +77,8 @@ async def test_index_stats_includes_provider_endpoint() -> None:
7777
svc = ServiceConfig(name="orders", github_repo="org/orders", exclude=[])
7878

7979
with (
80-
patch("server.tools.admin.get_store", return_value=store),
81-
patch("server.tools.admin.settings") as mock_settings,
80+
patch("server.tools.stats.get_store", return_value=store),
81+
patch("server.tools.stats.settings") as mock_settings,
8282
):
8383
mock_settings.load_services.return_value = [svc]
8484
mock_settings.embeddings_provider = "voyage"

0 commit comments

Comments
 (0)