Skip to main content
Glama

list_memories

Retrieve saved memories from previous sessions to avoid re-explaining context. Filter by category or project.

Instructions

List stored memories, optionally filtered by category or project. Returns newest first.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryNoFilter by category
projectNoFilter by project
limitNoMaximum results to return

Implementation Reference

  • The registerListMemories function registers the 'list_memories' tool with an McpServer. It defines a Zod schema for optional 'category' (enum of 5 values), optional 'project' string, and 'limit' (default 50, max 200). The handler calls storage.list() with these filters and returns the results as JSON with count and mapped memory fields.
    export function registerListMemories(
      server: McpServer,
      storage: RekindleStorage
    ): void {
      server.tool(
        "list_memories",
        "List stored memories, optionally filtered by category or project. Returns newest first.",
        {
          category: z
            .enum(["preference", "lesson", "context", "relationship", "general"])
            .optional()
            .describe("Filter by category"),
          project: z.string().optional().describe("Filter by project"),
          limit: z
            .number()
            .min(1)
            .max(200)
            .default(50)
            .describe("Maximum results to return"),
        },
        async ({ category, project, limit }) => {
          const memories = storage.list({ category, project, limit });
          return {
            content: [
              {
                type: "text" as const,
                text: JSON.stringify({
                  count: memories.length,
                  memories: memories.map((m) => ({
                    id: m.id,
                    content: m.content,
                    category: m.category,
                    importance: m.importance,
                    project: m.project,
                    created_at: m.created_at,
                  })),
                }),
              },
            ],
          };
        }
      );
    }
  • Zod schema for 'list_memories' tool input: category (optional enum of preference/lesson/context/relationship/general), project (optional string), limit (number, 1-200, default 50).
    "list_memories",
    "List stored memories, optionally filtered by category or project. Returns newest first.",
    {
      category: z
        .enum(["preference", "lesson", "context", "relationship", "general"])
        .optional()
        .describe("Filter by category"),
      project: z.string().optional().describe("Filter by project"),
      limit: z
        .number()
        .min(1)
        .max(200)
        .default(50)
        .describe("Maximum results to return"),
    },
  • src/server.ts:6-6 (registration)
    Import of registerListMemories from './tools/list.js'.
    import { registerListMemories } from "./tools/list.js";
  • src/server.ts:20-20 (registration)
    Registration call: registerListMemories(server, storage) registers the 'list_memories' tool on the McpServer instance.
    registerListMemories(server, storage);
  • The storage.list() method implementation. Builds a SQL SELECT from memories WITH optional category and project filters, orders by created_at DESC, rowid DESC, and limits results. Returns Memory[] array.
    list(
      opts: { category?: string; project?: string; limit?: number } = {}
    ): Memory[] {
      const limit = opts.limit ?? 50;
    
      let sql = `SELECT * FROM memories WHERE 1=1`;
      const params: (string | number)[] = [];
    
      if (opts.category) {
        sql += ` AND category = ?`;
        params.push(opts.category);
      }
      if (opts.project) {
        sql += ` AND project = ?`;
        params.push(opts.project);
      }
    
      sql += ` ORDER BY created_at DESC, rowid DESC LIMIT ?`;
      params.push(limit);
    
      return this.db.prepare(sql).all(...params) as Memory[];
    }
Behavior3/5

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

Discloses ordering ('newest first') and filtering capability, but does not mention pagination behavior, return format, or whether full memory objects are returned. No annotations provided to fill gaps.

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?

Two sentences with no extraneous words. Front-loaded with key information.

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?

Adequate for a simple list tool. Missing description of return shape (e.g., array of memory objects), but ordering is mentioned. With no output schema, a bit more detail could help, but it's nearly complete.

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 covers all parameters with descriptions (100% coverage). Description adds only ordering context, not parameter details. Baseline score of 3 applies.

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?

Clearly states 'List stored memories' with filtering options and ordering. Differentiates from siblings like search_memory (which likely does keyword search) and store_memory.

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

Usage Guidelines3/5

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

Implies usage for listing memories with optional filters, but does not explicitly state when to use this tool vs. search_memory or other siblings.

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