Apply a plan
apply_planWrites a reviewed sync plan to a target Shopify store, creating or updating only changed items while skipping anything modified since planning. Supports audit logging and background runs for large plans.
Instructions
Write a reviewed plan to the target store. Refused unless the target has allowWrites=true. For a protected store the person is asked to confirm in the client (or applies from the command line); the assistant can't confirm on their behalf. Re-reads the target first and skips anything that changed since planning. Uploads missing files. Creates and updates only, never deletes. Every op is written to the audit log (get_audit_log). Returns { plan_id, status, totals (created, updated, skipped, failed), results per op }; a plan of more than 50 steps runs in the background instead and returns at once: follow it with apply_status and stop it with cancel_apply. A plan can be applied once, within an hour of plan_sync.
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": {
"plan_id": "<plan_id>"
},
"name": "apply_plan"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| only | No | Apply only these ops, by their seq number in the plan (e.g. [1, 2, 3]). Default: every op. | |
| wait | No | Wait for the whole apply before returning. By default a plan of more than 50 steps (SYNC_BACKGROUND_STEPS) runs in the background and this returns at once; follow it with apply_status. | |
| confirm | No | Leave empty. Only read when the server runs with SYNC_ALLOW_AGENT_CONFIRM=true (unattended automation); otherwise a protected store is confirmed by the person, not by this argument. | |
| plan_id | Yes | The plan to write, from plan_sync. It must not have been applied yet and must be less than an hour old. |