Skip to main content
Glama

wrap_up_session

At session end, extract knowledge, identify playbooks, and save a project snapshot from the summary.

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).
    idempotency_key: 可选幂等键;重试同一键只返回既有 operation 状态,不重复写入。 / Optional idempotency key; retrying the same key returns the existing operation status without duplicate writes.
    reconcile_scope: "project"(有项目路径时默认精确项目隔离)或显式 "global"。 / "project" for exact project isolation when a project path is present, or explicit "global".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
summaryYes
tech_stackNo
source_toolNo
known_issuesNo
project_titleNo
run_reconcileNo
project_folderNo
user_confirmedNo
idempotency_keyNo
reconcile_scopeNoproject

Output Schema

TableJSON 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.5/5.0
Behavior5/5

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

No annotations are present, so the description carries the full burden. It discloses the automatic Playbook side effect, writes to staging, the configuration toggle via `update_preferences`, idempotency/retry behavior, and reconcile scoping. It even instructs AI tools on how to handle the returned `confidence` field. This is thorough behavioral disclosure.

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 bilingual description is long but front-loaded with a clear purpose and sibling differentiation, then organized into behavior and Args sections. The Lifecycle sentence partly repeats the Purpose sentence, and dual-language blocks double length, but every paragraph still contributes useful content and the structure is easy to scan.

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?

It covers lifecycle, sibling differentiation, auto-extraction side effects, optional snapshot behavior, config toggle, and idempotency. An output schema exists, so not detailing return values is fine. The main omission is the undocumented `run_reconcile` and `user_confirmed` parameters, which prevents the description from being fully complete for a complex write operation.

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 0%, so the description must compensate. It gives rich semantics for 8 of 10 parameters, including idempotency retry behavior and `reconcile_scope` values. However, `run_reconcile` and `user_confirmed` are never mentioned, leaving ambiguity about their purpose and effect, which is a significant gap for a 10-parameter tool.

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 opens with a clear verb-resource-scope sentence: 'Wrap up a session in one step: extract knowledge, detect playbooks, and save a project snapshot.' It also distinguishes itself from siblings by separately naming `extract_session_insights` and `save_project_snapshot`, making the combined nature of this tool obvious.

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?

It explicitly states the lifecycle ('call at conversation end') and provides direct when/when-not guidance: use `extract_session_insights` when you only want extraction, and `save_project_snapshot` when you only want a snapshot. This is explicit sibling routing with no inference required.

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