get_network_stats
Retrieve aggregate statistics from the Minuet relationship graph, including totals for relationships, agents, 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)Handler function for get_network_stats tool. Fetches clusters and relationships from the Minuet API, computes aggregate statistics (status counts, relationship type counts), and merges them with cluster stats.
@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-132 (registration)Registration of get_network_stats as an MCP tool via the @mcp.tool() decorator on FastMCP instance.
@mcp.tool() async def get_network_stats() -> dict[str, Any]: - src/minuet_mcp/client.py:102-104 (helper)Helper method on MinuetClient that calls the /api/relationships/clusters endpoint used by get_network_stats.
async def get_clusters(self) -> dict[str, Any]: return await self._get("/api/relationships/clusters") - src/minuet_mcp/client.py:99-100 (helper)Helper method on MinuetClient that calls the /api/relationships endpoint used by get_network_stats.
async def list_relationships(self) -> dict[str, Any]: return await self._get("/api/relationships")