get_recent_relationships
Retrieve the most recently created relationships from the Minuet relationship graph. Specify a limit to control how many 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:157-167 (handler)The handler function for the 'get_recent_relationships' MCP tool. It calls the MinuetClient.list_relationships() API, sorts the results by 'created_at' descending, and returns up to `limit` relationships.
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:157-157 (schema)The input schema is defined via the function signature (limit: int = 20), which FastMCP converts to a JSON Schema automatically. The return type is dict[str, Any].
async def get_recent_relationships(limit: int = 20) -> dict[str, Any]: - src/minuet_mcp/server.py:156-156 (registration)The tool is registered via the @mcp.tool() decorator on the async function. `mcp` is a FastMCP instance defined on line 16 as FastMCP("minuet-mcp").
@mcp.tool() - src/minuet_mcp/client.py:99-100 (helper)The helper method list_relationships() on the MinuetClient class, which is called by the handler. It makes a GET request to /api/relationships on the Minuet API.
async def list_relationships(self) -> dict[str, Any]: return await self._get("/api/relationships")