insert_paragraph
Insert a paragraph before or after an anchor paragraph by ID, with DOCX tracked changes and support for DOCX, ODT, and Google Docs.
Instructions
Insert a paragraph before/after an anchor paragraph by paragraph id. DOCX responses include structural_warnings when the placement may slice a hierarchy, mismatch list levels, or renumber a list. Supports DOCX, ODT, and Google Docs. ODT paragraph ids remain stable within the session; new paragraphs receive monotonically allocated ids, and reopening renumbers stored document order. Surface: revisionable — DOCX insertions emit native OOXML tracked changes.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"positional_anchor_node_id": "<positional_anchor_node_id>",
"new_string": "<new_string>",
"instruction": "<instruction>"
},
"name": "insert_paragraph"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| position | No | ||
| file_path | No | Path to the DOCX or ODT file. | |
| new_string | Yes | ||
| instruction | Yes | ||
| google_doc_id | No | Google Doc ID or URL (alternative to file_path). Extract from URL: docs.google.com/document/d/{ID}/edit | |
| style_source_id | No | Paragraph anchor to clone formatting (pPr and template run) from instead of the positional anchor. Accepts a `_bk_*` ID, or (DOCX only) any other bookmark name whose w:id-paired range covers exactly that one paragraph. Falls back to anchor with a warning if not found. | |
| positional_anchor_node_id | Yes | Anchor paragraph. Accepts a safe-docx `_bk_*` id, or (DOCX only) any other bookmark name — e.g. a host application's own stable paragraph bookmark — whose w:id-paired range covers exactly this one paragraph. Exact name match; a point bookmark or a multi-paragraph range is refused. |