update_session_summary
Append current session information to the session summary file to maintain ongoing context without performing a full session closure.
Instructions
Update the session summary file with current session info without doing a full session close.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| summary | Yes | Session summary text to append to session-summary.md |
Implementation Reference
- src/session-closer.ts:82-100 (handler)Core implementation of the updateSessionSummary tool. Appends a formatted session entry to .agent-os/session-summary.md after ensuring the directory exists and handling missing files.private async updateSessionSummary(summary: SessionSummary): Promise<void> { const summaryPath = path.join(this.projectRoot, '.agent-os', 'session-summary.md'); // Ensure directory exists await fs.mkdir(path.dirname(summaryPath), { recursive: true }); let existingContent = ''; try { existingContent = await fs.readFile(summaryPath, 'utf-8'); } catch { // File doesn't exist, create it existingContent = '# Session Summary\n\n'; } const sessionEntry = this.formatSessionEntry(summary); const updatedContent = existingContent + '\n' + sessionEntry; await fs.writeFile(summaryPath, updatedContent, 'utf-8'); }
- src/index.ts:85-98 (registration)Registers the 'update_session_summary' tool in the MCP server's listTools handler, defining its name, description, and input schema.{ name: 'update_session_summary', description: 'Update the session summary file with current session info without doing a full session close.', inputSchema: { type: 'object', properties: { summary: { type: 'string', description: 'Session summary text to append to session-summary.md', }, }, required: ['summary'], }, },
- src/index.ts:159-182 (handler)MCP CallToolRequest handler for 'update_session_summary'. Creates a default empty SessionSummary object and delegates to SessionCloser.updateSessionSummary().case 'update_session_summary': { const summary = { timestamp: new Date().toISOString(), accomplishments: [], decisions: [], blockers: [], nextSteps: [], filesChanged: [], }; await (this.sessionCloser as any).updateSessionSummary(summary); return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: 'Session summary updated!', }), }, ], }; }
- src/types.ts:1-8 (schema)Type definition for SessionSummary used as input parameter for the updateSessionSummary handler.export interface SessionSummary { timestamp: string; accomplishments: string[]; decisions: Decision[]; blockers: string[]; nextSteps: string[]; filesChanged: string[]; }