Skip to main content
Glama

get_entity_edge

Retrieve relationship connections between entities from graph memory using UUIDs to access structured document data efficiently.

Instructions

Get an entity edge from the graph memory by its UUID.

Args:
    uuid: UUID of the entity edge to retrieve

Returns:
    Entity edge dictionary containing edge details:
    {
        "uuid": "edge-uuid",
        "source_node_uuid": "source-uuid",
        "target_node_uuid": "target-uuid",
        "fact": "relationship description",
        "episodes": ["episode-uuid-1", "episode-uuid-2"],
        "valid_at": "2025-01-01T00:00:00Z",
        "invalid_at": null
    }

Example:
    get_entity_edge(uuid="edge-uuid-123")

@REQ: REQ-graphiti-chunk-mcp
@BP: BP-graphiti-chunk-mcp
@TASK: TASK-007-MCPTools

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'get_entity_edge'. Decorated with @mcp.tool() for automatic registration and schema inference from type hints. Delegates to graphiti_tools.get_entity_edge_impl.
    @mcp.tool()
    async def get_entity_edge(uuid: str) -> Dict[str, Any]:
        """
        Get an entity edge from the graph memory by its UUID.
    
        Args:
            uuid: UUID of the entity edge to retrieve
    
        Returns:
            Entity edge dictionary containing edge details:
            {
                "uuid": "edge-uuid",
                "source_node_uuid": "source-uuid",
                "target_node_uuid": "target-uuid",
                "fact": "relationship description",
                "episodes": ["episode-uuid-1", "episode-uuid-2"],
                "valid_at": "2025-01-01T00:00:00Z",
                "invalid_at": null
            }
    
        Example:
            get_entity_edge(uuid="edge-uuid-123")
    
        @REQ: REQ-graphiti-chunk-mcp
        @BP: BP-graphiti-chunk-mcp
        @TASK: TASK-007-MCPTools
        """
        return await graphiti_tools.get_entity_edge_impl(uuid=uuid)
  • Helper implementation that creates GraphitiClient and calls client.get_entity_edge, with error handling.
    async def get_entity_edge_impl(uuid: str) -> Dict[str, Any]:
        """
        Get an entity edge from the graph memory by its UUID.
    
        @REQ: REQ-graphiti-chunk-mcp
        @BP: BP-graphiti-chunk-mcp
        @TASK: TASK-007-MCPTools
    
        Args:
            uuid: UUID of the entity edge to retrieve
    
        Returns:
            Entity edge dictionary containing edge details
    
        Raises:
            ToolError: If retrieval operation fails
        """
        try:
            client = get_graphiti_client()
            async with client:
                edge = await client.get_entity_edge(uuid)
                return edge
    
        except Exception as e:
            raise ToolError(
                "GET_ENTITY_EDGE_ERROR",
                f"Failed to get entity edge: {str(e)}"
            ) from e
  • Core implementation in GraphitiClient: calls underlying graphiti.get_edge and formats the response dictionary.
    async def get_entity_edge(self, edge_uuid: str) -> Dict[str, Any]:
        """
        Get an entity edge from Graphiti by its UUID.
    
        @REQ: REQ-graphiti-chunk-mcp
        @BP: BP-graphiti-chunk-mcp
        @TASK: TASK-007-MCPTools
    
        Args:
            edge_uuid: UUID of the entity edge to retrieve
    
        Returns:
            Dictionary containing edge details
    
        Raises:
            RuntimeError: If retrieval fails
        """
        try:
            logger.debug(f"Getting entity edge: {edge_uuid}")
    
            edge = await self.graphiti.get_edge(edge_uuid)
    
            if edge is None:
                raise RuntimeError(f"Entity edge not found: {edge_uuid}")
    
            logger.info(f"Entity edge retrieved successfully: {edge_uuid}")
    
            return {
                "uuid": edge.uuid,
                "source_node_uuid": edge.source_node_uuid,
                "target_node_uuid": edge.target_node_uuid,
                "fact": edge.fact,
                "fact_embedding": edge.fact_embedding,
                "episodes": edge.episodes,
                "expired_at": edge.expired_at,
                "valid_at": edge.valid_at,
                "invalid_at": edge.invalid_at,
            }
    
        except Exception as e:
            logger.error(f"Failed to get entity edge {edge_uuid}: {e}")
            raise RuntimeError(f"Failed to get entity edge: {e}") from e
Behavior3/5

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

With no annotations provided, the description carries full burden. It discloses this is a retrieval operation (non-destructive) and specifies the return format, but doesn't mention error handling (e.g., what happens if UUID doesn't exist), authentication needs, rate limits, or performance characteristics. It adds basic behavioral context but leaves gaps.

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 efficiently structured: purpose statement first, followed by Args/Returns/Example sections. Every sentence adds value—no fluff. The example is minimal yet complete. The metadata tags (@REQ, @BP, @TASK) are extraneous but don't detract from core clarity.

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

Completeness4/5

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

Given 1 parameter, no annotations, but with an output schema (implied by Returns section), the description is mostly complete. It covers purpose, parameter meaning, and return structure. However, for a read operation with no annotations, it could better address error cases or prerequisites (e.g., required permissions).

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?

Schema description coverage is 0%, so the description must compensate. It clearly explains the single parameter ('UUID of the entity edge to retrieve'), adding essential meaning beyond the schema's generic string type. However, it doesn't specify UUID format constraints (e.g., UUIDv4 pattern) or validation rules.

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 specific action ('Get an entity edge') and resource ('from the graph memory by its UUID'), distinguishing it from siblings like delete_entity_edge (destructive) or search_memory_facts (search-based). The verb 'retrieve' precisely indicates a read operation without ambiguity.

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

Usage Guidelines4/5

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

The description implies usage when you know the exact UUID of an entity edge, but doesn't explicitly contrast with alternatives like search_memory_facts for unknown UUIDs or get_episodes for related data. It provides clear context (retrieval by UUID) but lacks explicit when-not-to-use guidance.

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/leo7nel23/KnowkedgeSmith-MCP'

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