Skip to main content
Glama

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
NameRequiredDescriptionDefault
summaryYesSession summary text to append to session-summary.md

Implementation Reference

  • 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'], }, },
  • 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!', }), }, ], }; }
  • 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[]; }

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/Tylarcam/mcp-session-closer'

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