publish_draft
Publish the open draft as the document's next revision. Use it after save_draft, when the text is ready for everyone. Returns the document's id, title and new revision number, or a refusal with the reason when somebody else published first, the draft differs from the body you send, or there is nothing new to publish.
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>",
"expect_revision": "<expect_revision>",
"expect_draft_version": "<expect_draft_version>",
"body": "<body>"
},
"name": "publish_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | the document id, from list_docs or search_docs | |
| body | Yes | the exact text you mean to publish; it must equal the saved draft | |
| expect_revision | Yes | the number of the revision you edited against, from get_doc; 0 when nothing is published | |
| expect_draft_version | Yes | the draft_version your last save returned |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The document id. | |
| title | Yes | Its title. | |
| revisions | Yes | Its revision count. |