set_paragraph_text
Replace a paragraph's text while preserving its formatting by addressing it with a location object. Use an expected substring to prevent edits to the wrong paragraph and verify the returned replaced text.
Instructions
Replace one paragraph's full text, keeping style and base formatting; address it with a location object ({paragraph: N}, {search: ...}, {outline: ...}). Indices shift after edits, so pass expect (a substring the target must contain) to refuse instead of hitting the wrong paragraph; verify the returned replaced_text. Auto-backup in file mode (backup=False skips rotation); atomic validated save. Edits go live on open documents (serialized); tracked-revision paragraphs refuse live. For batches, use apply_edits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| live | No | auto | |
| backup | No | ||
| expect | No | ||
| location | Yes | ||
| new_text | Yes | ||
| file_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||