update_memory
Modify existing memory properties to add details or make corrections when new information becomes available in the Neo4j graph database.
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 the input arguments and calling neo4j.updateNode to update the memory node in the graph, then returning the result as JSON text.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/tools/definitions.ts:91-109 (registration)Registration of the 'update_memory' tool in the tools array, including name, description, and JSON input schema for MCP.{ 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'], }, },
- src/types.ts:29-32 (schema)TypeScript interface defining the structure of arguments for the update_memory tool.export interface UpdateMemoryArgs { nodeId: number; properties: Record<string, any>; }
- src/types.ts:77-84 (schema)Type guard function for validating update_memory arguments at runtime in the handler.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' ); }