Skip to main content
Glama

delete_entities

Remove specified entities and their associated observations or relations by names using the delete entity tool.

Instructions

Delete entities (and cascaded observations/relations) by their names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
entityNamesYesNames of entities to delete.

Implementation Reference

  • src/server.js:112-123 (registration)
    Registration of the MCP 'delete_entities' tool, including Zod input schema (entityNames: string[]) and thin handler that delegates to KnowledgeGraphManager.deleteEntities(entityNames).
    // 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' }] }; } );
  • Zod schema definition for the tool input parameter 'entityNames'.
    entityNames: z.array(z.string()).describe('Names of entities to delete.')
  • KnowledgeGraphManager.deleteEntities method, which delegates the deletion to the underlying database repository.
    async deleteEntities(names) { await this.#repository.deleteEntities(names); }
  • SQLite-specific implementation of deleteEntities: executes DELETE FROM entities WHERE name IN (...) which 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); }
  • PostgreSQL-specific implementation of deleteEntities: executes DELETE FROM entities WHERE name = ANY($1), assuming cascade deletes.
    async deleteEntities(names) { if (!names.length) { return; } await this.#query( `DELETE FROM entities WHERE name = ANY ($1)`, [ names ] ); }

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/iAchilles/memento'

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