Skip to main content
Glama

memory

Store and retrieve temporary key-value data during development workflows, supporting set, get, list, delete, search, and clear operations with tag-based organization.

Instructions

Store and retrieve temporary key-value pairs in memory (data is lost on MCP server restart)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
actionYesMemory operation to perform
keyNoKey for the memory entry
valueNoValue to store (required for set action)
tagsNoTags for categorization
patternNoSearch pattern (for search action)

Implementation Reference

  • MemoryTool class with execute method implementing the core dispatching logic for memory operations (set, get, list, delete, search, clear).
    class MemoryTool {
      execute(args: MemoryOptions): CallToolResult {
        try {
          switch (args.action) {
            case 'set':
              return this.setMemory(args);
            case 'get':
              return this.getMemory(args);
            case 'list':
              return this.listMemories(args);
            case 'delete':
              return this.deleteMemory(args);
            case 'search':
              return this.searchMemories(args);
            case 'clear':
              return this.clearMemories();
            default:
              return createErrorResult('Memory', `Unknown action: ${String(args.action)}`);
          }
        } catch (error) {
          return createErrorResult('Memory', error);
        }
      }
  • src/index.ts:126-139 (registration)
    MCP server registration of the 'memory' tool, including description, Zod input schema, and reference to the memory handler function.
    server.registerTool(
      'memory',
      {
        description: 'Store and retrieve temporary key-value pairs in memory (data is lost on MCP server restart)',
        inputSchema: {
          action: z.enum(['set', 'get', 'list', 'delete', 'search', 'clear']).describe('Memory operation to perform'),
          key: z.string().optional().describe('Key for the memory entry'),
          value: z.string().optional().describe('Value to store (required for set action)'),
          tags: z.array(z.string()).optional().describe('Tags for categorization'),
          pattern: z.string().optional().describe('Search pattern (for search action)'),
        },
      },
      (args) => Promise.resolve(memory(args))
    );
  • Zod inputSchema defining validation for memory tool parameters: action, key, value, tags, pattern.
    inputSchema: {
      action: z.enum(['set', 'get', 'list', 'delete', 'search', 'clear']).describe('Memory operation to perform'),
      key: z.string().optional().describe('Key for the memory entry'),
      value: z.string().optional().describe('Value to store (required for set action)'),
      tags: z.array(z.string()).optional().describe('Tags for categorization'),
      pattern: z.string().optional().describe('Search pattern (for search action)'),
    },
  • TypeScript interface MemoryOptions used to type the memory tool arguments, matching the Zod schema.
    export interface MemoryOptions {
      action: 'set' | 'get' | 'list' | 'delete' | 'search' | 'clear';
      key?: string;
      value?: string;
      tags?: string[];
      pattern?: string;  // for search
    }
  • In-memory storage using Map<string, MemoryEntry> that persists data across tool calls during server lifetime.
    const memoryStore = new Map<string, MemoryEntry>();
Behavior3/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does reveal the critical behavioral trait that 'data is lost on MCP server restart' which is essential for understanding the tool's limitations. However, it doesn't cover other important behaviors like performance characteristics, concurrency considerations, or error handling.

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

Conciseness5/5

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

The description is extremely concise - a single sentence that efficiently communicates both the core functionality and a critical limitation. Every word earns its place, and the most important information (data persistence characteristic) is included upfront.

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 tool's moderate complexity (5 parameters, multiple actions) and no annotations or output schema, the description provides the minimum viable information. It covers the basic purpose and a key limitation but lacks details about return values, error conditions, or operational constraints that would be helpful for 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?

The schema description coverage is 100%, so the schema already documents all 5 parameters thoroughly. The description doesn't add any parameter-specific information beyond what's in the schema. The baseline of 3 is appropriate when the schema does the heavy lifting for parameter documentation.

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

Purpose5/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 specific verbs ('store and retrieve') and resource ('temporary key-value pairs in memory'), plus it distinguishes this tool from siblings by specifying the data persistence characteristic ('data is lost on MCP server restart'). This goes beyond just restating the name 'memory'.

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 no guidance on when to use this tool versus alternatives. It doesn't mention any sibling tools or other memory/storage options, nor does it specify prerequisites, constraints, or typical use cases beyond the basic functionality.

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/jaggederest/mcp_reviewer'

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