delete_observations
Remove specific observations from entities in the knowledge graph to maintain accurate and relevant memory storage.
Instructions
Delete specific observations from entities in the knowledge graph
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deletions | Yes |
Implementation Reference
- index.ts:131-140 (handler)Core handler function in KnowledgeGraphManager that deletes specified observations from entities by loading the graph, filtering observations, and saving the updated graph.async deleteObservations(deletions: { entityName: string; observations: string[] }[]): Promise<void> { 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); }
- index.ts:372-396 (registration)Tool registration in ListToolsRequestSchema handler, defining name, description, and input schema for delete_observations.{ 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"], }, }, }, required: ["deletions"], }, },
- index.ts:523-525 (handler)MCP server handler (switch case) for delete_observations tool call, delegating to KnowledgeGraphManager and returning success response.case "delete_observations": await knowledgeGraphManager.deleteObservations(args.deletions as { entityName: string; observations: string[] }[]); return { content: [{ type: "text", text: "Observations deleted successfully" }] };
- index.ts:375-395 (schema)Input schema definition for the delete_observations tool, specifying the structure of deletions array with entityName and observations.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"], }, }, }, required: ["deletions"], },