# execute_cloud_skill

activeなCloud Skillの宣言済みscript componentを、分離されたexecution engineで実行します。

- Canonical: https://docs.xmemo.dev/ja/docs/tools/execute-cloud-skill
- Locale: ja-JP
- Content-Locale: ja-JP
- Canonical-Content-Digest: aba94d94556b98106266c559e78f7c9d3f934fda4c6f83458f67a7a938bb42c9
- Edition-Digest: d03f1832d67cc2de5aab869790e7f7556c79476cc42fce78f8934838667e365c
- Source-Revision: sha256:23bbbd009c5356d1653ef90add53c2a5821b45798e2ded6d766cdffe5bd291f5

## Tool Reference: `execute_cloud_skill`

### Purpose

activeなCloud Skillの宣言済みscript componentを、分離されたSandboxExecutionEngineで実行します。

### Parameters

- `script_path` (string, optional): 実行するscript componentのlogical pathまたはcomponent IDです。
- `slug` (string, optional, default: empty): active skillの解決に使うskill slugです。
- `skill_id` (string, optional, default: empty): slugの代わりに使うstableなskill identityです。
- `revision_id` (string, optional, default: empty): 任意のrevision pinです。省略時はpublished revision、次にlatest revisionが選択されます。
- `input_args` (object, optional, default: empty object): scriptのstdinに渡すJSON-compatible valueです。
- `timeout_seconds` (integer, optional, default: 30): ExecutionLimitsによって1–60秒に制限されるexecution timeoutです。

### Returns

kind='execution'と、execution_id、skill_id、revision_id、script_path、runtime、status、exit_code、stdout、stderr、truncation flags、任意のoutput_data、duration_ms、memory_peak_bytes、cpu_time_ms、timestamps、error_kindを含むdataを持つJSON CloudSkillResponseEnvelopeです。

### Errors

- ACCESS_DENIED、SKILL_NOT_FOUND、またはSKILL_ARCHIVED: callerのscopeでskillを解決できません。
- REVISION_NOT_FOUND: requested revisionがskillに属していないか、active revisionがありません。
- SCRIPT_NOT_FOUNDまたはINVALID_COMPONENT_TYPE: pathが存在しないか、script以外のcomponentを指定しています。
- SANDBOX_UNAVAILABLE: hostに動作するbubblewrap isolation driverがなく、unsafe fallbackも無効です。
- EXECUTION_TIMEOUT、RESOURCE_EXHAUSTED、またはSCRIPT_EXECUTION_ERROR: watchdog、resource limit、またはscriptのexit statusによって実行が終了しました。

### Examples

#### pinned script componentを1つ実行する



```typescript
execute_cloud_skill({
  slug: "deployment-procedure",
  revision_id: "revision-id-from-root-recall",
  script_path: "scripts/check.py",
  input_args: { environment: "staging" },
  timeout_seconds: 30
})
```

### Related Tools

- [recall_cloud_skill](/docs/tools/recall-cloud-skill): 実行前にskillをdiscoveryし、revision/resourceをpinします。
- [save_cloud_skill](/docs/tools/save-cloud-skill): 実行できるprocedureとscript componentを作成します。
- [recall_context](/docs/tools/recall-context): 実行taskに関するbounded agent contextを組み立てます。

## script pathとrevisionを指定して実行する

activeなskillを選び、再現性が重要な場合はrevisionをpinし、typeがscriptのcomponentを指定します。実行にはmemory:writeが必要で、typed execution envelopeが返されます。

