Skip to main content
Glama

add_playbook

Record a multi-step operational playbook with trigger keywords and structured steps, so completed workflows can be retrieved and reused later.

Instructions

记录操作手册(Playbook)— 结构化的多步骤流程。 / Record an operational playbook — a structured multi-step procedure.

用途:完成一个多步骤操作流程后(如发布到 Registry、上架应用等),将步骤和经验记录为 Playbook,
方便日后调取复用,避免重复摸索。
Purpose: After completing a multi-step operational process (publishing to a registry, app deployment, etc.),
record the steps as a Playbook for future retrieval.

每条 Playbook 独立存储为单个文件,通过 triggers(记忆点关键词)快速调取。
Each Playbook is stored as an individual file, quickly retrievable via trigger keywords.

经 MCP 写入的 Playbook 一律进入待审(任何审批模式),主人用 engram review 批准后才会被使用。
A playbook written over MCP always waits in the review queue (every approval mode); it is used
only after the Owner approves it with engram review.

Args:
    title: 流程名称,如 'MCP Registry 发布流程'。 / Playbook name, e.g., 'MCP Registry publish workflow'.
    triggers: 记忆点关键词,逗号分隔,如 '发布,registry,上架'。 / Trigger keywords (comma-separated) for quick retrieval.
    steps_json: 步骤 JSON 数组,每个元素含 order/action/detail。 / Steps as a JSON array, each with order/action/detail.
    required_tools_json: 工具依赖 JSON 数组(可选),只声明工具名/用途,不写本机路径。 / Tool dependencies JSON array (optional); declares names/purposes, not local paths.
    tool_refs: 简写工具名,逗号分隔(可选)。 / Shorthand tool names, comma-separated (optional).
    description: 流程概述(可选)。 / Brief description (optional).
    domain: 技术领域,逗号分隔(可选)。 / Domain labels, comma-separated (optional).
    preconditions: 前提条件,逗号分隔(可选)。 / Preconditions, comma-separated (optional).
    pitfalls: 常见陷阱,逗号分隔(可选)。 / Common pitfalls, comma-separated (optional).
    outcome: 预期结果(可选)。 / Expected outcome (optional).
    source_tool: 来源工具(可选)。 / Source tool (optional).
    allow_similar_new: 标题相似但不相同、确属另一份手册时设为 true,写入新条目(可选,默认 false)。不能绕过标题完全相同的拒绝;该拒绝会指向已有手册并给出修订方式。 / Set true when a similar but not identical title is genuinely a DIFFERENT playbook, to store it as a new entry (optional, default false). It cannot bypass the refusal of an identical title; that refusal names the existing playbook and how to revise it.
    supersedes: 本手册修订的已有 playbook ID(可选)。修订提案总是进入待审,主人批准后旧手册才归档;被主人钉住的手册只能这样修订。 / ID of the existing playbook this one revises (optional). A revision is always a proposal that waits for the Owner; the old playbook is retired only on approval. An Owner-pinned playbook can only be revised this way.
    supersedes_expected_version: 填写 supersedes 时必填:旧手册的当前版本号。缺失 → version_required,不匹配 → version_conflict,均零写入。 / Required with supersedes: the old playbook's current version. Missing -> version_required; mismatch -> version_conflict; both write nothing.

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": {
      "title": "<title>",
      "triggers": "<triggers>"
    },
    "name": "add_playbook"
  }
}

Input Schema

NameRequiredDescriptionDefault
titleYes
domainNo
run_idNo
outcomeNo
pitfallsNo
triggersYes
tool_refsNo
scope_typeNoglobal
steps_jsonNo[]
supersedesNo
descriptionNo
source_toolNo
source_agentNo
preconditionsNo
project_folderNo
user_confirmedNo
allow_similar_newNo
last_validated_atNo
required_tools_jsonNo[]
supersedes_expected_versionNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv4.26.0
    • addedInput schema / properties / supersedes
      Added value: +{
      +  "default": "",
      +  "title": "Supersedes",
      +  "type": "string"
      +}
    • addedInput schema / properties / supersedes_expected_version
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "integer"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Supersedes Expected Version"
      +}
  2. Changed1 schema field changedv4.19.1
    • addedInput schema / properties / allow_similar_new
      Added value: +{
      +  "default": false,
      +  "title": "Allow Similar New",
      +  "type": "boolean"
      +}
  3. Changed1 schema field changedv4.13.0
    • addedInput schema / properties / user_confirmed
      Added value: +{
      +  "default": false,
      +  "title": "User Confirmed",
      +  "type": "boolean"
      +}
  4. Changed2 schema fields changedv3.55.0
    • addedInput schema / properties / required_tools_json
      Added value: +{
      +  "default": "[]",
      +  "title": "Required Tools Json",
      +  "type": "string"
      +}
    • addedInput schema / properties / tool_refs
      Added value: +{
      +  "default": "",
      +  "title": "Tool Refs",
      +  "type": "string"
      +}
  5. Changed5 schema fields changedv3.48.0
    • addedInput schema / properties / last_validated_at
      Added value: +{
      +  "default": "",
      +  "title": "Last Validated At",
      +  "type": "string"
      +}
    • addedInput schema / properties / project_folder
      Added value: +{
      +  "default": "",
      +  "title": "Project Folder",
      +  "type": "string"
      +}
    • addedInput schema / properties / run_id
      Added value: +{
      +  "default": "",
      +  "title": "Run Id",
      +  "type": "string"
      +}
    • addedInput schema / properties / scope_type
      Added value: +{
      +  "default": "global",
      +  "title": "Scope Type",
      +  "type": "string"
      +}
    • addedInput schema / properties / source_agent
      Added value: +{
      +  "default": "",
      +  "title": "Source Agent",
      +  "type": "string"
      +}
  6. Addedv3.29.1

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already declare this is a non-read-only, non-destructive, closed-world mutation, but the description adds substantial workflow context. It explains that each playbook is stored as an individual file, retrievable via trigger keywords, and that MCP writes always enter a review queue until the Owner approves. It also documents revision behavior, version conflicts, zero-write failure modes, and pinned-playbook restrictions, which are valuable beyond the annotations.

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?

The information is front-loaded with purpose and usage before the argument list, which helps. However, the bilingual duplication roughly doubles the length, and the description repeats concepts already available in the structured review workflow. For a 20-parameter tool the detail is warranted, but the presentation is more verbose than necessary.

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?

Given the complexity of 20 parameters, the approval workflow, and the existence of an output schema, the description covers the essential purpose, storage model, review behavior, revision semantics, and most caller-facing parameters. It leaves several optional or internal-looking parameters undocumented, such as run_id, scope_type, source_agent, project_folder, user_confirmed, and last_validated_at. Output values need not be explained because an output schema exists.

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 must carry parameter meaning. It documents most parameters with examples and semantics, including title, triggers, steps_json, required_tools_json, tool_refs, description, domain, preconditions, pitfalls, outcome, source_tool, allow_similar_new, supersedes, and supersedes_expected_version. It omits some parameters such as run_id, scope_type, source_agent, project_folder, user_confirmed, and last_validated_at, so it is not fully complete.

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 clearly states a specific verb and resource: record an operational playbook as a structured multi-step procedure. It gives concrete examples such as publishing to a registry or app deployment. It does not explicitly distinguish itself from siblings like add_lesson or add_decision, so it falls short of a 5.

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?

The description gives a clear usage condition: after completing a multi-step operational process, record the steps for future retrieval and reuse. It does not name alternative tools or state when not to use this tool versus siblings such as add_lesson, add_decision, or memory_store. The guidance is strong but lacks explicit alternatives or exclusions.

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