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
| Name | Required | Description | Default |
|---|---|---|---|
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: {} } },
- src/index.ts:811-814 (handler)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) }] }; }
- src/types.ts:70-90 (schema)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>; }
- src/memory-manager.ts:75-87 (helper)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(); } }