Skip to main content
Glama

add_observations

Add observations to existing entities in a knowledge graph for remote storage and collaboration.

Instructions

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
observationsYes

Implementation Reference

  • Core handler function that adds observations to existing entities by appending contents to the entity's observations array and updating the updatedAt timestamp.
    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(); }
  • MCP-specific tool handler for 'add_observations' that invokes the core addObservations method, generates commit message, syncs if enabled, and formats the 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 and tool metadata registration for the 'add_observations' tool, specifying the expected structure of observations array with entityName and contents.
    { 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'], },
  • src/index.ts:384-385 (registration)
    Tool dispatch/registration in the CallToolRequestSchema switch statement that routes 'add_observations' calls to the handler method.
    case 'add_observations': return await this.handleAddObservations(args);

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