docxkeun-mcp
v0.3.0MCP server for Word .docx files: lets Claude and other AI assistants read, edit, comment on, track changes in, protect and convert .docx files to PDF, with a…
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_documents List Word documents
List the Word documents (.docx, .docm, .dotx, .dotm) in the folders this server may use.
| Parameter | Type | Description |
|---|---|---|
folder | string | Only look in this folder (inside the allowed folders) |
query | string | Only files whose name contains this text |
get_document_info Document details
Properties, page count, word count, protection, encryption, locked regions, editable ranges and the paragraph styles a document has.
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
password | string | Password to open the file, only for encrypted (password-protected) documents |
export_pdf Export to PDF
Convert a document to PDF with docxkeun's own layout engine: embedded fonts, searchable text, links, a bookmark outline from headings, and comments as PDF annotations. Optionally protect the PDF with a password and permissions. An existing PDF at the output path is replaced.
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
comments | boolean | Include comments as annotations (default true) |
outline | boolean | Build a bookmark outline from headings (default true) |
output | string | The .pdf to write (default: next to the document, same name) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
pdfPassword | string | Password needed to open the PDF |
permissions | object | What PDF readers should allow (default: everything) |
read_document Read a document
Read a Word document as numbered paragraphs. Each line is "[number] (style; list label; table position or text box; alignment; formatting of the whole paragraph; locks; comments) text {objects}", e.g. "[1] (centered; bold, underlined) AGREEMENT" or "[4] (list item a.; justified) …". Text formatted differently from the rest of its paragraph is tagged: <b>bold</b>, <i>italic</i>, <u>underlined</u>, <s>struck through</s>, <sup>superscript</sup>, <sub>subscript</sub>. The tags are not part of the text (find_text and replace_text ignore them); edit_paragraph and insert_paragraphs take them, so ke…
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
count | integer | How many paragraphs to show at most (default 300) |
from | integer | First paragraph to show (default 1) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
find_text Find text
Find text (or a regular expression) in a document and show each match with its paragraph number and surrounding text.
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
query * | string | Text to look for |
matchCase | boolean | Match upper/lower case exactly (default true) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
regex | boolean | Treat query as a JavaScript regular expression |
list_comments List comments
List comment threads with their ids, authors, dates, the text they are attached to, and replies.
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
includeResolved | boolean | Include resolved threads (default true) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
list_links List links and bookmarks
List the hyperlinks (to web addresses or to bookmarks) and the bookmarks in a document.
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
password | string | Password to open the file, only for encrypted (password-protected) documents |
list_revisions List tracked changes
List the tracked changes (insertions, deletions, moves, formatting changes) with their ids, authors, dates and paragraph numbers. read_document shows the text with every change accepted.
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
author | string | Only changes by this author |
password | string | Password to open the file, only for encrypted (password-protected) documents |
list_objects List pictures, charts, shapes and equations
List the pictures, charts (with their data), SmartArt, shapes, text boxes and equations in a document. Each line starts with the number of the paragraph holding it; pictures, charts, shapes and text boxes have an object number ("object 2") and say whether they sit in the text (inline) or float, and where a floating one sits and how text wraps around it; edit_object and delete_object use those numbers.
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
password | string | Password to open the file, only for encrypted (password-protected) documents |
read_chart Read a chart
Show a chart's type, titles, legend and data as a table (one line per series), and its number formats other than General. Use the object number from read_document or list_objects. Dates are Excel serial numbers (days since 1900): give them back as numbers when updating, and an empty category back as empty.
| Parameter | Type | Description |
|---|---|---|
object * | integer | Object number of the chart |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
password | string | Password to open the file, only for encrypted (password-protected) documents |
add_comment Add a comment
Attach a comment to text in a document (signed "AI assistant"). Target a whole paragraph, a piece of text, or text within a paragraph.
| Parameter | Type | Description |
|---|---|---|
comment * | string | The comment |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
occurrence | integer | Which match of `text` to use, counting from 1 (default 1) |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
paragraph | integer | Paragraph number from read_document |
password | string | Password to open the file, only for encrypted (password-protected) documents |
text | string | Exact text to act on (case-sensitive). With `paragraph`, only that paragraph is searched |
reply_to_comment Reply to a comment
Reply to a comment thread (ids come from list_comments).
| Parameter | Type | Description |
|---|---|---|
commentId * | string | |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
reply * | string | The reply |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
resolve_comment Resolve a comment
Mark a comment thread as resolved (done), or reopen it.
| Parameter | Type | Description |
|---|---|---|
commentId * | string | |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
resolved | boolean | false reopens the thread (default true) |
delete_comment Delete a comment
Delete a comment and its replies.
| Parameter | Type | Description |
|---|---|---|
commentId * | string | |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
replace_text Replace text
Replace text everywhere in a document (or one occurrence), keeping the formatting of the replaced text. Matches inside locked regions are skipped. With regex, the replacement may use $1…$9 and $&. Pictures, charts and text boxes a match runs across stay, right after the new text.
| Parameter | Type | Description |
|---|---|---|
find * | string | Text to replace |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
replace * | string | Replacement text (empty deletes the matches); <b>, <i>, <u>… tags add formatting to parts of it |
matchCase | boolean | Match upper/lower case exactly (default true) |
occurrence | integer | Only replace this match, counting from 1 (default: all) |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
paragraph | integer | Only replace in this paragraph |
password | string | Password to open the file, only for encrypted (password-protected) documents |
regex | boolean | Treat find as a JavaScript regular expression |
fill_template Fill a template
Fill {{placeholder}} fields and content controls (by tag or title) with values. Placeholders inside locked regions are left alone.
| Parameter | Type | Description |
|---|---|---|
data * | object | Placeholder name → value, e.g. {"client": "ACME"} |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
edit_paragraph Edit a paragraph
Replace a paragraph's text and/or change its style. The paragraph keeps its own formatting (alignment, indents, list, whole-paragraph bold and so on). Use the tags read_document shows (<b>, <i>, <u>, <s>, <sup>, <sub>) for text formatted differently from the rest: each tagged part takes the formatting (font, size and colour too) of the text that had the same tags. Keep the tags when rewriting or translating, or that formatting is lost. Pictures, charts and text boxes in the middle of the old text stay, right after the new text.
| Parameter | Type | Description |
|---|---|---|
paragraph * | integer | Paragraph number from read_document |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
style | string | New paragraph style name or id, e.g. "Heading 2" |
text | string | New text for the whole paragraph, with formatting tags as read_document shows them |
insert_paragraphs Insert paragraphs
Insert new paragraphs before or after a paragraph (default: at the end of the document). Inserting next to a paragraph in a table cell or a text box adds to that cell or box. Paragraph numbers after the insertion point shift.
| Parameter | Type | Description |
|---|---|---|
paragraphs * | array | The paragraphs to insert, in order |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
after | integer | Insert after this paragraph |
before | integer | Insert before this paragraph |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
delete_paragraphs Delete paragraphs
Delete a paragraph or a run of paragraphs. The last paragraph of a table cell or a text box is emptied instead of removed. Paragraph numbers after them shift.
| Parameter | Type | Description |
|---|---|---|
from * | integer | First paragraph to delete |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
to | integer | Last paragraph to delete (default: same as from) |
copy_paragraphs Copy paragraphs
Copy paragraphs, with their formatting, lists, tables and pictures, to another place (default: the end of the document). A table the range starts or ends in is copied whole. It refuses paragraphs in a text box (to change a text box, use insert_paragraphs or edit_paragraph). Use it to duplicate content, for example to translate a document on a new page: copy everything with pageBreak, then change the copies’ text with edit_paragraph or replace_text (table cells are paragraphs too). Lists in the copy number from 1 again unless restartLists is false. Comments, bookmarks and footnote references…
| Parameter | Type | Description |
|---|---|---|
from * | integer | First paragraph to copy |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
after | integer | Put the copy after this paragraph (after its table, if it is in one). Default: at the end |
before | integer | Put the copy before this paragraph (before its table, if it is in one) |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
pageBreak | boolean | Start the copy on a new page |
password | string | Password to open the file, only for encrypted (password-protected) documents |
restartLists | boolean | Number lists in the copy from 1 again (default true); false continues the original lists |
to | integer | Last paragraph to copy (default: same as from) |
insert_table Insert a table
Insert a table of text before or after a paragraph (default: at the end of the document). It spans the text width, with grid lines unless borders is false. Its cells become paragraphs in read_document (“table N, row R, cell C”), so their text can be changed and formatted like any paragraph. Paragraph numbers after it shift.
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
rows * | array | The rows, each a list of cell texts; "\n" in a cell starts a new line. Short rows get empty cells |
after | integer | Insert after this paragraph (after its table, if it is in one). Default: at the end |
align | string | Position between the margins (default left) |
before | integer | Insert before this paragraph (before its table, if it is in one) |
borders | boolean | Grid lines (default true) |
header | boolean | The first row is a header: bold, and repeated at the top of each page the table runs onto |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
widths | array | Relative column widths, one per column (e.g. [1, 4, 2]); default: equal |
edit_table Add or delete table rows
Change a table’s rows: add rows (they copy the formatting of the row next to them), delete rows, or delete the whole table. Tables are numbered as read_document shows them (“table 2, row 1, cell 1”); to change a cell’s text, edit its paragraph. Paragraph numbers after the table shift.
| Parameter | Type | Description |
|---|---|---|
action * | string | |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
table * | integer | Table number from read_document |
beforeRow | integer | add_rows: put the new rows before this row (default: after the last row) |
fromRow | integer | delete_rows: first row to delete |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
rows | array | add_rows: the new rows, each a list of cell texts |
toRow | integer | delete_rows: last row to delete (default: same as fromRow) |
set_list Change list formatting
Make paragraphs a bulleted or numbered list, or switch a list between bullets, numbers (1. or 1)), letters (a. A.) and roman numerals (i. I.). Also restarts numbering, changes the list level (indent), adds paragraphs to an existing list, or takes them out of a list. Every paragraph from `from` to `to` is affected. A changed list keeps its indentation. read_document shows the labels. To make one list of paragraphs that are not next to each other (other paragraphs between them), give the first a format, then add each of the others with sameListAs pointing at the first. (To copy a list as it is,…
| Parameter | Type | Description |
|---|---|---|
from * | integer | First paragraph |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
format | string | bullet •, decimal 1., decimalParen 1), lowerLetter a., upperLetter A., lowerRoman i., upperRoman I., or none to remove the list. The paragraphs become one list in this format |
level | integer | List level: 1 is the outermost, 2 is indented once, and so on |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
sameListAs | integer | Add the paragraphs to the list this paragraph is in, continuing its numbering |
start | integer | First number. Without format, restarts the numbering in the current format |
to | integer | Last paragraph (default: same as from) |
format_text Format text
Change character formatting (bold, italic, underline, colour, highlight, size, font) of a paragraph or of matching text.
| Parameter | Type | Description |
|---|---|---|
format * | object | Formatting to apply; leave out what should not change, false turns a property off |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
all | boolean | Format every match of `text` instead of one (matches in locked regions are skipped) |
occurrence | integer | Which match of `text` to use, counting from 1 (default 1) |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
paragraph | integer | Paragraph number from read_document |
password | string | Password to open the file, only for encrypted (password-protected) documents |
text | string | Exact text to act on (case-sensitive). With `paragraph`, only that paragraph is searched |
add_hyperlink Add a hyperlink
Turn text into a hyperlink to a web address (http, https, mailto, tel) or to a bookmark in the document. The text must be within one paragraph.
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
bookmark | string | Bookmark name to link to (see list_links) |
occurrence | integer | Which match of `text` to use, counting from 1 (default 1) |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
paragraph | integer | Paragraph number from read_document |
password | string | Password to open the file, only for encrypted (password-protected) documents |
text | string | Exact text to act on (case-sensitive). With `paragraph`, only that paragraph is searched |
tooltip | string | |
url | string | Web address to link to |
add_bookmark Add a bookmark
Add a bookmark (a named anchor that hyperlinks can point to) around a paragraph or a piece of text.
| Parameter | Type | Description |
|---|---|---|
name * | string | Bookmark name: starts with a letter; letters, digits and _ only; at most 40 characters |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
occurrence | integer | Which match of `text` to use, counting from 1 (default 1) |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
paragraph | integer | Paragraph number from read_document |
password | string | Password to open the file, only for encrypted (password-protected) documents |
text | string | Exact text to act on (case-sensitive). With `paragraph`, only that paragraph is searched |
format_paragraph Format paragraphs
Change paragraph alignment, text direction (right-to-left for Arabic or Hebrew), indents, spacing, line spacing and keep/page-break rules.
| Parameter | Type | Description |
|---|---|---|
from * | integer | First paragraph |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
align | string | |
direction | string | Text direction; rtl for Arabic, Hebrew, Persian, Urdu |
indentFirstLine | number | First-line indent in points; negative for a hanging indent |
indentLeft | number | Left indent in points (72 = 1 inch) |
indentRight | number | Right indent in points |
keepLinesTogether | boolean | |
keepWithNext | boolean | |
lineSpacing | number | Line spacing as a multiple: 1, 1.15, 1.5, 2 |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
pageBreakBefore | boolean | |
password | string | Password to open the file, only for encrypted (password-protected) documents |
spaceAfter | number | Space after in points |
spaceBefore | number | Space before in points |
to | integer | Last paragraph (default: same as from) |
replace_story_text Edit a header, footer, note or text box
Replace text in a header, footer, footnote, endnote or text box (ids from read_headers_footers). Use an empty `replace` to delete the text.
| Parameter | Type | Description |
|---|---|---|
find * | string | Exact text to replace (case-sensitive) |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
replace * | string | New text |
story * | string | Story id from read_headers_footers, e.g. "header1", "footnote2", "textbox1" |
all | boolean | Replace every match (default: only the first) |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
insert_image Insert a picture
Insert a picture file (PNG, JPEG, GIF, BMP, TIFF, EMF or WMF) into a paragraph, at its end or after some text. Without a size it keeps its proportions and fits the page width.
| Parameter | Type | Description |
|---|---|---|
image * | string | Path of the picture file (inside the allowed folders) |
paragraph * | integer | Paragraph to put it in |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
after | string | Put it right after this text in the paragraph (default: at the end) |
alt | string | Alternative text describing the picture, for accessibility |
height | number | Height in points |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
width | number | Width in points (72 = 1 inch); height follows the proportions |
insert_chart Insert a chart
Insert a chart into a paragraph, at its end or after some text. Give the categories (the labels along the bottom, or the slices of a pie) and one series per line or set of bars, each with a value for every category (null leaves a gap). The data sits in an embedded workbook, so "Edit Data" in Word shows it. For a scatter chart the categories are the x values (numbers). Without a size it is 6 × 3.5 inches, shrunk to the page width. It cannot go inside a text box (only pictures can).
| Parameter | Type | Description |
|---|---|---|
categories * | array | Category labels, one per value of each series |
paragraph * | integer | Paragraph to put it in |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
series * | array | The data: each series has a name and one value per category (null for none) |
type * | string | column (vertical bars), bar (horizontal), line, area, pie, doughnut or scatter |
after | string | Put it right after this text in the paragraph (default: at the end) |
alt | string | Alternative text describing the chart, for accessibility |
categoryTitle | string | Title of the category axis |
height | number | Height in points |
legend | string | Where the legend goes (default bottom; none hides it) |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
stacked | string | Stack the bars or areas (column, bar and area charts only) |
title | string | Chart title |
valueTitle | string | Title of the value axis |
width | number | Width in points (72 = 1 inch); height follows the proportions |
update_chart Change a chart
Change a chart's title, axis titles, legend or data, keeping its look and number formats (series keep theirs by position). Giving categories or series replaces them all, so give the whole table (read_chart shows the current one). An empty title removes it. Word does not track chart changes, so with Track Changes on this change is not tracked.
| Parameter | Type | Description |
|---|---|---|
object * | integer | Object number of the chart |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
categories | array | All category labels |
categoryTitle | string | Title of the category axis (empty removes it) |
legend | string | Where the legend goes (none hides it) |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
series | array | All series, each with a name and one value per category |
title | string | New title (empty removes it) |
valueTitle | string | Title of the value axis (empty removes it) |
insert_shape Insert a shape or text box
Insert a text box or a shape (rectangle, oval, arrow, star, callout, line…) into a paragraph, at its end or after some text. It floats by default, at the top left of the paragraph with text flowing around it; give x and y to put it elsewhere, or placement "inline" to put it in the line of text. `text` goes inside (each line becomes a paragraph, <b> and the other tags format it); a text box’s paragraphs are numbered right after the paragraph holding it, so every text tool works on them. Colours are hex RGB or "none". It cannot go inside a text box (only pictures can). Paragraph numbers afte…
| Parameter | Type | Description |
|---|---|---|
paragraph * | integer | Paragraph to put it in |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
shape * | string | What to insert |
after | string | Put it right after this text in the paragraph (default: at the end) |
alt | string | Alternative text describing it, for accessibility |
fill | Fill colour as hex RGB, e.g. "FFF2CC", or "none" | |
from | string | Floating: what x and y count from (default: the paragraph) |
height | number | Height in points |
outline | Outline colour as hex RGB, or "none" | |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
placement | string | floating (in front of, behind or beside the text) or inline (sits in the line of text, like a character) |
text | string | Text inside it; "\n" starts a new paragraph. <b>, <i>, <u>, <s>, <sup> and <sub> tags format parts of it |
width | number | Width in points (72 = 1 inch) |
wrap | string | Floating: how text flows around it (default: square) |
x | number | Floating: points to the right of the `from` reference (72 = 1 inch) |
y | number | Floating: points down from the `from` reference |
edit_object Resize, move or describe an object
Change a picture, chart, shape or text box (object numbers from read_document or list_objects): its size (width and/or height in points; one alone keeps the proportions), its place (`paragraph` moves it to another paragraph, after some text if you give `after`; `placement` makes it floating or inline; x, y, from and wrap position a floating one, and one that already floats keeps what you leave out, so `wrap` alone changes only the wrap) and its alt text. Word does not track size, floating position, wrap or alt text, so with Track Changes on those apply directly (and are refused where only trac…
| Parameter | Type | Description |
|---|---|---|
object * | integer | Object number |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
after | string | With `paragraph`: put it right after this text (default: at the end) |
alt | string | Alternative text for accessibility (empty removes it) |
from | string | Floating: what x and y count from (left out: an object that already floats keeps its own; otherwise the paragraph) |
height | number | Height in points |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
paragraph | integer | Move it to this paragraph |
password | string | Password to open the file, only for encrypted (password-protected) documents |
placement | string | floating (in front of, behind or beside the text) or inline (sits in the line of text, like a character) |
width | number | Width in points (72 = 1 inch) |
wrap | string | Floating: how text flows around it (left out: an object that already floats keeps its own; otherwise square) |
x | number | Floating: points to the right of the `from` reference (72 = 1 inch). An object that already floats keeps its own when this is left out |
y | number | Floating: points down from the `from` reference. An object that already floats keeps its own when this is left out |
delete_object Delete an object
Delete a picture, chart, shape or text box (object number from read_document or list_objects). With Track Changes on the deletion is tracked. Deleting a text box removes its paragraphs. Paragraph numbers after it shift (and object numbers after the object).
| Parameter | Type | Description |
|---|---|---|
object * | integer | Object number |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
add_footnote Add a footnote
Add a footnote: its number goes in a paragraph (after some text, or at the end), its text at the bottom of the page.
| Parameter | Type | Description |
|---|---|---|
paragraph * | integer | Paragraph where the footnote number goes |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
text * | string | The footnote text |
after | string | Put the number right after this text (default: end of the paragraph) |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
set_track_changes Turn Track Changes on or off
Turn Word's Track Changes setting on or off for a document. While it is on, every edit (yours too) is recorded as a tracked change signed "AI assistant" that people can accept or reject.
| Parameter | Type | Description |
|---|---|---|
on * | boolean | |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
accept_revisions Accept tracked changes
Accept tracked changes: insertions stay, deletions go, formatting changes are kept. Pick them by id, by author, or all.
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
all | boolean | Every tracked change in the document |
author | string | All changes by this author |
ids | array | Change ids from list_revisions |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
reject_revisions Reject tracked changes
Reject tracked changes: insertions are removed, deleted text comes back, formatting changes are undone. Pick them by id, by author, or all.
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
all | boolean | Every tracked change in the document |
author | string | All changes by this author |
ids | array | Change ids from list_revisions |
output | string | Save the result to this .docx instead of changing the original |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
password | string | Password to open the file, only for encrypted (password-protected) documents |
create_document Create a document
Create a new, blank Word document from paragraphs of plain text. The new document has the styles Normal, Heading 1 and Heading 2 and none of any other document's formatting. To copy a document, use copy_document (an exact copy), never retype it here.
| Parameter | Type | Description |
|---|---|---|
paragraphs * | array | The paragraphs, in order |
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
overwrite | boolean | Allow `output` to replace an existing file (default false) |
copy_document Copy a document
Copy a document to a new file, exactly as it is: formatting, styles, tables, lists, pictures, headers, footers, comments and page setup. Use it whenever the user wants a copy or a new version of a document (for example a translation in a new file), then change the copy with the other tools.
| Parameter | Type | Description |
|---|---|---|
path * | string | The .docx file: an absolute path, or a path relative to the first allowed folder |
to * | string | The new file, a .docx inside the allowed folders |
overwrite | boolean | Allow `to` to replace an existing file (default false) |