Skip to main content
Glama

list_memories

Retrieve saved memories from the Code-MCP server, with optional filtering by project scope to organize development context.

Instructions

List all saved memories, optionally filtered by project scope.

Input Schema

NameRequiredDescriptionDefault
projectNoFilter by project scope

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "project": { "description": "Filter by project scope", "type": "string" } }, "type": "object" }

Implementation Reference

  • The handler function that reads memories from the persistent JSON file, filters by optional project, formats a markdown list, and returns it.
    export async function listMemoriesHandler(args: any) { await ensureMemoryFile(); const data = JSON.parse(await fs.readFile(MEMORY_FILE, "utf-8")); const entries = Object.entries(data); let filtered = entries; if (args.project) { filtered = entries.filter(([_, v]: [string, any]) => v.project === args.project); } if (filtered.length === 0) { return { content: [{ type: "text", text: "No memories found." }] }; } const list = filtered.map(([key, v]: [string, any]) => `- **${key}**: ${v.value.substring(0, 50)}${v.value.length > 50 ? '...' : ''} (${v.project || 'global'})` ).join("\n"); return { content: [{ type: "text", text: `# Saved Memories\n\n${list}` }] }; }
  • Zod-based input schema defining the optional 'project' parameter for filtering memories.
    export const listMemoriesSchema = { name: "list_memories", description: "List all saved memories, optionally filtered by project scope.", inputSchema: z.object({ project: z.string().optional().describe("Filter by project scope") }) };
  • src/server.ts:100-100 (registration)
    Registration of the list_memories tool in the HTTP server's toolRegistry Map.
    ["list_memories", { schema: listMemoriesSchema, handler: listMemoriesHandler }],
  • src/index.ts:91-91 (registration)
    Registration of the list_memories tool in the MCP server's toolRegistry Map.
    ["list_memories", { schema: listMemoriesSchema, handler: listMemoriesHandler }],

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/millsydotdev/Code-MCP'

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