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"], }, },

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