Insert paragraph
insert_paragraphInsert a new paragraph before or after a specific paragraph, mark it as tracked if desired, and record the edit in the mandatory ledger. Use the hash to prevent stale overwrites.
Instructions
Insert a new paragraph carrying text, BESIDE a paragraph you name, and record it in the session's journal. Pass exactly one anchor — after_para_id or before_para_id, the w14:paraId find_text returns. para_hash is OPTIONAL and recommended: the paraId already names one specific paragraph, and passing the hash find_text reported with it additionally refuses the call if that paragraph's text has moved on since you read it. There is deliberately NO raw index parameter. The new paragraph becomes a SIBLING of the anchor, which keeps it inside the same table cell, textbox or content control. mode 'tracked' marks the new paragraph and its run with w:ins, so rejecting removes the whole paragraph; 'direct' writes it unmarked and is accounted for by the ledger alone, which the receipt discloses. Seal the session with commit_document.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | tracked | |
| note | No | ||
| part | Yes | ||
| text | Yes | ||
| author | Yes | ||
| para_hash | No | ||
| session_id | Yes | ||
| after_para_id | No | ||
| before_para_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | ||
| mode | Yes | ||
| note | Yes | ||
| part | Yes | ||
| after | Yes | ||
| parts | Yes | ||
| before | Yes | ||
| para_id | Yes | ||
| para_index | Yes | ||
| session_id | Yes | ||
| revision_ids | Yes | ||
| result_digest | Yes | ||
| baseline_digest | Yes | ||
| document_digest_changed | Yes |