Skip to main content
Glama

session_primer

Read-only

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: {},
      },
    }),
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations provide readOnlyHint=true, indicating a safe read operation. The description adds valuable context beyond this by explaining the tool's role in session restoration ('to restore context from the previous session'), which clarifies its behavioral intent without contradicting the annotations. It doesn't detail output format or error handling, but with annotations covering safety, this is sufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences that are front-loaded with essential information: the action and its purpose in the first sentence, and usage timing in the second. Every word earns its place, with no redundancy or fluff, making it highly efficient and easy to parse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, read-only annotation, no output schema), the description is complete enough for an AI agent to understand when and how to use it. It covers purpose, timing, and context restoration, though it doesn't specify output format or error cases, which is acceptable given the low complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, so no parameter documentation is needed. The description appropriately doesn't discuss parameters, focusing instead on the tool's purpose and usage. This meets the baseline for tools with no parameters, as it avoids unnecessary details.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verbs ('Read', 'restore context') and identifies the resource ('most recent session handoff primer'). It distinguishes itself from siblings like 'session_handoff' or 'start_handoff' by focusing on context restoration rather than handoff initiation or execution.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use the tool ('Call at session start') and implies when not to use it (e.g., not during ongoing sessions). It distinguishes from alternatives by specifying it reads the 'most recent' primer, suggesting other tools might handle different contexts or timings.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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