Skip to main content
Glama

delete_entity_edge

Remove connections between entities in graph memory by specifying the edge UUID to maintain clean data relationships.

Instructions

Delete an entity edge from the graph memory.

Args:
    uuid: UUID of the entity edge to delete

Returns:
    Success message dictionary

Example:
    delete_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 registration for 'delete_entity_edge' using @mcp.tool() decorator. Includes schema via function signature and docstring. Delegates to graphiti_tools.delete_entity_edge_impl.
    @mcp.tool()
    async def delete_entity_edge(uuid: str) -> Dict[str, str]:
        """
        Delete an entity edge from the graph memory.
    
        Args:
            uuid: UUID of the entity edge to delete
    
        Returns:
            Success message dictionary
    
        Example:
            delete_entity_edge(uuid="edge-uuid-123")
    
        @REQ: REQ-graphiti-chunk-mcp
        @BP: BP-graphiti-chunk-mcp
        @TASK: TASK-007-MCPTools
        """
        return await graphiti_tools.delete_entity_edge_impl(uuid=uuid)
  • Main handler function that executes the tool logic: obtains GraphitiClient, calls delete_entity_edge on it, returns success message or raises ToolError.
    async def delete_entity_edge_impl(uuid: str) -> Dict[str, str]:
        """
        Delete an entity edge from the graph memory.
    
        @REQ: REQ-graphiti-chunk-mcp
        @BP: BP-graphiti-chunk-mcp
        @TASK: TASK-007-MCPTools
    
        Args:
            uuid: UUID of the entity edge to delete
    
        Returns:
            Success message dictionary
    
        Raises:
            ToolError: If deletion operation fails
        """
        try:
            client = get_graphiti_client()
            async with client:
                await client.delete_entity_edge(uuid)
                return {"message": f"Successfully deleted entity edge {uuid}"}
    
        except Exception as e:
            raise ToolError(
                "DELETE_ENTITY_EDGE_ERROR",
                f"Failed to delete entity edge: {str(e)}"
            ) from e
  • GraphitiClient helper method that performs the database operation: calls self.graphiti.remove_edge(edge_uuid).
    async def delete_entity_edge(self, edge_uuid: str) -> bool:
        """
        Delete 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 delete
    
        Returns:
            True if deletion was successful
    
        Raises:
            RuntimeError: If deletion fails
        """
        try:
            logger.debug(f"Deleting entity edge: {edge_uuid}")
    
            # Use Graphiti's driver to delete the edge
            await self.graphiti.remove_edge(edge_uuid)
    
            logger.info(f"Entity edge deleted successfully: {edge_uuid}")
            return True
    
        except Exception as e:
            logger.error(f"Failed to delete entity edge {edge_uuid}: {e}")
            raise RuntimeError(f"Failed to delete entity edge: {e}") from e
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states this is a deletion operation, implying it's destructive, but doesn't clarify if it's irreversible, requires specific permissions, affects related data, or has side effects like cascading deletions. The example and return statement add minimal context, leaving significant gaps for a mutation tool.

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

Conciseness4/5

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

The description is appropriately sized and front-loaded with the core purpose in the first sentence. Additional sections (Args, Returns, Example) are structured but include some redundancy (e.g., the example repeats the function call). The metadata tags (@REQ, @BP, @TASK) are extraneous for tool selection, slightly reducing efficiency.

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?

Given one parameter with 0% schema coverage and an output schema (implied by 'Returns'), the description is moderately complete. It covers the basic operation and parameter intent but lacks details on behavioral traits, error handling, and usage context. For a destructive tool with no annotations, it should provide more guidance on safety and prerequisites to be fully adequate.

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

Parameters3/5

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

Schema description coverage is 0%, so the schema provides no parameter details. The description adds basic semantics by explaining 'uuid' as 'UUID of the entity edge to delete', which clarifies its purpose. However, it doesn't specify format constraints (e.g., UUID version), validation rules, or where to obtain the UUID, resulting in incomplete compensation for the low coverage.

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

Purpose4/5

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

The description clearly states the verb ('Delete') and resource ('entity edge from the graph memory'), making the purpose specific and understandable. It distinguishes from siblings like 'get_entity_edge' (read vs. delete) and 'clear_graph' (delete all vs. specific edge). However, it doesn't explicitly differentiate from 'delete_episode', which might be a related but different resource type.

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 provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing the UUID from a prior operation), when not to use it (e.g., for bulk deletions), or direct comparisons to siblings like 'delete_episode' or 'clear_graph'. Usage is implied through the example but not explicitly stated.

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