Skip to main content
Glama

store_memory

Save important information like preferences, lessons, or project context to persist across AI sessions.

Instructions

Store a memory. Use for preferences, lessons learned, project context, relationship notes, or general information worth remembering across sessions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesThe memory content to store
categoryNoMemory categorygeneral
importanceNoImportance score 1-10 (higher = retrieved more often)
projectNoProject scope for this memory

Implementation Reference

  • The handler function for the 'store_memory' tool. It destructures the validated inputs (content, category, importance, project), calls storage.store() to persist the memory, and returns the generated ID with a success message.
    async ({ content, category, importance, project }) => {
      const id = storage.store(
        content,
        category as MemoryCategory,
        importance,
        project
      );
      return {
        content: [
          {
            type: "text" as const,
            text: JSON.stringify({ id, message: "Memory stored" }),
          },
        ],
      };
    }
  • Input schema for 'store_memory' tool. Defines Zod validations: content (string), category (enum with default 'general'), importance (1-10 number with default 5), and optional project (string).
    {
      content: z.string().describe("The memory content to store"),
      category: z
        .enum(["preference", "lesson", "context", "relationship", "general"])
        .default("general")
        .describe("Memory category"),
      importance: z
        .number()
        .min(1)
        .max(10)
        .default(5)
        .describe("Importance score 1-10 (higher = retrieved more often)"),
      project: z
        .string()
        .optional()
        .describe("Project scope for this memory"),
    },
  • The registerStoreMemory function registers the 'store_memory' tool on the MCP server via server.tool() with its name, description, schema, and handler.
    export function registerStoreMemory(
      server: McpServer,
      storage: RekindleStorage
    ): void {
      server.tool(
        "store_memory",
        "Store a memory. Use for preferences, lessons learned, project context, relationship notes, or general information worth remembering across sessions.",
        {
          content: z.string().describe("The memory content to store"),
          category: z
            .enum(["preference", "lesson", "context", "relationship", "general"])
            .default("general")
            .describe("Memory category"),
          importance: z
            .number()
            .min(1)
            .max(10)
            .default(5)
            .describe("Importance score 1-10 (higher = retrieved more often)"),
          project: z
            .string()
            .optional()
            .describe("Project scope for this memory"),
        },
        async ({ content, category, importance, project }) => {
          const id = storage.store(
            content,
            category as MemoryCategory,
            importance,
            project
          );
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify({ id, message: "Memory stored" }),
              },
            ],
          };
        }
      );
    }
  • src/server.ts:4-4 (registration)
    Import of registerStoreMemory from the tools/store module into the main server file.
    import { registerStoreMemory } from "./tools/store.js";
  • src/server.ts:18-18 (registration)
    Registration call: registerStoreMemory(server, storage) wires the tool into the MCP server on startup.
    registerStoreMemory(server, storage);
  • The RekindleStorage.store() method that persists a memory record to the SQLite database. Generates a unique ID, inserts into the 'memories' table (with FTS trigger), clamps importance to 1-10, and returns the new ID.
    store(
      content: string,
      category: MemoryCategory = "general",
      importance: number = 5,
      project?: string,
      opts?: { type?: string; source?: string; session_id?: string }
    ): string {
      const id = generateId();
      const stmt = this.db.prepare(`
        INSERT INTO memories (id, content, category, importance, project, type, source, session_id)
        VALUES (?, ?, ?, ?, ?, ?, ?, ?)
      `);
      stmt.run(
        id,
        content,
        category,
        Math.max(1, Math.min(10, importance)),
        project ?? null,
        opts?.type ?? "memory",
        opts?.source ?? "manual",
        opts?.session_id ?? null
      );
      return id;
    }
Behavior3/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. It states the action and lists categories, but does not disclose behavioral details such as idempotency, overwrite behavior, or return values, which is a gap for a mutation tool.

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 a single concise sentence followed by a brief list of use cases, with no extraneous information. It is efficiently front-loaded and every part serves a purpose.

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

Completeness4/5

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

For a simple create tool with well-documented schema and sibling tools, the description covers core purpose and categories. However, it omits guidance on the importance and project parameters' role in retrieval, and could better differentiate from 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 coverage is 100% with clear descriptions for each parameter, so the description adds limited additional meaning beyond the schema. The description's examples align with the category enum but do not provide new parameter-level semantics.

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 verb 'store' and resource 'memory', and provides specific use cases (preferences, lessons, project context, relationship notes) that distinguish it from sibling tools like delete_memory or list_memories.

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

Usage Guidelines4/5

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

The description gives explicit use directions ('Use for preferences, lessons...'), implying when to use this tool, but does not explicitly mention when not to use it or directly contrast with siblings like update_memory or search_memory.

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/Skitchy/rekindle'

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