get_recent_relationships
Retrieve a list of the most recently created agent relationships from the ERC-8004 graph. Specify a limit to control how many results are returned.
Instructions
Return the most recently created relationships.
Args: limit: Maximum number of relationships to return (default 20).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/minuet_mcp/server.py:156-167 (handler)The actual tool handler function. Decorated with @mcp.tool(), it calls MinuetClient.list_relationships(), sorts by created_at descending, and returns up to `limit` relationships.
@mcp.tool() async def get_recent_relationships(limit: int = 20) -> dict[str, Any]: """Return the most recently created relationships. Args: limit: Maximum number of relationships to return (default 20). """ async with MinuetClient() as client: data = await client.list_relationships() relationships = data.get("relationships", []) relationships.sort(key=lambda r: r.get("created_at") or "", reverse=True) return {"count": min(limit, len(relationships)), "relationships": relationships[:limit]} - src/minuet_mcp/server.py:156-156 (registration)The @mcp.tool() decorator registers the function as an MCP tool named 'get_recent_relationships' (derived from the function name).
@mcp.tool() - src/minuet_mcp/client.py:98-100 (helper)MinuetClient.list_relationships() — the underlying API call that fetches all relationships from /api/relationships, used by the handler.
async def list_relationships(self) -> dict[str, Any]: return await self._get("/api/relationships") - src/minuet_mcp/server.py:157-161 (schema)Input schema: the function signature defines `limit: int = 20` as the only input parameter. Output is typed as dict[str, Any] returning count and relationships list.
async def get_recent_relationships(limit: int = 20) -> dict[str, Any]: """Return the most recently created relationships. Args: limit: Maximum number of relationships to return (default 20). - tests/test_smoke.py:27-28 (registration)Test verification that 'get_recent_relationships' is listed among the expected tool names in a smoke test.
"get_recent_relationships", }