Skip to main content
Glama

delete_observations

Remove specific observations from entities in a knowledge graph to maintain accurate and relevant data.

Instructions

Delete specific observations from entities in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deletionsYes
memoryFilePathYesThe path to the memory file

Implementation Reference

  • The handler function in KnowledgeGraphManager that deletes specific observations from the specified entities in the knowledge graph by loading the graph, filtering out the observations, and saving the updated graph.
    async deleteObservations( deletions: { entityName: string; observations: string[] }[], filepath: string ): Promise<void> { await this.setMemoryFilePath(filepath); const graph = await this.loadGraph(); deletions.forEach((d) => { const entity = graph.entities.find((e) => e.name === d.entityName); if (entity) { entity.observations = entity.observations.filter( (o) => !d.observations.includes(o) ); } }); await this.saveGraph(graph); }
  • Input schema definition for the delete_observations tool, specifying the structure of deletions array and memoryFilePath.
    name: "delete_observations", description: "Delete specific observations from entities in the knowledge graph", inputSchema: { type: "object", properties: { deletions: { type: "array", items: { type: "object", properties: { entityName: { type: "string", description: "The name of the entity containing the observations", }, observations: { type: "array", items: { type: "string" }, description: "An array of observations to delete", }, }, required: ["entityName", "observations"], }, }, memoryFilePath: { type: "string", description: "The path to the memory file", }, }, required: ["deletions", "memoryFilePath"], }, },
  • index.ts:661-668 (registration)
    Registration of the tool handler in the CallToolRequestSchema switch statement, dispatching to the KnowledgeGraphManager.deleteObservations method.
    case "delete_observations": await knowledgeGraphManager.deleteObservations( args.deletions as { entityName: string; observations: string[] }[], args.memoryFilePath as string ); return { content: [{ type: "text", text: "Observations deleted successfully" }], };

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/BRO3886/mcp-memory-custom'

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