Skip to main content
Glama

Knowledge Graph Memory Server

by yodakeisuke

delete_entities

Remove specified entities and their related connections from the knowledge graph to maintain accurate and updated memory data in chat applications.

Instructions

Delete multiple entities and their associated relations from the knowledge graph

Input Schema

NameRequiredDescriptionDefault
entityNamesYesAn array of entity names to delete

Input Schema (JSON Schema)

{ "properties": { "entityNames": { "description": "An array of entity names to delete", "items": { "type": "string" }, "type": "array" } }, "required": [ "entityNames" ], "type": "object" }

Implementation Reference

  • The handler function in KnowledgeGraphManager that deletes the specified entities and all relations connected to them by filtering the graph and saving the changes.
    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:438-451 (registration)
    Tool registration in the listTools response, including name, description, and input schema.
    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"], }, },
  • Switch case in the CallToolRequest handler that invokes the deleteEntities method and returns success message.
    case "delete_entities": await knowledgeGraphManager.deleteEntities(args.entityNames as string[]); return createResponse("Entities deleted successfully");

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/yodakeisuke/mcp-memory-domain-knowledge'

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