update_memory
Modify existing memory entries in a Neo4j graph database by updating properties or adding new details when information changes.
Instructions
Update properties of an existing memory such as adding more detail or make a change when you find out something new
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nodeId | Yes | ID of the memory to update | |
| properties | Yes | Properties to update/add |
Implementation Reference
- src/handlers/index.ts:235-248 (handler)The handler function executes the update_memory tool by validating arguments with isUpdateMemoryArgs and calling neo4j.updateNode to update the memory node in the database.case 'update_memory': { if (!isUpdateMemoryArgs(args)) { throw new McpError(ErrorCode.InvalidParams, 'Invalid update_memory arguments'); } const result = await neo4j.updateNode(args.nodeId, args.properties); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], }; }
- src/types.ts:29-84 (schema)TypeScript interface and validation function defining the input schema for update_memory tool arguments.export interface UpdateMemoryArgs { nodeId: number; properties: Record<string, any>; } export interface UpdateConnectionArgs { fromMemoryId: number; toMemoryId: number; type: string; properties: Record<string, any>; } export interface DeleteMemoryArgs { nodeId: number; } export interface DeleteConnectionArgs { fromMemoryId: number; toMemoryId: number; type: string; } export interface ListMemoryLabelsArgs { // No arguments needed for this tool } export function isCreateMemoryArgs(args: unknown): args is CreateMemoryArgs { return typeof args === 'object' && args !== null && typeof (args as CreateMemoryArgs).label === 'string' && typeof (args as CreateMemoryArgs).properties === 'object'; } export function isSearchMemoriesArgs(args: unknown): args is SearchMemoriesArgs { if (typeof args !== 'object' || args === null) return false; const searchArgs = args as SearchMemoriesArgs; if (searchArgs.query !== undefined && typeof searchArgs.query !== 'string') return false; if (searchArgs.since_date !== undefined && typeof searchArgs.since_date !== 'string') return false; return true; } export function isCreateConnectionArgs(args: unknown): args is CreateConnectionArgs { return ( typeof args === 'object' && args !== null && typeof (args as CreateConnectionArgs).fromMemoryId === 'number' && typeof (args as CreateConnectionArgs).toMemoryId === 'number' && typeof (args as CreateConnectionArgs).type === 'string' ); } export function isUpdateMemoryArgs(args: unknown): args is UpdateMemoryArgs { return ( typeof args === 'object' && args !== null && typeof (args as UpdateMemoryArgs).nodeId === 'number' && typeof (args as UpdateMemoryArgs).properties === 'object' ); }
- src/tools/definitions.ts:91-109 (registration)Tool registration in the tools array, including name, description, and input schema for the MCP server.{ name: 'update_memory', description: 'Update properties of an existing memory such as adding more detail or make a change when you find out something new', inputSchema: { type: 'object', properties: { nodeId: { type: 'number', description: 'ID of the memory to update', }, properties: { type: 'object', description: 'Properties to update/add', additionalProperties: true, }, }, required: ['nodeId', 'properties'], }, },