Skip to main content
Glama
YeomYuJun

Remote Memory MCP Server

by YeomYuJun

delete_observations

Remove specific observations from entities in a knowledge graph to maintain data accuracy and manage stored information.

Instructions

엔티티에서 특정 관찰 내용을 삭제합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deletionsYes

Implementation Reference

  • The primary handler for the 'delete_observations' tool. It delegates deletion to the memory manager, performs optional synchronization with a commit message, and returns a formatted success response.
    private async handleDeleteObservations(args: any) {
      this.memoryManager.deleteObservations(args.deletions);
      
      const totalDeleted = args.deletions.reduce((sum: number, del: any) => sum + del.observations.length, 0);
      const commitMessage = `feat: Delete ${totalDeleted} observations from ${args.deletions.length} entities`;
      await this.syncWithMessage(commitMessage);
      
      return {
        content: [{
          type: 'text',
          text: JSON.stringify({
            success: true,
            message: 'Deleted observations',
            deletions: args.deletions,
          }, null, 2),
        }],
      };
  • src/index.ts:168-191 (registration)
    Tool registration in the MCP server's tool list, including name, description, and detailed input schema for deletions.
    {
      name: 'delete_observations',
      description: '엔티티에서 특정 관찰 내용을 삭제합니다',
      inputSchema: {
        type: 'object',
        properties: {
          deletions: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                entityName: { type: 'string' },
                observations: {
                  type: 'array',
                  items: { type: 'string' },
                },
              },
              required: ['entityName', 'observations'],
            },
          },
        },
        required: ['deletions'],
      },
    },
  • Input schema defining the structure for deletions: array of objects with entityName and observations array.
    inputSchema: {
      type: 'object',
      properties: {
        deletions: {
          type: 'array',
          items: {
            type: 'object',
            properties: {
              entityName: { type: 'string' },
              observations: {
                type: 'array',
                items: { type: 'string' },
              },
            },
            required: ['entityName', 'observations'],
          },
        },
      },
      required: ['deletions'],
    },
  • Supporting method in MemoryGraphManager that implements the core logic: filters out specified observations from matching entities and updates metadata.
    deleteObservations(deletions: { entityName: string; observations: string[] }[]): void {
      const now = new Date().toISOString();
      
      deletions.forEach(({ entityName, observations }) => {
        const entity = this.graph.entities.get(entityName);
        if (entity) {
          entity.observations = entity.observations.filter(
            obs => !observations.includes(obs)
          );
          entity.updatedAt = now;
        }
      });
      
      this.updateMetadata();
    }

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/YeomYuJun/remote-memory-mcp-server'

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