Skip to main content
Glama

add_decision

Record a key decision when the user explicitly chooses an option, storing the question, choice, and reasoning for persistent memory across tools.

Instructions

记录单条关键决策(用户明确选了某个方案)。 / Record one key decision when the user explicitly chose an option.

**Lifecycle: writeback** — 对话中做出明确决策时调用。
Lifecycle: writeback — call when an explicit decision is made during conversation.

用途:用户说"我们决定用 X"或"以后都用 Y"时调用。
Purpose: Call when the user says they decided to use X or will use Y going forward.

注意:如果用户给了一段会话摘要让你自动提取,请用 extract_session_insights 而不是本工具。
Note: If the user gives a session summary for automatic extraction, use extract_session_insights instead.

决策链(Decision Thread):同一问题改选方案时,新决策是取代旧决策的提案
(pending_supersedes),在任何审批模式下都等主人用 engram review 批准,批准前旧决策照常使用。
也可显式传 supersedes 参数指定被取代的旧决策 ID。
Decision thread: when the same question gets a different choice than a reviewed
decision, the new one is a proposal to replace it (pending_supersedes) that waits for
the Owner's engram review in every approval mode; the old one stays in use until then.
You may also explicitly pass supersedes with the old ID.

Args:
    question: 决策的问题,如"数据库选型"。 / Decision question, such as 'database choice'.
    choice: 做出的选择,如"PostgreSQL"。 / Chosen option, such as 'PostgreSQL'.
    reasoning: 选择的理由(可选)。 / Reasoning for the choice (optional).
    source_tool: 记录来源工具,如 'claude_code', 'codex'(可选,建议填写)。 / Source tool, such as 'claude_code' or 'codex' (optional but recommended).
    project: 关联项目(可选)。 / Related project (optional).
    domain: 技术领域(可选),可填多个,逗号分隔,如 'architecture,database'。 / Technical domain (optional); may contain multiple comma-separated labels such as 'architecture,database'.
    supersedes: 被本决策取代的旧决策 ID(可选)。填写后自动在决策链中建立 supersedes 关系。 / ID of the old decision this one replaces (optional). Creates a supersedes edge in the decision thread.
    supersedes_expected_version: 填写 supersedes 时必填:旧决策的当前版本号(读取结果中的 version)。缺失 → version_required,不匹配 → version_conflict,均零写入。 / Required with supersedes: the old decision's current version (version in a read result). Missing -> version_required; mismatch -> version_conflict; both write nothing.
    source_agent: 产生/校验此决策的 agent 身份(可选)。 / Agent identity that produced or validated this decision (optional).
    run_id: 产生此决策的工作流/会话运行 ID(可选)。 / Workflow/session run id that produced this decision (optional).
    last_validated_at: 最近确认此决策仍然成立的 ISO-8601 时间(可选)。 / ISO-8601 time this decision was last confirmed to still hold (optional).

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": {
      "question": "<question>",
      "choice": "<choice>"
    },
    "name": "add_decision"
  }
}

Input Schema

NameRequiredDescriptionDefault
choiceYes
domainNo
run_idNo
projectNo
questionYes
reasoningNo
supersedesNo
source_toolNo
source_agentNo
project_folderNo
user_confirmedNo
last_validated_atNo
supersedes_expected_versionNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv4.26.0
    • addedInput schema / properties / supersedes_expected_version
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Supersedes Expected Version"
      +}
  2. Changed2 schema fields changedv4.13.0
    • addedInput schema / properties / project_folder
      Added value: +{
      +  "default": "",
      +  "title": "Project Folder",
      +  "type": "string"
      +}
    • addedInput schema / properties / user_confirmed
      Added value: +{
      +  "default": false,
      +  "title": "User Confirmed",
      +  "type": "boolean"
      +}
  3. Changed3 schema fields changedv3.48.0
    • addedInput schema / properties / last_validated_at
      Added value: +{
      +  "default": "",
      +  "title": "Last Validated At",
      +  "type": "string"
      +}
    • addedInput schema / properties / run_id
      Added value: +{
      +  "default": "",
      +  "title": "Run Id",
      +  "type": "string"
      +}
    • addedInput schema / properties / source_agent
      Added value: +{
      +  "default": "",
      +  "title": "Source Agent",
      +  "type": "string"
      +}
  4. Changed1 schema field changedv3.34.0
    • addedInput schema / properties / supersedes
      Added value: +{
      +  "default": "",
      +  "title": "Supersedes",
      +  "type": "string"
      +}
  5. Addedv3.29.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations only declare the generic mutation profile (readOnly=false, destructiveHint=false, idempotent=false). The description adds real behavioral context beyond that: the pending_supersedes proposal flow waits for Owner review in every approval mode, the old decision stays in effect until approval, and version errors (version_required/version_conflict) cause zero writes. It does not state duplicate-handling or auth requirements, keeping it below 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.

Conciseness3/5

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

Content is front-loaded (lifecycle and purpose first) and each point is substantive, but the entire description is duplicated verbatim in Chinese and English, roughly doubling length without adding information. The Args block is also long for a 13-param tool.

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 13-param mutation tool with annotations and an output schema, the description covers the decision lifecycle, the supersedes approval semantics, and nearly all parameters. It leaves project_folder and user_confirmed (which may be safety-relevant, e.g. user confirmation) unexplained, which is the main remaining gap.

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?

Schema description coverage is 0%, so the description carries the parameter burden, and it does document 11 of 13 params including the critical supersedes/supersedes_expected_version coupling and its failure modes. Two schema params, project_folder and user_confirmed, are never mentioned, so the coverage is strong but incomplete.

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+resource ('record one key decision') plus the exact trigger ('when the user explicitly chose an option', with quoted examples like 'we decided to use X'). It also names the sibling it is not (extract_session_insights) for the summary-extraction case, so an agent can route without opening schemas.

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?

Explicit when-to-call (explicit decision made in conversation), explicit when-not (user supplies a session summary → use extract_session_insights), and it spells out the alternative approval path via the supersedes decision thread. Nothing 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.