memory_update_fact
Update stored factual knowledge in a persistent memory system for LLMs, ensuring continuous learning and accurate information retention across sessions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- Handler function that executes the tool logic: extracts factId and updates, calls factStore.updateFact, and returns formatted success or error response.async handleUpdateFact(args) { try { const { factId, updates } = args; const updatedFact = await this.factStore.updateFact(factId, updates); return { content: [ { type: 'text', text: `✅ Fact updated successfully!\n\n**ID:** ${updatedFact.id}\n**Updated:** ${updatedFact.updatedAt}\n\n**Content:** ${updatedFact.content}`, }, ], }; } catch (error) { return { content: [ { type: 'text', text: `Error updating fact: ${error.message}`, }, ], isError: true, }; } }
- src/tools/modules/MemoryOperations.js:65-87 (registration)Registers the 'memory_update_fact' tool with the MCP server, providing the tool name, description, input schema, and reference to the handler function.registerUpdateFactTool(server) { server.registerTool( 'memory_update_fact', 'Update an existing fact in the memory system', { type: 'object', properties: { factId: { type: 'string', description: 'The ID of the fact to update', }, updates: { type: 'object', description: 'The updates to apply to the fact', }, }, required: ['factId', 'updates'], }, async (args) => { return await this.handleUpdateFact(args); } ); }
- src/tools/MemoryTools.js:24-28 (registration)Top-level registration entry point in MemoryTools class that calls registerTools on MemoryOperations (among others), making the tool available to the server.// Register tools from modular components this.operations.registerTools(server); this.queryHandler.registerTools(server); this.streamingTools.registerTools(server); this.management.registerTools(server);
- src/tools/MemoryTools.js:14-17 (registration)Instantiates the MemoryOperations class with required dependencies (factStore, qualityScorer), enabling tool registration and handlers.this.operations = new MemoryOperations(factStore, qualityScorer); this.queryHandler = new MemoryQueryHandler(factStore, processor); this.streamingTools = new MemoryStreamingTools(factStore); this.management = new MemoryManagement(factStore);