Save content
fabrement-save-contentCreate a page/post/custom-type record from deployed blocks, or UPDATE one by contentId. There is no status argument: a new record is always a DRAFT, an update keeps its status, and publishing is set-content-status, after the user agrees. mode is REQUIRED and has no default: create (new record, no contentId) · add (blocks are ADDED after the body already there) · replace (the body becomes exactly blocks) · edit (change part of it through edits). Title applies when given. blocks[] entries are {name: registered Fabrement block, attributes} or {markup: core-block markup for prose}. list-content BEFORE creating; get-content BEFORE changing a record. To change part of a body use mode "edit" with edits (update/text/insert/replace/remove/move by index + name) and expectedHash — never re-send every block for a small change. parent nests a record under another of a hierarchical type; menuOrder orders siblings.
Rules: get-skill-doc {id:"content-contract"} — read it before the first call.
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": {
"mode": "<mode>"
},
"name": "fabrement-save-content"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | Required — there is no default. create: a NEW record; contentId must be absent. The other three act on an existing contentId. add: `blocks` are ADDED AFTER the body already there — this is how a record ends up holding two copies of itself when replace was meant. replace: the body becomes exactly `blocks`. edit: change part of the body through `edits`, without re-sending every block. | |
| slug | No | URL slug. Omitted: derived from the title on create, kept on update. Give it when the address matters. Also when the title is not Latin: a Cyrillic title becomes a percent-encoded URL. Changing it on a published record moves that page. | |
| edits | No | mode "edit" only. Applied in order to the body get-content returned; all or none. | |
| title | No | Title for the new record; on update (contentId set) renames it when given. | |
| blocks | No | Ordered list of blocks to insert. EMPTY creates an empty record — what the posts-index page needs, since WordPress replaces its content with the loop. | |
| parent | No | Parent record id — hierarchical types only (list-post-types `hierarchical`: pages, and custom types made hierarchical). The record then lives at /parent-slug/its-slug/. Same type, not in the trash, not the record itself or one of its children. 0 = top level. Create: default 0. Update: absent = kept. | |
| excerpt | No | Short plain-text summary for cards, archives and search — a body of Fabrement blocks yields NO automatic excerpt, so set it whenever the record will be listed. On update: given = replaced, "" = cleared, absent = kept. | |
| postType | No | Type for the NEW record — any public type from list-post-types; default "page". | |
| contentId | No | Existing record id (list-content) to UPDATE. Omit to create a new one. | |
| menuOrder | No | Place among records with the same parent (WordPress "Order"): lower first, ties by title. Page lists and list-content {orderby:"menuOrder"} follow it. Create: default 0. Update: absent = kept. | |
| expectedHash | No | mode "edit": `hash` from get-content. If the body changed since, nothing is saved. | |
| featuredImage | No | Attachment id (upload-media / list-media) for the featured image — the thumbnail cards and archives show. Must be an image; on update absent = kept. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Publicly reachable only when status is "publish". | |
| note | Yes | ||
| slug | No | The slug as stored — sanitised, and suffixed when the address was taken. | |
| blocks | Yes | What was actually written, in order. | |
| parent | No | Parent id AS STORED; 0 = top level. | |
| status | Yes | Status AFTER the call, read back from WordPress: "draft" for a new record, unchanged on update. | |
| editUrl | Yes | ||
| excerpt | No | The summary as stored AFTER the call — empty means this record still has none. | |
| contentId | Yes | New on create, the same one back on update. Feeds set-post-terms and update-site-settings. | |
| menuOrder | No | ||
| featuredImage | No | The featured image AFTER the call; id 0 = none is set. |