Skip to main content
Glama
YuNaga224

Obsidian Memory MCP

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" }] };

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavioral traits. It only states the action without mentioning permanence, side effects, required permissions, or return format. As a mutation tool, this is insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence that directly conveys the core action, with no unnecessary words. It is well-structured and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has a non-trivial parameter schema and no output schema or annotations. The description is too minimal to fully inform usage, lacking details on how to specify deletions and what to expect in response.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description does not explain the 'deletions' parameter structure. Schema coverage is 0% for the top-level parameter, and the description adds no semantic meaning beyond the schema's nested field descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the function: deleting specific observations from entities in a knowledge graph. It distinguishes itself from sibling tools like delete_entities and add_observations by specifying the granularity ('specific observations').

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives such as delete_entities or when not to use it. The description lacks any context or conditions for usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.