Skip to main content
Glama

update_memory

Idempotent

Modify existing stored data by editing values or appending new information to memory keys in the Hi-AI system.

Instructions

수정해|업데이트|바꿔|update|change|modify|edit - Update existing memory

Input Schema

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

Implementation Reference

  • The main handler function that performs the update_memory tool logic: checks if memory exists, appends or replaces value using MemoryManager, returns success/error message.
    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'}` }]
        };
      }
    }
  • Input schema and metadata definition for the update_memory tool.
    export const updateMemoryDefinition: ToolDefinition = {
      name: 'update_memory',
      description: '수정해|업데이트|바꿔|update|change|modify|edit - 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'],
        readOnlyHint: false,
        destructiveHint: false,
        idempotentHint: true,
        openWorldHint: false
      }
    };
  • src/index.ts:93-99 (registration)
    Registration of updateMemoryDefinition in the tools array used for ListToolsRequest.
    // Memory Management - Basic (6)
    saveMemoryDefinition,
    recallMemoryDefinition,
    updateMemoryDefinition,
    deleteMemoryDefinition,
    listMemoriesDefinition,
    prioritizeMemoryDefinition,
  • src/index.ts:160-166 (registration)
    Registration of updateMemory handler in the toolHandlers object for dynamic dispatch during CallToolRequest.
    // Memory - Basic
    'save_memory': saveMemory,
    'recall_memory': recallMemory,
    'update_memory': updateMemory,
    'delete_memory': deleteMemory,
    'list_memories': listMemories,
    'prioritize_memory': prioritizeMemory,
  • src/index.ts:46-46 (registration)
    Import statement bringing in the tool definition and handler from the implementation file.
    import { updateMemoryDefinition, updateMemory } from './tools/memory/updateMemory.js';
Behavior4/5

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

The description doesn't contradict the annotations, which already provide comprehensive behavioral information: readOnlyHint=false (mutation), openWorldHint=false (closed system), idempotentHint=true (safe to retry), destructiveHint=false (non-destructive). The description adds no additional behavioral context beyond what annotations provide, but since annotations cover key aspects, this is acceptable. No rate limits, authentication needs, or specific side effects are mentioned.

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 inefficiently structured with redundant synonyms ('수정해|업데이트|바꿔|update|change|modify|edit') that don't add value. Only the final phrase 'Update existing memory' carries meaningful content. The front-loaded multilingual repetition wastes space without improving clarity.

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

Completeness3/5

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

Given the annotations provide good behavioral coverage (mutation, idempotent, non-destructive) and schema coverage is complete, the description is minimally adequate for a simple update operation. However, without an output schema and with no description of return values or error conditions, there are gaps. The description should ideally clarify what constitutes 'memory' in this system 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%, with all three parameters ('key', 'value', 'append') fully documented in the schema. The description adds no parameter information beyond what the schema provides. According to scoring rules, when schema coverage is high (>80%), the baseline is 3 even with no param info in the description.

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 is tautological, primarily restating the tool name ('update') with synonyms in multiple languages. It doesn't specify what 'memory' refers to in this context or what kind of update operation is performed. While it distinguishes from siblings like 'delete_memory' and 'save_memory' by being an update operation, it lacks specificity about the resource being modified.

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 about when to use this tool versus alternatives. The description doesn't mention prerequisites, appropriate contexts, or comparisons with sibling tools like 'save_memory' or 'delete_memory'. The agent receives no usage instructions beyond the basic operation implied by the name.

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/su-record/hi-ai'

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