Re-deliver draft to CMS
deliver_draftRe-deliver one already approved article to the workspace's destination as a draft: a file in its git repository, or a draft document in its Sanity dataset. approve_post already delivers on approval, so this is the retry and the re-send after an edit, not the normal path. Requires the last run_gate check to have passed and the article to be ready (approve_post first); otherwise it refuses with degraded reason gate-failed or not-ready. It never publishes, never deletes and never removes the draft flag: publishing stays the human's. Git (provider github): the file is written with draft: true forced, whatever key the destination maps that to. On a git destination, an article already marked published (from the seodraft app or by hand), or whose file in the repository is already live (its draft key is not true), refuses with degraded reason published, because a draft file would take the live article offline. Delivering the same article again overwrites the same path, so it is safe to repeat. Over a file already in the repository it keeps that file's publish date, its translation key and every frontmatter key the mapping does not write (aiRole, process, anything set in the CMS); a linked article whose file has no translation key yet takes the one its translation's file carries, else the English article's slug. If the slug changed since the last delivery the new path is written and previousPath names the old file, which is left in place for the human to delete. Returns path, commitSha, htmlUrl (the file on GitHub), commitUrl, updated (false on the first delivery) and pendingImageSlots: the pictures the article asked for and nobody uploaded, which the human adds in the CMS. Sanity (provider sanity): it creates or patches the draft drafts.seodraft-<id>; re-delivering patches only the fields seodraft maps, so an author, category or image set in Studio survives. Returns documentId, studioUrl (opens the draft in Studio), updated, pendingImageSlots and degradations: what the destination's Portable Text could not carry (kind image-skipped with the image URL, or converter with what was flattened), which the human fixes in Studio. Other degraded reasons: no-target (nothing configured in Profile -> Publishing), no-token, secrets-key-missing, github-error or sanity-error (with status and the CMS's own message).
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": {
"id": "<id>"
},
"name": "deliver_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| workspaceId | No | The workspace this call acts on, as listed by list_workspaces. Left out, the call uses the workspace the account is in right now. |