Skip to main content
Glama
knowall-ai

Neo4j Agent Memory MCP Server

by knowall-ai

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
NameRequiredDescriptionDefault
nodeIdYesID of the memory to update
propertiesYesProperties to update/add

Implementation Reference

  • 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),
          },
        ],
      };
    }
  • 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'
      );
    }
  • 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'],
      },
    },
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions 'update properties' but fails to specify whether this is a partial or full update, what happens to unmentioned properties, permission requirements, or error handling. For a mutation tool with zero annotation coverage, this leaves critical behavioral traits unclear.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose. It avoids redundancy and wastes no words, though it could be slightly more structured for clarity. Every phrase contributes meaning, earning its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity as a mutation operation with no annotations and no output schema, the description is incomplete. It lacks details on behavioral traits, error cases, and return values, leaving gaps that could hinder an agent's ability to use the tool effectively in context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters ('nodeId' and 'properties'). The description adds marginal value by implying 'properties' can include new details or changes, but it doesn't provide syntax, format, or constraints beyond what the schema offers. Baseline 3 is appropriate when the schema handles most documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('update') and resource ('existing memory') with specific examples of actions ('adding more detail or make a change when you find out something new'). It distinguishes from sibling 'create_memory' by specifying 'existing memory,' though it doesn't explicitly differentiate from other update operations like 'update_connection.'

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides minimal guidance, only implying usage when new information is found or details need addition. It lacks explicit when-to-use scenarios, prerequisites, or comparisons to alternatives like 'create_memory' or 'search_memories,' leaving the agent with insufficient context for optimal tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/knowall-ai/mcp-neo4j-agent-memory'

If you have feedback or need assistance with the MCP directory API, please join our Discord server