Skip to main content
Glama

mem_session

Record verified root session lifecycle events like enroll, checkpoint, and finalize for AI coding agents. Capture compaction state with durable summaries instead of ordinary saves.

Instructions

Record verified root lifecycle events, never ordinary saves. guide_post_compact content carries host compaction text.

Input Schema

NameRequiredDescriptionDefault
contentNo
harnessYesVerified native harness.
summaryNoSession summary.
event_keyYesStable lifecycle key; retries must resend identical content/summary.
operationYesRoot lifecycle operation.
project_keyYesVerified project_key, copied verbatim; never derived.
project_nameYesDisplay/creation name, not identity; prefer persisted lifecycle/project name.
root_session_keyYesStable verified root session key.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed27 schema fields changedv0.6.2
    • removedInput schema / properties / event_key / minLength
      Removed value: -1
    • removedInput schema / properties / project_key / minLength
      Removed value: -1
    • changedInput schema / properties / project_name / description
      Previous value: -"Display/creation metadata only, not identity; prefer the persisted name from lifecycle/project output."New value: +"Display/creation name, not identity; prefer persisted lifecycle/project name."
    • removedInput schema / properties / project_name / minLength
      Removed value: -1
    • removedInput schema / properties / root_session_key / minLength
      Removed value: -1
    • removedInput schema / properties / summary / additionalProperties
      Removed value: -false
    • removedInput schema / properties / summary / properties / claims / items / additionalProperties
      Removed value: -false
    • removedInput schema / properties / summary / properties / claims / items / properties / content / minLength
      Removed value: -1
    • changedInput schema / properties / summary / properties / claims / items / properties / support_ids / description
      Previous value: -"Distinct evidence ids inside coverage from this project_key + root_session_key/harness session; never memory, summary, or observation ids."New value: +"Distinct same-session evidence ids within coverage; no memory/summary/observation ids."
    • removedInput schema / properties / summary / properties / claims / items / properties / support_ids / items / maxLength
      Removed value: -200
    • removedInput schema / properties / summary / properties / claims / items / properties / support_ids / items / minLength
      Removed value: -1
    • removedInput schema / properties / summary / properties / claims / items / properties / support_ids / maxItems
      Removed value: -16
    • removedInput schema / properties / summary / properties / claims / items / properties / support_ids / minItems
      Removed value: -1
    • removedInput schema / properties / summary / properties / claims / maxItems
      Removed value: -32
    • removedInput schema / properties / summary / properties / claims / minItems
      Removed value: -1
    • removedInput schema / properties / summary / properties / coverage / additionalProperties
      Removed value: -false
    • removedInput schema / properties / summary / properties / coverage / properties / from_sequence / exclusiveMinimum
      Removed value: -0
    • removedInput schema / properties / summary / properties / coverage / properties / from_sequence / maximum
      Removed value: -9007199254740991
    • changedInput schema / properties / summary / properties / coverage / properties / to_sequence / description
      Previous value: -"Last sequence: >= from_sequence and >= the current summary's ending sequence for this session."New value: +">= from_sequence and the previous summary end."
    • removedInput schema / properties / summary / properties / coverage / properties / to_sequence / exclusiveMinimum
      Removed value: -0
    • removedInput schema / properties / summary / properties / coverage / properties / to_sequence / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / summary / properties / generator / additionalProperties
      Removed value: -false
    • removedInput schema / properties / summary / properties / generator / properties / config_hash / pattern
      Removed value: -"^[0-9a-f]{64}$"
    • removedInput schema / properties / summary / properties / generator / properties / name / maxLength
      Removed value: -200
    • removedInput schema / properties / summary / properties / generator / properties / name / minLength
      Removed value: -1
    • removedInput schema / properties / summary / properties / generator / properties / version / maxLength
      Removed value: -200
    • removedInput schema / properties / summary / properties / generator / properties / version / minLength
      Removed value: -1
  2. Changed15 schema fields changedv0.6.1
    • changedInput schema / properties / event_key / description
      Previous value: -"Stable lifecycle event key; retries for the same operation must resend identical content/summary."New value: +"Stable lifecycle key; retries must resend identical content/summary."
    • changedInput schema / properties / harness / description
      Previous value: -"Verified native harness for root_session_key in project_key."New value: +"Verified native harness."
    • changedInput schema / properties / operation / description
      Previous value: -"Lifecycle operation; summary is allowed only for checkpoint_pre_compact (checkpoint) or finalize (final)."New value: +"Root lifecycle operation."
    • changedInput schema / properties / project_key / description
      Previous value: -"Exact opaque project_key copied verbatim from verified native identity; never derive it from a display name, path hint, remote, branch, worktree name, host ID, listing, or recalled content."New value: +"Verified project_key, copied verbatim; never derived."
    • changedInput schema / properties / project_name / description
      Previous value: -"Creation/display metadata only; never participates in project identity equality. Prefer the database-persisted name returned by lifecycle or project output."New value: +"Display/creation metadata only, not identity; prefer the persisted name from lifecycle/project output."
    • changedInput schema / properties / root_session_key / description
      Previous value: -"Stable verified root session key; required with harness for every operation."New value: +"Stable verified root session key."
    • changedInput schema / properties / summary / description
      Previous value: -"Optional only for operation=\"checkpoint_pre_compact\" (kind=\"checkpoint\") or operation=\"finalize\" (kind=\"final\"). coverage starts at 1 and to_sequence must advance the current summary for this session and kind. support_ids must be evidence ids from this project_key + root_session_key/harness session inside coverage. Canonical submission limit: 20000 UTF-16 units."New value: +"Session summary."
    • changedInput schema / properties / summary / properties / claims / description
      Previous value: -"1-32 atomic supported claims; keep the canonical summary within 20000 UTF-16 units."New value: +"Supported claims; canonical summary <=20000 UTF-16 units."
    • changedInput schema / properties / summary / properties / claims / items / properties / content / description
      Previous value: -"Atomic claim content; at most 2000 code points after privacy filtering."New value: +"Atomic claim; <=2000 code points after privacy filtering."
    • changedInput schema / properties / summary / properties / claims / items / properties / support_ids / description
      Previous value: -"1-16 distinct evidence ids from this project_key + root_session_key/harness session inside summary.coverage; never memory, summary, or observation ids."New value: +"Distinct evidence ids inside coverage from this project_key + root_session_key/harness session; never memory, summary, or observation ids."
    • changedInput schema / properties / summary / properties / coverage / description
      Previous value: -"Inclusive session evidence coverage; start at 1 and advance to_sequence for this session and summary kind."New value: +"Inclusive session evidence range."
    • changedInput schema / properties / summary / properties / coverage / properties / from_sequence / description
      Previous value: -"Inclusive first session event sequence; must start at 1."New value: +"First event sequence: 1."
    • changedInput schema / properties / summary / properties / coverage / properties / to_sequence / description
      Previous value: -"Inclusive last session event sequence; must be >= from_sequence and exceed the current summary ending sequence for this session and kind."New value: +"Last sequence: >= from_sequence and >= the current summary's ending sequence for this session."
    • removedInput schema / properties / summary / properties / kind
      Removed value: -{
      -  "description": "Send checkpoint for operation=\"checkpoint_pre_compact\" or final for operation=\"finalize\".",
      -  "enum": [
      -    "checkpoint",
      -    "final"
      -  ],
      -  "type": "string"
      -}
    • changedInput schema / properties / summary / required
      Previous value: -[
      -  "kind",
      -  "coverage",
      -  "generator",
      -  "claims"
      -]New value: +[
      +  "coverage",
      +  "generator",
      +  "claims"
      +]
  3. Changed17 schema fields changedv0.5.6
    • removedInput schema / properties / action
      Removed value: -{
      -  "description": "Session action",
      -  "enum": [
      -    "start",
      -    "summary",
      -    "checkpoint"
      -  ],
      -  "type": "string"
      -}
    • removedInput schema / properties / content / description
      Removed value: -"Full session summary for action=summary"
    • removedInput schema / properties / directory
      Removed value: -{
      -  "description": "Working directory for action=start",
      -  "type": "string"
      -}
    • addedInput schema / properties / event_key
      Added value: +{
      +  "description": "Stable lifecycle event key; retries for the same operation must resend identical content/summary.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / harness
      Added value: +{
      +  "description": "Verified native harness for root_session_key in project_key.",
      +  "enum": [
      +    "opencode",
      +    "codex",
      +    "claude",
      +    "pi",
      +    "mcp",
      +    "cli",
      +    "import"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / properties / id
      Removed value: -{
      -  "description": "Session ID. Required for action=start; defaults to manual-save-{project} for summary/checkpoint",
      -  "type": "string"
      -}
    • addedInput schema / properties / operation
      Added value: +{
      +  "description": "Lifecycle operation; summary is allowed only for checkpoint_pre_compact (checkpoint) or finalize (final).",
      +  "enum": [
      +    "enroll",
      +    "recover",
      +    "capture_root",
      +    "checkpoint_pre_compact",
      +    "guide_post_compact",
      +    "finalize"
      +  ],
      +  "type": "string"
      +}
    • removedInput schema / properties / project
      Removed value: -{
      -  "description": "Project name",
      -  "type": "string"
      -}
    • addedInput schema / properties / project_key
      Added value: +{
      +  "description": "Exact opaque project_key copied verbatim from verified native identity; never derive it from a display name, path hint, remote, branch, worktree name, host ID, listing, or recalled content.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / project_name
      Added value: +{
      +  "description": "Creation/display metadata only; never participates in project identity equality. Prefer the database-persisted name returned by lifecycle or project output.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / root_session_key
      Added value: +{
      +  "description": "Stable verified root session key; required with harness for every operation.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / summary / additionalProperties
      Added value: +false
    • changedInput schema / properties / summary / description
      Previous value: -"Short checkpoint summary for action=checkpoint"New value: +"Optional only for operation=\"checkpoint_pre_compact\" (kind=\"checkpoint\") or operation=\"finalize\" (kind=\"final\"). coverage starts at 1 and to_sequence must advance the current summary for this session and kind. support_ids must be evidence ids from this project_key + root_session_key/harness session inside coverage. Canonical submission limit: 20000 UTF-16 units."
    • addedInput schema / properties / summary / properties
      Added value: +{
      +  "claims": {
      +    "description": "1-32 atomic supported claims; keep the canonical summary within 20000 UTF-16 units.",
      +    "items": {
      +      "additionalProperties": false,
      +      "properties": {
      +        "content": {
      +          "description": "Atomic claim content; at most 2000 code points after privacy filtering.",
      +          "minLength": 1,
      +          "type": "string"
      +        },
      +        "kind": {
      +          "enum": [
      +            "objective",
      +            "completed",
      +            "decision",
      +            "changed_surface",
      +            "verification",
      +            "pending",
      +            "blocker",
      +            "next_action"
      +          ],
      +          "type": "string"
      +        },
      +        "outcome": {
      +          "enum": [
      +            "unknown",
      +            "succeeded",
      +            "failed",
      +            "mixed"
      +          ],
      +          "type": "string"
      +        },
      +        "support_ids": {
      +          "description": "1-16 distinct evidence ids from this project_key + root_session_key/harness session inside summary.coverage; never memory, summary, or observation ids.",
      +          "items": {
      +            "maxLength": 200,
      +            "minLength": 1,
      +            "type": "string"
      +          },
      +          "maxItems": 16,
      +          "minItems": 1,
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "kind",
      +        "content",
      +        "support_ids"
      +      ],
      +      "type": "object"
      +    },
      +    "maxItems": 32,
      +    "minItems": 1,
      +    "type": "array"
      +  },
      +  "coverage": {
      +    "additionalProperties": false,
      +    "description": "Inclusive session evidence coverage; start at 1 and advance to_sequence for this session and summary kind.",
      +    "properties": {
      +      "from_sequence": {
      +        "description": "Inclusive first session event sequence; must start at 1.",
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      },
      +      "to_sequence": {
      +        "description": "Inclusive last session event sequence; must be >= from_sequence and exceed the current summary ending sequence for this session and kind.",
      +        "exclusiveMinimum": 0,
      +        "maximum": 9007199254740991,
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "from_sequence",
      +      "to_sequence"
      +    ],
      +    "type": "object"
      +  },
      +  "generator": {
      +    "additionalProperties": false,
      +    "properties": {
      +      "config_hash": {
      +        "pattern": "^[0-9a-f]{64}$",
      +        "type": "string"
      +      },
      +      "kind": {
      +        "enum": [
      +          "root_agent",
      +          "harness",
      +          "model"
      +        ],
      +        "type": "string"
      +      },
      +      "name": {
      +        "maxLength": 200,
      +        "minLength": 1,
      +        "type": "string"
      +      },
      +      "version": {
      +        "maxLength": 200,
      +        "minLength": 1,
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "kind",
      +      "name"
      +    ],
      +    "type": "object"
      +  },
      +  "kind": {
      +    "description": "Send checkpoint for operation=\"checkpoint_pre_compact\" or final for operation=\"finalize\".",
      +    "enum": [
      +      "checkpoint",
      +      "final"
      +    ],
      +    "type": "string"
      +  }
      +}
    • addedInput schema / properties / summary / required
      Added value: +[
      +  "kind",
      +  "coverage",
      +  "generator",
      +  "claims"
      +]
    • changedInput schema / properties / summary / type
      Previous value: -"string"New value: +"object"
    • changedInput schema / required
      Previous value: -[
      -  "action",
      -  "project"
      -]New value: +[
      +  "operation",
      +  "harness",
      +  "project_key",
      +  "project_name",
      +  "root_session_key",
      +  "event_key"
      +]
  4. Addedv0.4.13
  5. Removedv0.4.1
  6. First observedv0.3.7

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations, the description carries the full burden, but it only says these are lifecycle events and that guide_post_compact content carries host compaction text. It does not disclose mutation semantics, idempotency expectations, permission/auth requirements, or what happens for each lifecycle operation beyond what the schema implies.

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?

The description is two short sentences, front-loads the core action, and contains no filler. It is efficient, though its brevity contributes to gaps elsewhere rather than being a structural flaw itself.

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

Completeness2/5

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

This is a complex tool with eight parameters, nested summary objects, six lifecycle operations, and no annotations or output schema. The description does not explain the lifecycle operations, what is recorded or changed, retry behavior, or the relationship between required fields, leaving too much for the agent to infer.

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 description coverage is high at 88%, so the schema already documents most parameters. The description adds one valuable clarification: content for guide_post_compact carries host compaction text, but it does not add meaning for the other parameters or nested summary fields.

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

Purpose4/5

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

The description states a specific verb and resource: 'Record verified root lifecycle events,' and explicitly distinguishes this from 'ordinary saves,' which helps separate it from mem_save. It is less clear about what a root lifecycle event is, but the operation enum and sibling contrast keep the purpose identifiable.

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

Usage Guidelines3/5

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

It gives one useful exclusion, 'never ordinary saves,' which points agents away from mem_save for normal persistence. However, it does not explain when to use enroll, recover, capture_root, checkpoint_pre_compact, guide_post_compact, or finalize, so operation selection remains implied by the schema rather than guided.

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