Skip to main content
Glama
T1nker-1220

Knowledge Graph Memory Server

by T1nker-1220

delete_entities

Remove specified entities and their relationships from the knowledge graph to maintain accurate and relevant data.

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

  • The core handler function in KnowledgeGraphManager that executes the delete_entities tool logic: loads the graph, removes specified entities and their connected relations, 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);
    }
  • Input schema definition for the delete_entities tool, specifying an object with a required 'entityNames' array of strings.
    inputSchema: {
      type: "object",
      properties: {
        entityNames: {
          type: "array",
          items: { type: "string" },
          description: "An array of entity names to delete"
        },
      },
      required: ["entityNames"],
    },
  • index.ts:1000-1013 (registration)
    Tool registration in the ListTools response, defining name, description, and input schema for delete_entities.
      name: "delete_entities",
      description: "Delete multiple entities and their associated relations from the knowledge graph",
      inputSchema: {
        type: "object",
        properties: {
          entityNames: {
            type: "array",
            items: { type: "string" },
            description: "An array of entity names to delete"
          },
        },
        required: ["entityNames"],
      },
    },
  • index.ts:1229-1231 (registration)
    Dispatcher case in CallToolRequest handler that invokes the deleteEntities method and returns success response.
    case "delete_entities":
      await knowledgeGraphManager.deleteEntities(args.entityNames as string[]);
      return { content: [{ type: "text", text: "Entities deleted successfully" }] };

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior3/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. It does disclose that associated relations are deleted as part of the operation, which is a useful behavioral detail. However, it does not mention irreversibility, permissions, or whether observations are affected, leaving gaps in transparency.

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 concise sentence that front-loads the action and scope with no unnecessary words. Every word contributes to understanding the tool's purpose.

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?

For a simple one-parameter destructive tool with no output schema, the description conveys the core purpose but omits behavioral details such as error handling, atomicity, and return values. Given the lack of annotations, it is moderately complete but has room for improvement.

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?

The input schema has 100% coverage of the parameter 'entityNames' with a description, so the baseline is 3. The tool description does not add any additional parameter semantics beyond what the schema already provides.

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 tool deletes multiple entities and their associated relations, using a specific verb ('Delete') and resource ('entities' and 'relations'). It distinguishes itself from sibling tools like delete_relations, which only handle relations, and delete_observations, which handles observations.

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 such as delete_relations or delete_observations. It does not state any exclusions, prerequisites, or scenarios where another tool would be more appropriate.

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