read_theme and use its classes.
create_page
Scope:documents:write (step-up) · Kind: write · Annotations: readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false
Create an HTML page artifact in the person’s library with ascope:user(private, the default) ororg, optionally filed into a folder (folder_id). The HTML source is stored verbatim, but pages render inert:<script>/<iframe>/<object>/<embed>, everyon*event-handler attribute and everyjavascript:/vbscript:/data:text/htmlURL are removed at render, in a sandboxed frame with no scripts and adefault-src 'none'CSP. Ascript_strippedwarning tells you when that will happen. Returns —urlis the link to share with people,versionwhat write_page requires.
Parameters
Pass ascope, optionally with folder_id.
string
required
string
The page’s HTML, stored verbatim. Must be non-empty. Required unless
upload_id is given.string
Instead of
html: the id from request_upload_url
(format html) after the file was uploaded. Use it for a file already on
disk or anything over about 8 KB. Never pass both.'user' | 'org'
default:"user"
Where the page lives.
string
With a
scope: file the page straight into this folder (from
list_folders). You must be its owner or
a participant.Returns
string
The artifact id. Use it as
page_id for read_page and write_page, and as document_id for comments and export.string
The web-app link the page opens at (
https://sidecars.ai/artifacts/<page_id>) — share this one, never a guessed path.string
number
The version
write_page must pass as expected_version.number
string[]
["script_stripped"] when the HTML contains anything the renderer removes:
<script>, <iframe>, <object> or <embed> elements, on* event-handler
attributes (onload, onerror, onfocus, onmouseover, … on any element,
SVG included), or javascript:, vbscript: and data:text/html URLs in URL
attributes (href, src, srcdoc, action, formaction, xlink:href,
…), entity- or whitespace-encoded or not. They stay in the stored source but
are removed when the page is viewed, so its interactivity will not run.Created page "<title>" (page_id: <id>, version <n>) — <url>. plus
Note: its scripts, embedded elements, event handlers and script URLs will be removed when viewed.
when applicable.
Permissions and side effects
- Needs
documents:write. - The access gate runs inside the create transaction: with
folder_idyou must be the folder’s owner or a participant. - The caller becomes the owner; nothing is posted anywhere.
Errors
Limitations
- No idempotency key on this tool; a retried create makes a second page.
- Pages run no code. The viewer and the downloadable rendition are both the
stripped page (see
warningsabove), shown in a sandboxed iframe withoutallow-scripts, under adefault-src 'none'Content-Security-Policy that permits only inline styles anddata:/same-origin images and fonts. Style with inline CSS; there is no way to run JavaScript in a page.
Example
Requestread_page
Scope:documents:read (step-up) · Kind: read-only · Annotations: readOnlyHint: true, destructiveHint: false, openWorldHint: false
Read a page’s stored HTML source and its version — the token write_page’s expected_version is checked against. This is the source as written, not what viewers get: pages render with scripts, event handlers, javascript:/vbscript:/data:text/html URLs and iframe/object/embed removed, in a sandboxed script-less frame.
Parameters
string
required
The page’s artifact id.
Returns
string
string
string
The stored source as written, scripts and handlers included. Viewers never receive it: the rendered page has them removed (see
create_page warnings).number
Pass as
expected_version to write_page.# <title> (version <n>) followed by the HTML.
Permissions and side effects
- Needs
documents:readand any role on the page. The access check and the source read happen in one transaction. - Reads only. Recorded in the agent activity history.
Errors
Example
Requestwrite_page
Scope:documents:write (step-up) · Kind: write, destructive · Annotations: readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false
Replace a page’s HTML wholesale. expected_version is REQUIRED — the
version read_page (or create_page) returned. If the page moved since your
read, the write refuses with the current version and a line-level diff of
what changed, so you can merge and retry; there is no force flag, by
design. The source is stored verbatim; at render, scripts, on* handlers,
javascript:/vbscript:/data:text/html URLs and iframe/object/embed are removed and the page runs
in a sandboxed, script-less, CSP-locked frame.
Parameters
string
required
string
The complete new HTML. Must be non-empty. Required unless
upload_id is
given.string
Instead of
html: the id from request_upload_url
(format html) after the file was uploaded. Use it for a file already on
disk or anything over about 8 KB. Never pass both.number
required
The version
read_page or create_page returned. Must be a non-negative
integer.Returns
string
number
number
string[]
["script_stripped"] when the HTML carries anything the renderer removes (same rule as create_page).Wrote the page; it is now at version <n> (<bytes> bytes).
Permissions and side effects
- Needs
documents:writeand theeditororownerrole. The role is re-checked inside the write transaction. - Replaces the whole page. The previous source is kept as a checkpoint.
- Attributed to you via the host.
Errors
There is deliberately no way to overwrite a newer version without reading
it first.