delete_entities
Remove entities and their associated data from the Memento MCP server to manage stored information by specifying entity names for deletion.
Instructions
Delete entities (and cascaded observations/relations) by their names.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entityNames | Yes | Names of entities to delete. |
Implementation Reference
- src/server.js:112-123 (handler)MCP server tool registration, schema definition, and handler function for 'delete_entities'. Delegates to KnowledgeGraphManager.deleteEntities and returns success response.// Tool: delete_entities this.tool( 'delete_entities', 'Delete entities (and cascaded observations/relations) by their names.', { entityNames: z.array(z.string()).describe('Names of entities to delete.') }, async ({ entityNames }) => { await this.#knowledgeGraphManager.deleteEntities(entityNames); return { content: [{ type: 'text', text: 'Entities deleted' }] }; } );
- src/knowledge-graph-manager.js:116-118 (handler)KnowledgeGraphManager.deleteEntities method that delegates the deletion to the underlying GraphRepository implementation.async deleteEntities(names) { await this.#repository.deleteEntities(names); }
- src/sqlite/graph-repo.js:142-149 (handler)SQLite-specific implementation of deleteEntities, executing DELETE on entities table (cascades to observations and relations).async deleteEntities(names) { if (!names.length) { return; } const placeholders = names.map(() => '?').join(','); await this.db.run(`DELETE FROM entities WHERE name IN (${placeholders})`, names); }
- src/postgres/graph-repo.js:239-250 (handler)PostgreSQL-specific implementation of deleteEntities, executing DELETE on entities table using ANY array (cascades).async deleteEntities(names) { if (!names.length) { return; } await this.#query( `DELETE FROM entities WHERE name = ANY ($1)`, [ names ] ); }
- src/graph-repository.js:28-28 (schema)Interface definition (JSDoc) for GraphRepository.deleteEntities method.* @property {(names: string[]) => Promise<void>} deleteEntities