MCP Server Office

edit_docx_insert

Insert new paragraphs into a docx file. Accepts a list of inserts with text and optional paragraph index. Each insert creates a new paragraph at the specified position. If paragraph_index is not specified, the paragraph is added at the end. When multiple inserts target the same paragraph_index, they are inserted in order. Returns a git-style diff showing the changes made.

Input Schema

NameRequiredDescriptionDefault
insertsYesSequence of paragraphs to insert.
pathYesAbsolute path to file to edit. It should be under your current working directory.

Input Schema (JSON Schema)

{ "properties": { "inserts": { "description": "Sequence of paragraphs to insert.", "items": { "properties": { "paragraph_index": { "description": "0-based index of the paragraph before which to insert. If not specified, insert at the end.", "type": "integer" }, "text": { "description": "Text to insert as a new paragraph.", "type": "string" } }, "required": [ "text" ], "type": "object" }, "type": "array" }, "path": { "description": "Absolute path to file to edit. It should be under your current working directory.", "type": "string" } }, "required": [ "path", "inserts" ], "type": "object" }