Skip to main content
Glama

update_memory

Modify existing stored data by editing or appending to specific memory entries in the Hi-AI assistant system.

Instructions

update|modify|change|edit memory - Update existing memory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesMemory key to update
valueYesNew value
appendNoAppend to existing value

Implementation Reference

  • Executes the update_memory tool: updates or appends to an existing memory entry using MemoryManager, returns success/error text.
    export async function updateMemory(args: { key: string; value: string; append?: boolean }): Promise<ToolResult> {
      const { key: updateKey, value: updateValue, append = false } = args;
    
      try {
        const mm = MemoryManager.getInstance();
        const existingMemory = mm.recall(updateKey);
    
        if (existingMemory) {
          const newValue = append ? existingMemory.value + ' ' + updateValue : updateValue;
          mm.update(updateKey, newValue);
    
          return {
            content: [{
              type: 'text',
              text: `✓ ${append ? 'Appended to' : 'Updated'} memory: "${updateKey}"`
            }]
          };
        } else {
          return {
            content: [{ type: 'text', text: `✗ Memory not found: "${updateKey}". Use save_memory to create new memory.` }]
          };
        }
      } catch (error) {
        return {
          content: [{ type: 'text', text: `✗ Error: ${error instanceof Error ? error.message : 'Unknown error'}` }]
        };
      }
    }
  • ToolDefinition for update_memory including input schema (key:string required, value:string required, append?:boolean) and metadata.
    export const updateMemoryDefinition: ToolDefinition = {
      name: 'update_memory',
      description: 'update|modify|change|edit memory - Update existing memory',
      inputSchema: {
        type: 'object',
        properties: {
          key: { type: 'string', description: 'Memory key to update' },
          value: { type: 'string', description: 'New value' },
          append: { type: 'boolean', description: 'Append to existing value' }
        },
        required: ['key', 'value']
      },
      annotations: {
        title: 'Update Memory',
        audience: ['user', 'assistant']
      }
    };
  • src/index.ts:646-647 (registration)
    Registers the handler dispatch for 'update_memory' tool in the executeToolCall switch statement.
    case 'update_memory':
      return await updateMemory(args as any) as CallToolResult;
  • src/index.ts:130-130 (registration)
    Adds updateMemoryDefinition to the tools array used for ListToolsRequestHandler.
    updateMemoryDefinition,
  • src/index.ts:68-68 (registration)
    Imports the updateMemory handler and definition from the tool module.
    import { updateMemory, updateMemoryDefinition } from './tools/memory/updateMemory.js';
Behavior3/5

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

The description states 'Update existing memory', which implies a mutation operation, consistent with the tool name. No annotations are provided to contradict this (only a title annotation exists), so there's no contradiction. However, the description lacks behavioral details beyond the basic action—it doesn't specify permissions needed, whether updates are idempotent, error conditions (e.g., if the key doesn't exist), or side effects. With no annotations to rely on, this leaves gaps in understanding the tool's behavior.

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

Conciseness2/5

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

The description is concise but poorly structured and redundant. 'update|modify|change|edit memory' lists synonyms without adding value, and '- Update existing memory' repeats the same idea. This wastes space without improving clarity. A single, clear phrase would be more effective, making this under-specified rather than efficiently concise.

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 (a mutation operation with 3 parameters, no output schema, and no annotations beyond title), the description is incomplete. It doesn't address key contextual aspects like what 'memory' refers to in this system, expected outcomes, error handling, or how it differs from sibling tools. For a tool that modifies data, more guidance is needed to ensure correct usage by an AI agent.

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%, with clear descriptions for 'key', 'value', and 'append' parameters in the input schema. The description adds no additional semantic context about parameters beyond what's already documented in the schema (e.g., it doesn't explain format of 'key' or how 'append' interacts with 'value'). Given the high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract from the schema's documentation.

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

Purpose2/5

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

The description 'update|modify|change|edit memory - Update existing memory' is tautological, essentially restating the tool name 'update_memory' with synonyms. It doesn't specify what type of memory is being updated (e.g., key-value storage, session memory) or what resource is affected, beyond the generic term 'memory'. This provides minimal clarification beyond the name itself.

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?

No guidance is provided on when to use this tool versus alternatives. With sibling tools like 'save_memory', 'delete_memory', 'list_memories', 'recall_memory', 'prioritize_memory', and 'search_memories', the description fails to differentiate this update operation from creation, deletion, retrieval, or other memory manipulations. There's no mention of prerequisites, such as requiring an existing memory key.

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/ssdeanx/ssd-ai'

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