Skip to main content
Glama

session_save_handoff

Save the current session's context, TODOs, and summary as the live handoff for the next session. Supports automatic conflict resolution via CRDT merge or strict OCC with version control.

Instructions

Upsert the latest project handoff state for the next session to consume on boot. This is the 'live context' that gets loaded when a new session starts. Calling this replaces the previous handoff for the same project (upsert on project).

v5.4 CRDT Merge: On version conflict, a CRDT OR-Map engine automatically merges your changes with concurrent work (Add-Wins OR-Set for arrays, Last-Writer-Wins for scalars). Pass expected_version to enable concurrency control.

v0.4.0 OCC: If you received a version number from session_load_context, /resume_session prompt, or memory resource attachment, you MUST pass it as expected_version to prevent overwriting another session's changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
roleNoOptional. Agent role for Hivemind scoping (e.g., 'dev', 'qa', 'pm'). Omit to let the server auto-resolve from dashboard settings.
projectYesProject identifier — must match the project used in session_save_ledger.
open_todosNoCurrent open TODO items that need attention in the next session.
key_contextNoFree-form critical context the next session needs to know.
last_summaryNoSummary of the most recent session — used for quick context recovery.
active_branchNoGit branch or context the next session should resume on.
disable_mergeNoSet to true to disable automatic CRDT merging and fail strictly on version conflict (original OCC behavior). Default: false.
expected_versionNov0.4.0: The version number you received when loading context. Pass this to enable optimistic concurrency control. If omitted, version check is skipped (backward compatible).
Behavior4/5

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

With no annotations provided, the description carries full responsibility for behavioral disclosure. It reveals the upsert semantics (replaces previous handoff), the automatic CRDT merge on version conflict, and the optional OCC via expected_version. It does not mention auth requirements, rate limits, or error responses, but the concurrency behavior is well-explained.

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 divided into three focused paragraphs: purpose, CRDT merge logic, and OCC version control. It is front-loaded with the core action ('Upsert the latest project handoff state') and avoids unnecessary words. Every sentence adds value, making it concise yet informative.

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 8 parameters and no output schema, the description covers core usage and concurrency details well. However, it omits information about the return value or error handling (e.g., what happens on version conflict if merge is disabled). The schema descriptions fill parameter gaps, but the overall completeness is slightly hindered by missing return expectations.

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

Parameters5/5

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

The input schema covers 100% of parameters with descriptions, and the description adds substantial context beyond schema explanations. It explains the significance of expected_version (OCC), disable_merge (to opt out of CRDT), and the role of project (must match session_save_ledger). This enriches the schema with behavioral intent.

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 it performs an 'Upsert' of the latest project handoff state for the next session, calling it the 'live context' loaded on boot. It effectively distinguishes itself from siblings like session_load_context (which loads) and session_save_ledger (a different kind of save), making its specific resource and action unambiguous.

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

Usage Guidelines4/5

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

The description explicitly instructs on when to pass expected_version (when received from session_load_context, /resume_session, or memory attachment) and warns against overwriting concurrent changes. It also explains the CRDT merge behavior and when to disable it. However, it does not contrast this tool with other save tools like session_save_experience, leaving a gap in distinguishing use cases.

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/dcostenco/prism-coder'

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