Skip to main content
Glama

get_project_memory

Retrieve current project memory and session state from the MCP Memory Server to maintain project awareness, track coding sessions, and ensure safety controls for AI coding assistants.

Instructions

Get current project memory and session state

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:592-599 (registration)
    Tool registration in the ListTools response, defining the tool name, description, and empty input schema.
    { name: 'get_project_memory', description: 'Get current project memory and session state', inputSchema: { type: 'object', properties: {} } },
  • MCP CallToolRequest handler implementation that delegates to memoryManager.getProjectMemory() and returns the result as a JSON string in the response format.
    case 'get_project_memory': { const projectMemory = await this.memoryManager.getProjectMemory(); return { content: [{ type: 'text', text: JSON.stringify(projectMemory, null, 2) }] }; }
  • TypeScript interface defining the ProjectMemory structure, which is the output type returned by the tool.
    export interface ProjectMemory { projectContext: { name: string; architecture: string; techStack: string[]; codingStandards?: string; mainBranch?: string; }; currentSession: { sessionId: string; task: string; started: string; completedSteps: SessionStep[]; nextSteps: string[]; importantDecisions: Record<string, any>; blockers?: string[]; }; fileHistory: Record<string, FileHistory>; globalDecisions: Decision[]; approvalStates: Record<string, ApprovalStatus>; }
  • Core helper method that reads the project memory from .ai-memory/project-memory.json file or returns a default ProjectMemory instance if not found or on error.
    // Project Memory Management async getProjectMemory(): Promise<ProjectMemory> { try { await this.ensureMemoryDir(); if (await fs.pathExists(this.projectMemoryPath)) { return await fs.readJson(this.projectMemoryPath); } return this.createDefaultProjectMemory(); } catch (error) { console.error(chalk.red('Error reading project memory:'), error); return this.createDefaultProjectMemory(); } }

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/keleshteri/mcp-memory'

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