Skip to main content
Glama

save_memory

Store information to long-term memory with categorized keys for future retrieval in AI development workflows.

Instructions

remember|save|store|memorize|keep - Save to long-term memory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesMemory key/identifier
valueYesInformation to save
categoryNoMemory category

Implementation Reference

  • The core execution function for the 'save_memory' tool. It destructures args, uses MemoryManager singleton to save the memory entry, and returns success or error message.
    export async function saveMemory(args: { key: string; value: string; category?: string }): Promise<ToolResult> {
      const { key: memoryKey, value: memoryValue, category = 'general' } = args;
    
      try {
        const memoryManager = MemoryManager.getInstance();
        memoryManager.save(memoryKey, memoryValue, category);
    
        return {
          content: [{ type: 'text', text: `✓ Saved: ${memoryKey}\nCategory: ${category}` }]
        };
      } catch (error) {
        return {
          content: [{ type: 'text', text: `✗ Error: ${error instanceof Error ? error.message : 'Unknown error'}` }]
        };
      }
    }
  • The ToolDefinition object defining the name, description, input schema (with required key/value and optional category), and annotations for the 'save_memory' tool.
    export const saveMemoryDefinition: ToolDefinition = {
      name: 'save_memory',
      description: 'remember|save|store|memorize|keep - Save to long-term memory',
      inputSchema: {
        type: 'object',
        properties: {
          key: { type: 'string', description: 'Memory key/identifier' },
          value: { type: 'string', description: 'Information to save' },
          category: { type: 'string', description: 'Memory category', enum: ['project', 'personal', 'code', 'notes'] }
        },
        required: ['key', 'value']
      },
      annotations: {
        title: 'Save Memory',
        audience: ['user', 'assistant']
      }
    };
  • src/index.ts:636-637 (registration)
    Registration and dispatch of the 'save_memory' handler within the central executeToolCall switch statement in the MCP server.
    case 'save_memory':
      return await saveMemory(args as any) as CallToolResult;
  • src/index.ts:125-125 (registration)
    Inclusion of the saveMemoryDefinition in the tools array, making it discoverable via listTools MCP capability.
    saveMemoryDefinition,
Behavior3/5

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

Annotations provide only a title, so the description carries the full burden. It indicates this is a write operation ('save'), but doesn't disclose behavioral traits like persistence guarantees, overwrite behavior, or access controls. The description adds minimal context beyond the basic action.

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 extremely concise with a single phrase using synonyms, making it front-loaded and efficient. However, the pipe-separated synonyms ('remember|save|store|memorize|keep') feel slightly redundant rather than additive, slightly reducing clarity.

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?

For a write operation with no annotations and no output schema, the description is insufficient. It lacks crucial context about what 'saving to long-term memory' entails operationally—such as success indicators, error conditions, or how this differs from sibling tools like 'update_memory'.

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 parameters are well-documented in the schema. The description adds no additional meaning about parameters like key/value semantics or category usage. Baseline score of 3 is appropriate since the schema handles parameter documentation adequately.

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 tool's purpose with multiple synonyms for 'save' and specifies the target as 'long-term memory', making it evident this is a storage operation. However, it doesn't differentiate from sibling tools like 'update_memory' or 'prioritize_memory', which prevents a perfect score.

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 like 'update_memory' or 'prioritize_memory'. The description merely restates the action without context about appropriate scenarios or exclusions, leaving the agent to infer usage.

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