Skip to main content
Glama

end_session

Capture a structured session handoff—checkpoint, decisions, open loops, and warnings—to local storage so the next session resumes with full context and no lost threads.

Instructions

Capture a structured session handoff. Writes multiple records to the local SQLite database: one checkpoint (required), plus optional decisions, open loops, preferences, constraints, warnings, relational delta, and next session focus. Each record is stored with a typed 'type' column (not content prefixes) and linked to a session record via session_id. Also creates a session row in the sessions table with a summary, orientation score, and gap count. The checkpoint is retrievable by boot_report on the next session start. All records are searchable via search_memory and list_memories. Workflow: call end_session at the end of every substantive session so the next session can pick up the thread.

Input Schema

NameRequiredDescriptionDefault
projectNoProject name to scope all records to. Passed through to each stored memory's project field.
warningsNoHazards or risks the next session should be aware of. Each entry is stored as type='warning' with importance 8.
decisionsNoKey decisions made this session and their rationale. Each entry is stored as a separate memory with type='decision' and importance 7.
checkpointYesWhere we left off — the single most important handoff artifact. Stored as type='checkpoint' with importance 8. This is what boot_report loads as the latest checkpoint on the next session start.
open_loopsNoUnresolved questions, pending tasks, or threads that need follow-up. Each entry is stored as type='open_loop' with importance 7.
provenanceNoWrite attribution applied to every record. Required when REKINDLE_REQUIRE_WRITE_PROVENANCE=1; never proof of authorization.
session_idNoCurrent session ID. Used to check for unreviewed PreCompact captures. If captures exist for this session that were not read via read_capture, a warning is included in the response.
constraintsNoBoundaries that must not be violated — violating these causes trust damage. Each entry is stored as type='constraint' with importance 9 (highest default).
preferencesNoNew user preferences or working style observations learned this session. Each entry is stored as type='preference' with importance 6.
transcript_pathNoFile path to the session transcript, stored on the session record for reference by boot_report.
relational_deltaNoWhat changed in the working relationship this session — trust shifts, tension, repair, tone changes. Stored as type='relational_delta' with importance 8.
next_session_focusNoWhere to resume next session, which may differ from where we stopped. Stored as type='next_session_focus' with importance 7.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.1
    • addedInput schema / properties / provenance
      Added value: +{
      +  "description": "Write attribution applied to every record. Required when REKINDLE_REQUIRE_WRITE_PROVENANCE=1; never proof of authorization.",
      +  "properties": {
      +    "author_identity": {
      +      "description": "Claimed writer identity; attribution, not authentication.",
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "authorization_reference": {
      +      "description": "Caller-supplied authority reference. Stored as unverified and never treated as authorization.",
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "client": {
      +      "description": "Client performing the write, for attribution only.",
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "request_id": {
      +      "description": "Unique caller request identifier.",
      +      "minLength": 1,
      +      "type": "string"
      +    },
      +    "thread_id": {
      +      "description": "Calling thread or session identifier.",
      +      "minLength": 1,
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "client",
      +    "thread_id",
      +    "request_id",
      +    "author_identity",
      +    "authorization_reference"
      +  ],
      +  "type": "object"
      +}
  2. Changed11 schema fields changedv0.3.0
    • changedInput schema / properties / checkpoint / description
      Previous value: -"Where we left off — the single most important handoff artifact"New value: +"Where we left off — the single most important handoff artifact. Stored as type='checkpoint' with importance 8. This is what boot_report loads as the latest checkpoint on the next session start."
    • changedInput schema / properties / constraints / description
      Previous value: -"Boundaries that must not be violated — violating these causes trust damage"New value: +"Boundaries that must not be violated — violating these causes trust damage. Each entry is stored as type='constraint' with importance 9 (highest default)."
    • changedInput schema / properties / decisions / description
      Previous value: -"What was decided and why"New value: +"Key decisions made this session and their rationale. Each entry is stored as a separate memory with type='decision' and importance 7."
    • changedInput schema / properties / next_session_focus / description
      Previous value: -"Where to resume next session (vs where we stopped)"New value: +"Where to resume next session, which may differ from where we stopped. Stored as type='next_session_focus' with importance 7."
    • changedInput schema / properties / open_loops / description
      Previous value: -"Unresolved questions or tasks"New value: +"Unresolved questions, pending tasks, or threads that need follow-up. Each entry is stored as type='open_loop' with importance 7."
    • changedInput schema / properties / preferences / description
      Previous value: -"New user preferences learned this session"New value: +"New user preferences or working style observations learned this session. Each entry is stored as type='preference' with importance 6."
    • changedInput schema / properties / project / description
      Previous value: -"Project scope"New value: +"Project name to scope all records to. Passed through to each stored memory's project field."
    • changedInput schema / properties / relational_delta / description
      Previous value: -"What changed in the working relationship this session — trust changes, tension, repair, tone shifts"New value: +"What changed in the working relationship this session — trust shifts, tension, repair, tone changes. Stored as type='relational_delta' with importance 8."
    • addedInput schema / properties / session_id
      Added value: +{
      +  "description": "Current session ID. Used to check for unreviewed PreCompact captures. If captures exist for this session that were not read via read_capture, a warning is included in the response.",
      +  "type": "string"
      +}
    • changedInput schema / properties / transcript_path / description
      Previous value: -"Path to session transcript file"New value: +"File path to the session transcript, stored on the session record for reference by boot_report."
    • changedInput schema / properties / warnings / description
      Previous value: -"Things the next session should be careful about"New value: +"Hazards or risks the next session should be aware of. Each entry is stored as type='warning' with importance 8."
  3. First observedv0.2.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the burden well: it discloses that multiple rows are written across two tables, that each entry becomes a typed record with a default importance (constraints=9, warnings/relational_delta=8, decisions/open_loops/next_session_focus=7, preferences=6), and that session_id triggers a warning about unreviewed PreCompact captures. It does not discuss idempotency, duplicate handling on repeat calls, or error behavior on partial writes, which keeps it from a 5.

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

Conciseness4/5

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

Front-loaded with the purpose, then behavior, then workflow — a sensible ordering with no filler sentences. It is on the long side for a description, and the type/importance enumeration partly duplicates schema descriptions, but each sentence still carries information an agent needs.

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?

For a 12-parameter mutation tool with a nested object, no annotations, and no output schema, the description covers write targets, linkage, retrieval paths, and the one response caveat (unreviewed capture warning). What it omits is the actual response shape and failure/duplicate semantics, which matters somewhat since no output schema exists.

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

Parameters3/5

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

Schema coverage is 100%, so the schema already documents all 12 parameters including the nested provenance object. The description mostly restates that shape (checkpoint required, the rest optional) and adds only marginal meaning beyond it, such as the fact that checkpoint is what boot_report loads next session. Baseline 3 is appropriate when the schema does the heavy lifting.

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?

States a specific verb and resource ('Capture a structured session handoff') and then enumerates exactly what gets written: one required checkpoint plus optional typed records and a session row. The typed-column / session_id linkage detail separates it cleanly from store_memory, which writes individual memories.

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?

Gives an explicit workflow directive — 'call end_session at the end of every substantive session' — which is clear positive guidance. It also names the downstream consumers (boot_report, search_memory, list_memories). It never says when NOT to use it or explicitly contrasts with store_memory for single-record writes, so the sibling routing is implied rather than stated.

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