Skip to main content
Glama

session_primer

Restore previous session context by reading the most recent handoff primer at session start.

Instructions

Read the most recent session handoff primer to restore context from the previous session. Call at session start.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler implementation for session_primer which calls readSessionHandoff.
    case 'session_primer': {
      const primer = readSessionHandoff();
      if (!primer) return toTextResult({ message: 'No session primer found. This is the first session.' });
      return toTextResult(primer);
    }
  • Helper function that actually reads the primer.json file.
    function readSessionHandoff() {
      const primerPath = path.join(CONTEXTFS_ROOT, NAMESPACES.session, 'primer.json');
      if (!fs.existsSync(primerPath)) return null;
      try {
        return JSON.parse(fs.readFileSync(primerPath, 'utf8'));
      } catch (_) {
        return null;
      }
    }
  • Tool registration for session_primer.
    readOnlyTool({
      name: 'session_primer',
      description: 'Read the most recent session handoff primer to restore context from the previous session. Call at session start.',
      inputSchema: {
        type: 'object',
        properties: {},
      },
    }),

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

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