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() }

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