editor.tools.getDefinitions() — they are
generated from the same source as Revise’s production agent, so the
descriptions below are summaries, not the authoritative text.
Every tool accepts an optional document_id. Omit it for the active document.
Reading and searching
The user’s current semantic selection: text, caret or range positions,
portable target segments, active formatting, comment IDs, suggestion IDs. No
geometry.
Read consecutive blocks from a 0-based start index. The usual entry point.
Read blocks by ID, when you already know which ones you want.
Search text within one document.
Find highlighted blocks, optionally filtered by colour. Paginated at 25
blocks per page.
Word, paragraph, block, and rendered page counts without loading body text.
Cheap — prefer it over reading the document to count things.
The same measurements for an inclusive block range.
View a document image by block ID when its
src is hidden.Editing text
One or more small in-place edits inside one block, applied in order. Each
operation may carry its own comment, attached to every suggestion it
produces. Edits spanning blocks need one call per block.
Insert HTML block(s) before or after a reference block. Notes can be embedded
inline:
<sup data-footnote="Body.">1</sup> creates the footnote in the same
call.Replace consecutive block(s) with new HTML blocks. Preserves block type
unless asked otherwise.
Remove blocks by consecutive range (
id + count) or an exact ID batch.Append HTML to an existing paragraph.
Split a paragraph at the first occurrence of a substring.
Join two adjacent paragraphs, preserving the inline formatting of both.
Formatting
Bulk formatting through CSS-lite selectors —
*, #blockId, p, h1–h6,
li, lists, tables, and inline selectors such as b, i, code, mark,
a, optionally scoped (p b, #blockId strong). Use this instead of
rewriting text to restyle it.Strip removable inline emphasis from the targets.
Structure and layout
Change the document title.
Preset, page size, orientation, margins, page numbers, spacing, pageless
mode. Lengths are strings with explicit units (
"1in", "2.54cm", "72px").Header and footer content by zone (left, centre, right).
{PAGE} and
{PAGES} are live fields. An empty string clears one zone; clear: true
removes the whole header or footer.A numbered superscript reference plus its note body. Endnotes are a separate
stream.
Tables
Comments
Granular review feedback anchored to one location, without changing the text.
The right tool for critique — prefer it over rewriting a passage the user did
not ask you to change.
Delegation
Hand a complete task to Revise’s own multi-turn agent loop. Callable through
tools.execute() like any other tool. Excluded from getDefinitions() —
pass it to your model explicitly if you want it available. See delegating to
the Revise agent.