delete_observations
Remove specific observations from entities stored in the Knowledge Graph Memory Server to maintain accurate and updated data.
Instructions
Delete specific observations from entities in the knowledge graph
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| deletions | Yes |
Implementation Reference
- index.ts:645-654 (handler)Core handler function for the delete_observations tool. It loads the knowledge graph, finds entities matching the provided names, filters out the specified observations from those entities, and saves 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:1014-1038 (registration)Tool registration in the listTools response, including name, description, and input schema.{ 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:1017-1037 (schema)Input schema definition for validating tool arguments.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:1232-1234 (handler)Dispatcher in callToolRequest handler that invokes the KnowledgeGraphManager.deleteObservations method and returns success response.case "delete_observations": await knowledgeGraphManager.deleteObservations(args.deletions as { entityName: string; observations: string[] }[]); return { content: [{ type: "text", text: "Observations deleted successfully" }] };