list_memories
List all stored memories in a project with stats on namespace, type, key, and priority. Use this to review and understand what knowledge is stored.
Instructions
List all stored memories for the current project with stats. Shows namespace, type, key, priority. Useful for understanding what knowledge is stored.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| namespace | No | Filter by namespace | |
| projectId | No | Project ID (defaults to current project) |
Implementation Reference
- server/src/mcp/tools.js:522-564 (handler)The tool handler for 'list_memories' — registers with server.tool(), receives optional namespace and projectId params, calls memoryService.list() and memoryService.getStats(), returns JSON with stats and memories (mapped to namespace, type, key, priority, confidence, updatedAt, expires).
// ─── list_memories ────────────────────────────────────────────── server.tool( 'list_memories', 'List all stored memories for the current project with stats. Shows namespace, type, key, priority. Useful for understanding what knowledge is stored.', { namespace: z.string().optional().describe('Filter by namespace'), projectId: z.string().optional().describe('Project ID (defaults to current project)'), }, async ({ namespace, projectId }) => { try { const { memoryService, currentProjectId } = await getServices() const targetProjectId = projectId || currentProjectId const [memories, stats] = await Promise.all([ memoryService.list({ projectId: targetProjectId, namespace }), memoryService.getStats(targetProjectId), ]) return { content: [{ type: 'text', text: JSON.stringify({ projectId: targetProjectId, stats, memories: memories.map(m => ({ namespace: m.namespace, type: m.memory_type, key: m.key, priority: m.priority, confidence: m.confidence, updatedAt: m.updated_at, expires: m.expires_at, })), }, null, 2), }], } } catch (error) { return { content: [{ type: 'text', text: `Error listing memories: ${error.message}` }], isError: true, } } } - server/src/mcp/tools.js:526-529 (schema)Input schema for list_memories using Zod: namespace (optional string) and projectId (optional string).
{ namespace: z.string().optional().describe('Filter by namespace'), projectId: z.string().optional().describe('Project ID (defaults to current project)'), }, - server/src/mcp/index.js:106-108 (registration)Registration call: registerTools(server, getServices) connects the tools module to the MCP server, executed at server startup.
registerTools(server, getServices) registerResources(server, getServices) registerPrompts(server)