create_page
Scope:documents:write (step-up) · Kind: write · Annotations: readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false
Create an HTML page artifact — in a conversation (conversation_id, its card is posted to the room) or in the person’s library with ascope:user(private, the default),pod(needspod_id), ororg. The HTML is stored verbatim; scripts are stripped when the page is viewed, and you are warned when that will happen. Returns — the version write_page requires.
Parameters
Pass eitherconversation_id or scope (with pod_id when the
scope is pod), never both.
string
required
string
required
The page’s HTML, stored verbatim. Must be non-empty.
string
Create inside this conversation; a card is posted to the room.
'user' | 'pod' | 'org'
default:"user"
Where the page lives when no
conversation_id is given.string
Required with
scope: "pod".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
number
The version
write_page must pass as expected_version.number
string[]
["script_stripped"] when the HTML contains <script> elements, inline
event handlers or javascript: URLs. They are stored but removed when the
page is viewed, so its interactivity will not run.Created page "<title>" (page_id: <id>, version <n>). plus
Note: its scripts will be stripped when viewed. when applicable.
Permissions and side effects
- Needs
documents:write. - The access gate runs inside the create transaction: with
conversation_idyou must be able to participate in the room; withscope: "pod"you must be a pod member. - The caller becomes the owner. With
conversation_ida card lands in the room; with a scope nothing is posted.
Errors
Limitations
- No idempotency key on this tool; a retried create makes a second page.
- Pages are served with scripts stripped. Style with inline CSS.
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.
Parameters
string
required
The page’s artifact id.
Returns
string
string
string
The stored source, scripts included (they are stripped only at view time).
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. Scripts are stored but stripped at view.
Parameters
string
required
string
required
The complete new HTML. Must be non-empty.
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 scripts.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.