The SDK exposes the same document tools Revise’s own agent uses. They are
JSON-schema described, safe to call without React state or browser focus, and
operate on semantic document structure rather than UI geometry.
The loop
That is the whole integration: schemas out, results back in. The definitions
are generated from the same source as Revise’s production agent, so they carry
the descriptions and constraints the tools were designed with.
Results
A rejected edit resolves — it does not throw. Always check success, and
feed agentFeedback back to the model: it explains why a call failed in
terms the model can act on, which is usually the difference between a retry
that works and one that repeats the mistake.
Read and search tools return context: HTML that preserves block IDs, inline
formatting, tables, and notes rather than flattening the document to plain
text. Those IDs are what mutation tools target, so the read/act cycle composes.
Working with blocks
The model reads a window of the document, then edits by block ID:
replace operates inside one block. Two edits in different blocks are
two calls — a single call with finds spanning blocks fails rather than
partially applying.
Routing to a document
Every tool schema carries an optional document_id. Omit it for the active
document, or target any ready document in the same editor:
Suggestions or direct edits
By default, mutations in a suggesting document land as tracked changes. Pass
directMode to apply them outright:
See tracked changes for when that is appropriate.
Review navigation, comment-panel state, focus, viewport, and zoom are host
APIs, not agent tools. An agent should not be clicking “next suggestion” — it
should be making semantic edits and letting your UI present them. See
architecture.
The full catalogue is in the tool reference.