edit_document
Replace specific text in an Outline document by matching old strings with new ones. Supports batch edits and staged saves for large rewrites.
Instructions
Edits a document using string-match replacement.
Each edit finds a unique old_string in the document
and replaces it with new_string. Edits are applied
server-side — you never need to hold the full
document in context.
IMPORTANT: Batch all edits for a document into a
single call when possible to minimize API calls.
Each old_string must uniquely match one location in
the document. Include surrounding context if needed
to disambiguate.
Edits are applied sequentially, so later edits can
target text created by earlier edits in the same
batch. If any edit fails, no changes are applied
(all-or-nothing).
By default (save=True), changes are pushed to
Outline immediately. Set save=False to stage changes
locally for large rewrites spanning multiple calls,
then pass save=True on the final call to push all
accumulated changes.
Args:
document_id: The document ID to edit
edits: List of edits to apply
save: If True (default), push changes to Outline
immediately. If False, stage locally.
Returns:
Summary of edits applied and save status
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | ||
| edits | Yes | ||
| save | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |