Put an artifact block into a post
create_blockOn one site of the account, named in site. Puts a live, custom-coded block into a post. The block is one self-contained HTML document (inline CSS and JavaScript, no build step, no external requests except a script from cdnjs.cloudflare.com or cdn.jsdelivr.net) with a height in pixels. It renders inside a sandboxed iframe with an opaque origin: no cookies, no access to the page, nothing shared with the site — so bake the data into the document, or fetch it from a public source with CORS. Match the site's look with the fonts and accent from the pixelglass://site resource, and read pixelglass://blocks/contract first for the rules and a complete example. The block goes after the given top-level paragraph, or at the end; the write is a revision the writer can undo. Answers with the block's id and the post's preview and editor links — give both links back.
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": {
"site": "<site>",
"post_id": "<post_id>",
"html": "<html>"
},
"name": "create_block"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| html | Yes | The whole document: <!doctype html> through </html>, self-contained | |
| site | Yes | The site to work on, as list_sites names it | |
| height | No | The frame's height in pixels (80–4000); 480 when unsure | |
| post_id | Yes | The post's id from list_posts | |
| after_paragraph | No | Put the block after this top-level paragraph, counting from 1; leave out to put it at the end |