Skip to main content
Glama
itseasy21

Knowledge Graph Memory Server

delete_entities

Remove specific entities and their connections from the knowledge graph to maintain accurate and relevant data storage.

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 for the delete_entities tool. It loads the knowledge 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);
    }
  • 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:520-522 (registration)
    Registration and dispatch logic in the CallToolRequestHandler switch statement, which invokes the deleteEntities handler and returns a success message.
    case "delete_entities":
      await knowledgeGraphManager.deleteEntities(args.entityNames as string[]);
      return { content: [{ type: "text", text: "Entities deleted successfully" }] };
  • index.ts:357-371 (registration)
    Tool registration in the ListToolsRequestHandler, providing name, description, and 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"],
      },
    },
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 the action ('Delete') and scope ('multiple entities and their associated relations'), implying a destructive operation, but lacks details on permissions, reversibility, side effects, or error handling. For a deletion tool with zero annotation coverage, this is a significant gap 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, efficient sentence that front-loads the key action and resource. There is no wasted language, making it appropriately sized and easy to parse quickly.

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 complexity of a deletion operation with no annotations and no output schema, the description is incomplete. It doesn't cover behavioral aspects like safety, permissions, or return values, which are critical for such a tool. This leaves significant gaps for an agent to understand the full context.

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% description coverage, with 'entityNames' clearly documented as 'An array of entity names to delete'. The description adds no additional meaning beyond this, such as format examples or constraints. With high schema coverage, the baseline score is 3, as the schema does the heavy lifting.

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 ('multiple entities and their associated relations from the knowledge graph'), making the purpose specific and understandable. It distinguishes from siblings like 'delete_observations' or 'delete_relations' by specifying entities and their relations. However, it doesn't explicitly contrast with all siblings, such as 'update_entities' or 'create_entities', which slightly limits differentiation.

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, exclusions, or comparisons with siblings like 'delete_observations' or 'update_entities'. Without such context, an agent might misuse it, such as deleting when updating is needed.

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/itseasy21/mcp-knowledge-graph'

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