Your first successful edit
This recipe works through MCP tools or their matching /v1/<tool_name> API endpoints. It requires read and content scopes.
1. Understand the site
Call get_site_context with {}. Record its revision, available folders, permissions and scopes. Call get_capabilities to see supported fields and designs.
Call search_content with {"q":"Alumni milestones"} to avoid duplicates. If the collection or story already exists, update it instead.
2. Validate a small batch
Replace revision below with the live value. Generate a fresh key for this logical change (8–100 letters, numbers, - or _). Each ref is local to this batch; $alumni refers to the folder created in the preceding operation.
{
"revision": 1,
"idempotencyKey": "alumni-milestones-001",
"dryRun": true,
"changes": [
{ "action": "create_folder", "ref": "alumni", "fields": { "name": "Alumni milestones" } },
{ "action": "create_entry", "ref": "welcome", "fields": {
"folderId": "$alumni",
"kind": "story",
"title": "Every graduate has a story",
"body": "A place to celebrate our alumni and the paths they take.",
"visible": false
} }
]
}
Send this to apply_changes. A successful dry run returns valid: true and does not write content, audit records or media. IDs from a dry run are not reserved.
3. Save the draft
Send the same request with dryRun: false. The response includes the new revision, changeCount and a created map containing actual IDs for alumni and welcome.
The batch saves once, atomically. If any change fails, none of the batch is saved. A new live edit between validation and saving returns revision-conflict; reread and reconcile rather than overwriting.
4. Preview
Call preview_site with {}. Open its previewUrl in your browser—no account login is required. It uses the real shared renderer, including private photos, for the latest saved revision, which the page names. Inspect the homepage, a collection, and a profile at desktop and mobile sizes before approving a private story.
On an owned site this is a secret, read-only link, not a public share URL. It expires at the returned expiresAt (10 minutes at most) or when its connection is disconnected. Share only with the person reviewing the draft; keep it out of logs and public messages. Run preview_site again after expiry. Reloading after the browser removes the secret from the address bar also requires a fresh link.
On an unclaimed guest site, preview_site returns the stable unlisted viewing link instead. Guest edits appear there immediately.
Tell the user what changed and provide the preview. This example's story has visible: false and remains private. Saved changes to visible stories, collections and design affect the live site immediately.
5. Approve only when requested
If the user asks to make this private story visible and the connection has publish permission, set its visible to true with apply_changes. Otherwise leave the proposal private. See visibility and previews.
Reliable retries
If a save response is lost, resend the exact batch with the original revision and key. An accepted batch returns replayed: true; it is not created again. Changing a batch while reusing its key returns idempotency-conflict.