Skip to main content
Glama
YuNaga224
by YuNaga224

delete_observations

Remove specific observations from entities in your Obsidian knowledge graph to maintain accurate and organized AI memories.

Instructions

Delete specific observations from entities in the knowledge graph

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deletionsYes

Implementation Reference

  • Core implementation of the delete_observations tool. Loads the target entity, removes the specified observations from its list, retrieves current outgoing relations for context, and saves the updated markdown file.
    async deleteObservations(deletions: { entityName: string; observations: string[] }[]): Promise<void> { for (const del of deletions) { const entityPath = getEntityPath(del.entityName); try { const entity = await this.loadEntity(entityPath); if (!entity) continue; // Remove specified observations entity.observations = entity.observations.filter( obs => !del.observations.includes(obs) ); // Get current relations const graph = await this.loadGraph(); const entityRelations = graph.relations.filter(r => r.from === entity.name); // Save updated entity await this.saveEntity(entity, entityRelations); } catch (error) { throw new Error(`Failed to delete observations from ${del.entityName}: ${error}`); } } }
  • Input schema defining the expected parameters: an array of objects each specifying entityName and the observations to delete.
    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:117-142 (registration)
    Registers the delete_observations tool in the ListTools response, providing name, description, and 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"], }, }, {
  • Dispatcher in the CallToolRequestSchema handler that invokes the storageManager.deleteObservations method with parsed arguments and returns success response.
    case "delete_observations": await storageManager.deleteObservations(args.deletions as { entityName: string; observations: 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/YuNaga224/obsidian-memory-mcp'

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