Skip to main content
Glama
YeomYuJun

Remote Memory MCP Server

by YeomYuJun

add_observations

Add observations to existing entities in a knowledge graph for remote storage and collaborative memory management.

Instructions

기존 엔티티에 관찰 내용을 추가합니다

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
observationsYes

Implementation Reference

  • The main MCP tool handler for 'add_observations'. It delegates to memoryManager.addObservations, performs sync if enabled, and returns a success response.
    private async handleAddObservations(args: any) {
      this.memoryManager.addObservations(args.observations);
      
      const totalObservations = args.observations.reduce((sum: number, obs: any) => sum + obs.contents.length, 0);
      const commitMessage = `feat: Add ${totalObservations} observations to ${args.observations.length} entities`;
      await this.syncWithMessage(commitMessage);
      
      return {
        content: [{
          type: 'text',
          text: JSON.stringify({
            success: true,
            message: 'Added observations',
            observations: args.observations,
          }, null, 2),
        }],
      };
    }
  • Input schema definition for the 'add_observations' tool, specifying array of observations with entityName and contents.
    inputSchema: {
      type: 'object',
      properties: {
        observations: {
          type: 'array',
          items: {
            type: 'object',
            properties: {
              entityName: { type: 'string' },
              contents: {
                type: 'array',
                items: { type: 'string' },
              },
            },
            required: ['entityName', 'contents'],
          },
        },
      },
      required: ['observations'],
    },
  • src/index.ts:130-153 (registration)
    Tool registration in the ListTools response, including name, description, and input schema.
    {
      name: 'add_observations',
      description: '기존 엔티티에 관찰 내용을 추가합니다',
      inputSchema: {
        type: 'object',
        properties: {
          observations: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                entityName: { type: 'string' },
                contents: {
                  type: 'array',
                  items: { type: 'string' },
                },
              },
              required: ['entityName', 'contents'],
            },
          },
        },
        required: ['observations'],
      },
    },
  • Core helper method in MemoryGraphManager that appends new observations to existing entities and updates metadata.
    addObservations(observations: { entityName: string; contents: string[] }[]): void {
      const now = new Date().toISOString();
      
      observations.forEach(({ entityName, contents }) => {
        const entity = this.graph.entities.get(entityName);
        if (entity) {
          entity.observations.push(...contents);
          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