本文へスキップ
すべてのツール

recipe_save

スキルとレシピ · macOS · Windows

効果: 書き込み. 状態: 条件付き提供.

「条件付き提供」は、バージョン、プラットフォーム、権限、アカウント、設定に依存する可能性を示し、すべての環境で有効という意味ではありません。

macOS

目的

再利用できる SKILL(名前付きのレシピ。パラメーター付きの LMCP ツール呼び出しの順序付きシーケンス)を、この Mac に保存します。ユーザーはいつでも recipe_run で再実行できます。ユーザーは、繰り返し行う複数ステップの LMCP ワークフロー(朝のブリーフ、受信トレイのトリアージ、週次レポート、データ取得)を、再利用できる 1 つのコマンドにするために保存します。保存したスキルは recipe_export で他の人と共有できます。マニフェストには name と、空でない steps 配列が必要です。ステップ自身が確認することはできません。ステップの args にある `confirm` は保存時に削除され(confirm_removed_steps は、いくつのステップに confirm があったかを示します)、実行時にも無視されるため、確認を求めるツールのステップは、実行されずプレビューを返します。すでにレシピとして存在する名前は recipe_exists で拒否され、何も書き込まれません。置き換えるには overwrite: true を渡してください。{name} を返します。

必須入力

入力名はツールが要求する正確な形式のままです。英語の正規技術定義は下の展開可能なスキーマにあります。

権限と確認

スキーマには明示的な確認パラメータがありません。これは無許可の操作を認めるものではありません。効果を確認し、承認を得てください。

英語の正規技術スキーマ — macOS
{
  "properties": {
    "manifest": {
      "description": "The recipe manifest. Shape: {\"name\": string (required), \"description\": string, \"params\": [{\"name\": string, \"type\": \"string\"|\"int\"|\"bool\", \"default\": any}], \"steps\": [ ... ] (required, non-empty), \"outputs\": [{\"kind\": string}]}. A step is EITHER a tool call {\"tool\": <tool_name>, \"args\": {...}} OR a pause {\"wait\": {\"seconds\": N}} (also {\"wait\": N}). A tool-call step may add \"optional\": true (a boolean; default false): if it fails, recipe_run records {ok:false, error} for it, lists it in skipped_optional and carries on with the next step, instead of stopping — use it for a source the user may not have (an app, a permission). Any arg string may interpolate a declared param with ${name} (e.g. \"limit\": \"${count}\"); an arg that is exactly \"${name}\" keeps the param's type. Steps run in order; a later step can consume an EARLIER step's output with \"${steps[N].result.KEY}\" (0-based; supports .key and [i], e.g. \"account\": \"${steps[0].result.accounts[0].name}\"). A step cannot confirm itself: do not put `confirm` in a step's args (it is removed when saving and ignored when running). recipe_run asks for one confirmation when the recipe has state-changing steps; a step whose tool asks for its own confirmation then answers with its preview and is not executed. A step that names a note should give note_name (the note's title): a note_id only names the note on the Mac that issued it, so a step that gives both is saved with note_name alone.",
      "type": "object"
    },
    "overwrite": {
      "description": "Must be true to replace a recipe that already has this name. Without it, a taken name is refused with recipe_exists and the existing recipe is left as it was.",
      "type": "boolean"
    }
  },
  "required": [
    "manifest"
  ],
  "type": "object"
}

ドキュメント例

recipe_save のドキュメント例です。この例は実行しないでください。表示される引数は架空のデータセットに属します。実際に呼び出す前に実在する識別子を確認し、承認を得てください。

{
  "manifest": {
    "description": "Read the local date and time.",
    "name": "Demo morning brief",
    "steps": [
      {
        "args": {},
        "tool": "get_datetime"
      }
    ]
  }
}

Windows

目的

再利用できる SKILL(名前付きのレシピ。パラメーター付きの LMCP ツール呼び出しの順序付きシーケンス)を、このマシンに保存します。ユーザーはいつでも recipe_run で再実行できます。ユーザーは、繰り返し行う複数ステップの LMCP ワークフロー(朝のブリーフ、受信トレイのトリアージ、週次レポート、データ取得)を、再利用できる 1 つのコマンドにするために保存します。マニフェストには name と、空でない steps 配列が必要です。ステップには "optional": true(ブール値。既定は false)を追加できます。失敗した場合、recipe_run はそのステップに {ok:false, error} を記録し、skipped_optional に一覧し、停止せずに次のステップへ進みます。ユーザーが持っていない可能性があるソース(アプリ、権限)に使ってください。引数の文字列は、宣言されたパラメーターを ${name} で埋め込めます。ちょうど "${name}" である引数は、パラメーターの型を保持します。後のステップは、"${steps[N].result.KEY}" で前のステップの出力を使えます(0 始まり。.key と [i] に対応)。ステップ自身が確認することはできません。ステップの args にある confirm は削除されるため、確認を求めるツール(送信、削除、ファイルの置き換え、コマンドの実行)のステップは、プレビューを返します。すでにレシピとして存在する名前は recipe_exists で拒否され、何も書き込まれません。置き換えるには overwrite: true を渡してください。{name, step_count} を返します。

必須入力

入力名はツールが要求する正確な形式のままです。英語の正規技術定義は下の展開可能なスキーマにあります。

権限と確認

スキーマには明示的な確認パラメータがありません。これは無許可の操作を認めるものではありません。効果を確認し、承認を得てください。

英語の正規技術スキーマ — Windows
{
  "properties": {
    "manifest": {
      "description": "The recipe manifest. Shape: {\"name\": string (required), \"description\": string, \"schema_version\": int, \"params\": [{\"name\": string, \"type\": string, \"default\": any}], \"steps\": [{\"tool\": string, \"args\": object, \"optional\": bool}] (required, non-empty)}.",
      "type": "object"
    },
    "overwrite": {
      "description": "Must be true to replace a recipe that already has this name. Without it, a taken name is refused with recipe_exists and the existing recipe is left as it was.",
      "type": "boolean"
    }
  },
  "required": [
    "manifest"
  ],
  "type": "object"
}

ドキュメント例

recipe_save のドキュメント例です。この例は実行しないでください。表示される引数は架空のデータセットに属します。実際に呼び出す前に実在する識別子を確認し、承認を得てください。

{
  "manifest": {
    "description": "Read the local date and time.",
    "name": "Demo morning brief",
    "steps": [
      {
        "args": {},
        "tool": "get_datetime"
      }
    ]
  }
}