Skip to main content
Glama

wrap_up_session

Destructive

Extract lessons, decisions, and playbook drafts from a session summary, and optionally save a project snapshot to persist context at conversation end.

Instructions

会话结束一键收尾:自动提取知识、操作流程并保存项目快照。 / Wrap up a session in one step: extract knowledge, detect playbooks, and save a project snapshot.

**Lifecycle: session-end** — 对话结束时调用,完成知识提取和上下文保存。
Lifecycle: session-end — call at conversation end to extract knowledge and persist session context.

用途:一次对话结束时调用,把会话摘要交给 Engram 自动提取 lessons、decisions 和 Playbook 草稿,并可选更新项目快照。
Purpose: Call at the end of a conversation to let Engram extract lessons, decisions, and playbook drafts from the summary and optionally update the project snapshot.

Playbook 自动提取:如果摘要描述了一个多步骤操作流程(3+ 步骤,含顺序标记和操作动词),会自动生成 Playbook 草稿存入 staging。返回值中会包含 playbook_draft 字段(含 confidence: high/medium),AI 工具应根据 confidence 决定是否提示用户。可通过 update_preferences(playbook_auto_extract=false) 关闭此功能。
Playbook auto-extraction: If the summary describes a multi-step operational workflow (3+ steps with sequential markers and action verbs), a Playbook draft is auto-generated into staging. The return value includes a playbook_draft field (with confidence: high/medium); AI tools should decide whether to notify the user based on confidence. Disable via update_preferences(playbook_auto_extract=false).

注意:如果只想提取知识不用保存项目,用 extract_session_insights;如果只想保存项目快照,用 save_project_snapshot。
Note: Use extract_session_insights when you only want extraction, and save_project_snapshot when you only want to save a project snapshot.

Args:
    summary: 会话摘要(自由文本,段落或要点列表均可)。 / Session summary in free text; paragraphs or bullet lists both work.
    project_folder: 项目文件夹路径(可选,不填则只提取知识不保存快照)。 / Project folder path (optional; omit it to extract knowledge without saving a snapshot).
    source_tool: 调用来源工具,如 'claude_code', 'codex'。 / Calling source tool, such as 'claude_code' or 'codex'.
    project_title: 项目名称(可选,仅在首次保存快照时需要)。 / Project title (optional; mainly needed when first saving a snapshot).
    tech_stack: 技术栈(可选,逗号分隔)。 / Tech stack (optional, comma-separated).
    known_issues: 已知问题(可选,逗号分隔)。 / Known issues (optional, comma-separated).
    run_reconcile: 兼容保留,不再导入任何内容;其它 AI 工具的记忆只能由用户在终端运行 `engram import-memories` 导入。 / Kept for compatibility and imports nothing; memories in other AI tools are imported only by the user running `engram import-memories` in a terminal.
    idempotency_key: 可选幂等键;重试同一键只返回既有 operation 状态,不重复写入。 / Optional idempotency key; retrying the same key returns the existing operation status without duplicate writes.
    reconcile_scope: 兼容保留(只回显在 maintenance.reconcile_scope)。 / Kept for compatibility (echoed in maintenance.reconcile_scope only).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "summary": "<summary>"
    },
    "name": "wrap_up_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
summaryYes
tech_stackNo
source_toolNo
known_issuesNo
project_titleNo
run_reconcileNo
project_folderNo
user_confirmedNo
idempotency_keyNo
reconcile_scopeNoproject

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv4.19.1
    • addedInput schema / properties / idempotency_key
      Added value: +{
      +  "default": "",
      +  "title": "Idempotency Key",
      +  "type": "string"
      +}
    • addedInput schema / properties / reconcile_scope
      Added value: +{
      +  "default": "project",
      +  "title": "Reconcile Scope",
      +  "type": "string"
      +}
  2. Changed2 schema fields changedv4.13.0
    • addedInput schema / properties / run_reconcile
      Added value: +{
      +  "default": false,
      +  "title": "Run Reconcile",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / user_confirmed
      Added value: +{
      +  "default": false,
      +  "title": "User Confirmed",
      +  "type": "boolean"
      +}
  3. Addedv3.29.1

TDQS

A4.4/5.0
Behavior4/5

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

Adds substantial behavior beyond the annotations: the summary feeds automatic lessons/decisions extraction, playbook drafts land in staging only when 3+ ordered steps are detected, returns a playbook_draft with confidence the agent should act on, and can be disabled via update_preferences. It does not disclose the destructive/overwrite implications that destructiveHint=true and idempotentHint=false imply, nor what happens to an existing snapshot, which is the main remaining gap.

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

Conciseness3/5

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

Well front-loaded and organized into purpose, playbook behavior, alternatives, then args — but every section is duplicated in Chinese and English, roughly doubling length and diluting signal. The prose itself has no filler; the bilingual mirroring is the cost.

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?

Handles a 10-param mutation tool well: lifecycle, side effects, alternatives, and per-parameter meaning are all present, and the output schema excuses it from explaining return values. The omissions are the undisclosed user_confirmed flag and the destructiveness of snapshot updates.

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?

With 0% schema description coverage the description carries the full load, and it does so for 9 of 10 params, including the high-value warnings that run_reconcile imports nothing and reconcile_scope is echo-only, plus idempotency retry semantics. It leaves user_confirmed entirely undocumented, which matters for a tool annotated destructive.

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 compound resource: wrap up a session by extracting knowledge, detecting playbooks, and saving a project snapshot. It explicitly contrasts itself with extract_session_insights and save_project_snapshot, so an agent can distinguish the composite tool from its narrower siblings without opening a schema.

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?

Gives an explicit trigger ('Lifecycle: session-end — call at conversation end') plus explicit exclusions with named alternatives for the two partial-use cases (extraction only, snapshot only). Nothing about when to select this tool is left to inference.

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