Skip to main content
Glama
minuetai
by minuetai

get_relationship_graph

Retrieve the complete relationship graph for ERC-8004 AI agents, with optional filtering by minimum number of connections to exclude sparse nodes.

Instructions

Return the full set of relationships as a graph.

Args: min_connections: Filter out agents with fewer than this many relationships from the returned edge list (default 0 = no filter).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
min_connectionsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The async function `get_relationship_graph` is decorated with @mcp.tool() and implements the tool logic: it calls MinuetClient.list_relationships(), optionally filters relationships by min_connections (using Counter to exclude agents with fewer relationships), and returns the count and list of relationships.
    @mcp.tool()
    async def get_relationship_graph(min_connections: int = 0) -> dict[str, Any]:
        """Return the full set of relationships as a graph.
    
        Args:
            min_connections: Filter out agents with fewer than this many
                relationships from the returned edge list (default 0 = no filter).
        """
        async with MinuetClient() as client:
            data = await client.list_relationships()
        relationships = data.get("relationships", [])
    
        if min_connections > 0:
            from collections import Counter
    
            counts: Counter[str] = Counter()
            for r in relationships:
                counts[r.get("from_agent", "")] += 1
                counts[r.get("to_agent", "")] += 1
            relationships = [
                r
                for r in relationships
                if counts[r.get("from_agent", "")] >= min_connections
                and counts[r.get("to_agent", "")] >= min_connections
            ]
    
        return {"count": len(relationships), "relationships": relationships}
  • The FastMCP instance `mcp` is created here. The @mcp.tool() decorator on line 102 registers 'get_relationship_graph' as an MCP tool.
    mcp = FastMCP("minuet-mcp")
  • MinuetClient is imported from .client and is the HTTP client used by the handler to call the Minuet API endpoint /api/relationships.
    from .client import MinuetClient
  • The `list_relationships` method on MinuetClient fetches the full relationship data from /api/relationships, which is what get_relationship_graph uses.
    async def list_relationships(self) -> dict[str, Any]:
        return await self._get("/api/relationships")
  • The tool name appears in the EXPECTED_TOOLS set in the test file, confirming it is expected to be registered.
    "get_relationship_graph",
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavior. It only mentions returning a graph with an optional filter, but does not state if the operation is read-only, authentication requirements, or any side effects. The absence of such details leaves the agent underinformed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise: one sentence for the main purpose, followed by a three-line parameter explanation. Every sentence adds value, and the most important information is front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has a moderate complexity (graph return, one parameter) and an output schema (content unknown). The description covers the parameter and basic output type, but omits details about graph structure, node/edge format, and behavioral aspects like caching or pagination. It is minimally adequate but not thoroughly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% coverage for parameter descriptions, but the description explains 'min_connections' in detail: 'Filter out agents with fewer than this many relationships from the returned edge list (default 0 = no filter).' This adds meaning beyond the schema, effectively compensating for the lack of schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the purpose: 'Return the full set of relationships as a graph.' This uses a specific verb and resource, distinguishing it from siblings like get_agent_relationships (likely for a single agent) and get_recent_relationships (limited scope).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide any guidance on when to use this tool versus alternatives like get_agent_relationships or search_agents. It lacks explicit context about the trade-offs or use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/minuetai/minuet-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server