get_network_stats
Retrieve aggregate statistics from the Minuet relationship graph, including total relationships, agents, named agents, verification status, and top relationship types.
Instructions
Return aggregate statistics about the Minuet relationship graph.
Returns totals for relationships, agents, named agents, verified vs inferred status, and the top relationship types.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/minuet_mcp/server.py:131-153 (handler)The actual tool handler: decorated with @mcp.tool(), fetches clusters and relationships from the Minuet API, computes status and relationship_type counters, merges with cluster stats, and returns the aggregate dictionary.
@mcp.tool() async def get_network_stats() -> dict[str, Any]: """Return aggregate statistics about the Minuet relationship graph. Returns totals for relationships, agents, named agents, verified vs inferred status, and the top relationship types. """ from collections import Counter async with MinuetClient() as client: clusters = await client.get_clusters() rels = await client.list_relationships() relationships = rels.get("relationships", []) status_counts: Counter[str] = Counter(r.get("status", "") for r in relationships) type_counts: Counter[str] = Counter( r.get("relationship_type", "") for r in relationships ) stats = dict(clusters.get("stats", {})) stats["by_status"] = dict(status_counts) stats["by_relationship_type"] = dict(type_counts) return stats - src/minuet_mcp/server.py:131-131 (registration)Registration via the @mcp.tool() decorator on the get_network_stats function.
@mcp.tool() - src/minuet_mcp/client.py:99-103 (helper)Helper API methods list_relationships() and get_clusters() used inside the handler to fetch data from the Minuet API.
async def list_relationships(self) -> dict[str, Any]: return await self._get("/api/relationships") async def get_clusters(self) -> dict[str, Any]: return await self._get("/api/relationships/clusters") - tests/test_smoke.py:26-26 (registration)Test verifying get_network_stats is registered among expected tool names.
"get_network_stats", - tests/test_stdio_protocol.py:90-90 (registration)Test expected tools set including get_network_stats for STDIO protocol test.
"get_network_stats",