Skip to main content
Glama
modelcontextprotocol

Knowledge Graph Memory Server

delete_entities

Remove entities and their related connections from the Knowledge Graph Memory Server. Input entity names to delete unwanted data and maintain accurate, organized graph structures.

Instructions

Delete multiple entities and their associated relations from the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityNamesYesAn array of entity names to delete

Implementation Reference

  • Core implementation in KnowledgeGraphManager that loads the graph, filters out the specified entities and any relations connected to them, then saves the updated graph.
    async deleteEntities(entityNames: string[]): Promise<void> {
      const graph = await this.loadGraph();
      graph.entities = graph.entities.filter(e => !entityNames.includes(e.name));
      graph.relations = graph.relations.filter(r => !entityNames.includes(r.from) && !entityNames.includes(r.to));
      await this.saveGraph(graph);
    }
  • Registers the 'delete_entities' MCP tool, including its schema and thin wrapper handler that delegates to KnowledgeGraphManager.deleteEntities.
    server.registerTool(
      "delete_entities",
      {
        title: "Delete Entities",
        description: "Delete multiple entities and their associated relations from the knowledge graph",
        inputSchema: {
          entityNames: z.array(z.string()).describe("An array of entity names to delete")
        },
        outputSchema: {
          success: z.boolean(),
          message: z.string()
        }
      },
      async ({ entityNames }) => {
        await knowledgeGraphManager.deleteEntities(entityNames);
        return {
          content: [{ type: "text" as const, text: "Entities deleted successfully" }],
          structuredContent: { success: true, message: "Entities deleted successfully" }
        };
      }
  • Zod-based input/output schema for the delete_entities tool: input is array of entity names, output is success boolean and message.
    {
      title: "Delete Entities",
      description: "Delete multiple entities and their associated relations from the knowledge graph",
      inputSchema: {
        entityNames: z.array(z.string()).describe("An array of entity names to delete")
      },
      outputSchema: {
        success: z.boolean(),
        message: z.string()
      }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states this is a deletion operation, implying it's destructive, but doesn't specify whether deletions are permanent, reversible, or require specific permissions. It mentions associated relations are also deleted, which is useful context, but lacks details on error handling, rate limits, or response format, leaving significant gaps for a destructive tool.

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 a single, efficient sentence that front-loads the key action and target without any wasted words. Every part of the sentence earns its place by specifying the scope ('multiple entities and their associated relations') and context ('from the knowledge graph'), making it appropriately sized and well-structured.

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

Completeness2/5

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

Given the tool's destructive nature, lack of annotations, and no output schema, the description is incomplete. It doesn't address critical aspects like what happens on success or failure, whether deletions cascade as implied, or any safety warnings. For a deletion tool with no structured safety hints, this leaves the agent under-informed about potential impacts and outcomes.

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 100%, with the parameter 'entityNames' clearly documented as an array of entity names to delete. The description adds no additional parameter information beyond what the schema provides, such as format examples or constraints. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 action ('Delete') and target ('multiple entities and their associated relations from the knowledge graph'), making the purpose immediately understandable. It distinguishes from siblings like delete_observations and delete_relations by specifying it targets entities and their relations. However, it doesn't explicitly contrast with create_entities or read_graph, which would have made it a perfect 5.

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 like delete_observations or delete_relations, nor does it mention prerequisites such as needing existing entities to delete. It implies usage by stating the action but lacks explicit context or exclusions, leaving the agent to infer when this is appropriate.

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

Related 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/modelcontextprotocol/knowledge-graph-memory-server'

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