Skip to main content
Glama

Graph Delete

graph_delete
Destructive

Permanently remove an entity node and all its connections by ID. Use to delete duplicate or erroneous nodes.

Instructions

Permanently delete an entity node and all its edges by ID. Use for removing duplicate or erroneous nodes. Cannot be undone.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesEntity ID to delete

Implementation Reference

  • MCP server tool registration for graph_delete. Receives an entity ID, calls deleteEntity on the Neo4j client, and returns success/error.
    // ─── Tool: graph_delete ───
    
    server.registerTool("graph_delete", {
      title: "Graph Delete",
      description:
        "Permanently delete an entity node and all its edges by ID. Use for removing duplicate or erroneous nodes. Cannot be undone.",
      inputSchema: {
        id: z.string().describe("Entity ID to delete"),
      },
      annotations: { destructiveHint: true },
    }, async (args) => {
      try {
        const deleted = await client.deleteEntity(currentTenant(), args.id);
        if (!deleted) {
          return toolError(`No entity found with id: ${args.id}`);
        }
        return toolResult({ action: "deleted", id: args.id });
      } catch (err) {
        return toolError(`graph_delete failed: ${err instanceof Error ? err.message : String(err)}`);
      }
    });
  • Input schema for graph_delete: requires a single string parameter 'id' (the entity ID to delete).
    inputSchema: {
      id: z.string().describe("Entity ID to delete"),
    },
  • Neo4jClient.deleteEntity runs a Cypher DETACH DELETE query scoped to tenant and entity ID. Returns boolean indicating whether a node was actually deleted.
    async deleteEntity(tenantId: string, id: string): Promise<boolean> {
      const rows = await this.run(
        `MATCH (n:Entity {tenant_id: $tenantId, id: $id}) DETACH DELETE n RETURN count(n) AS deleted`,
        { tenantId, id },
      );
      return Number(rows[0]?.["deleted"] ?? 0) > 0;
    }
Behavior5/5

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

The description adds value beyond the annotations by explicitly stating 'Cannot be undone' and that deletion includes 'all its edges', which complements the destructiveHint annotation and informs the agent of irreversible cascade effects.

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, consisting of two short sentences that front-load the action and key constraints. Every sentence is meaningful and earns its place.

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

Completeness5/5

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

For a simple tool with one parameter and no output schema, the description covers purpose, usage context, and behavioral transparency completely. No missing information is apparent.

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?

With 100% schema description coverage, the parameter 'id' is already well-documented in the schema. The description adds minimal extra meaning ('by ID') but does not introduce new details beyond the schema.

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 action ('permanently delete'), the resource ('entity node and all its edges'), and specific use cases ('removing duplicate or erroneous nodes'), which distinguishes it from sibling tools like graph_merge or graph_unmerge.

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 provides a clear context for when to use the tool ('removing duplicate or erroneous nodes') but does not explicitly state when not to use it or mention alternatives, though the destructive hint implies caution.

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/stevepridemore/graph-memory'

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