docxkeun-mcp

v0.3.0
docxkeun-mcp Checked 1 day ago Published 8 days ago

MCP 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.

ParameterTypeDescription
folderstringOnly look in this folder (inside the allowed folders)
querystringOnly 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.

ParameterTypeDescription
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
passwordstringPassword 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.

ParameterTypeDescription
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
commentsbooleanInclude comments as annotations (default true)
outlinebooleanBuild a bookmark outline from headings (default true)
outputstringThe .pdf to write (default: next to the document, same name)
passwordstringPassword to open the file, only for encrypted (password-protected) documents
pdfPasswordstringPassword needed to open the PDF
permissionsobjectWhat 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…

ParameterTypeDescription
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
countintegerHow many paragraphs to show at most (default 300)
fromintegerFirst paragraph to show (default 1)
passwordstringPassword 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.

ParameterTypeDescription
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
query *stringText to look for
matchCasebooleanMatch upper/lower case exactly (default true)
passwordstringPassword to open the file, only for encrypted (password-protected) documents
regexbooleanTreat 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.

ParameterTypeDescription
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
includeResolvedbooleanInclude resolved threads (default true)
passwordstringPassword 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.

ParameterTypeDescription
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
authorstringOnly changes by this author
passwordstringPassword to open the file, only for encrypted (password-protected) documents

read_headers_footers Read headers, footers, notes and text boxes

Read the text outside the body: headers, footers, footnotes, endnotes and text boxes, each with an id (header1, footer1, footnote1, textbox1) for replace_story_text.

ParameterTypeDescription
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
passwordstringPassword 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.

ParameterTypeDescription
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
passwordstringPassword 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.

ParameterTypeDescription
object *integerObject number of the chart
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
passwordstringPassword 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.

ParameterTypeDescription
comment *stringThe comment
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
occurrenceintegerWhich match of `text` to use, counting from 1 (default 1)
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
paragraphintegerParagraph number from read_document
passwordstringPassword to open the file, only for encrypted (password-protected) documents
textstringExact 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).

ParameterTypeDescription
commentId *string
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
reply *stringThe reply
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword 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.

ParameterTypeDescription
commentId *string
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword to open the file, only for encrypted (password-protected) documents
resolvedbooleanfalse reopens the thread (default true)

delete_comment Delete a comment

Delete a comment and its replies.

ParameterTypeDescription
commentId *string
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword 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.

ParameterTypeDescription
find *stringText to replace
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
replace *stringReplacement text (empty deletes the matches); <b>, <i>, <u>… tags add formatting to parts of it
matchCasebooleanMatch upper/lower case exactly (default true)
occurrenceintegerOnly replace this match, counting from 1 (default: all)
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
paragraphintegerOnly replace in this paragraph
passwordstringPassword to open the file, only for encrypted (password-protected) documents
regexbooleanTreat 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.

ParameterTypeDescription
data *objectPlaceholder name → value, e.g. {"client": "ACME"}
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword 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.

ParameterTypeDescription
paragraph *integerParagraph number from read_document
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword to open the file, only for encrypted (password-protected) documents
stylestringNew paragraph style name or id, e.g. "Heading 2"
textstringNew 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.

ParameterTypeDescription
paragraphs *arrayThe paragraphs to insert, in order
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
afterintegerInsert after this paragraph
beforeintegerInsert before this paragraph
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword 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.

ParameterTypeDescription
from *integerFirst paragraph to delete
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword to open the file, only for encrypted (password-protected) documents
tointegerLast 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…

ParameterTypeDescription
from *integerFirst paragraph to copy
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
afterintegerPut the copy after this paragraph (after its table, if it is in one). Default: at the end
beforeintegerPut the copy before this paragraph (before its table, if it is in one)
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
pageBreakbooleanStart the copy on a new page
passwordstringPassword to open the file, only for encrypted (password-protected) documents
restartListsbooleanNumber lists in the copy from 1 again (default true); false continues the original lists
tointegerLast 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.

ParameterTypeDescription
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
rows *arrayThe rows, each a list of cell texts; "\n" in a cell starts a new line. Short rows get empty cells
afterintegerInsert after this paragraph (after its table, if it is in one). Default: at the end
alignstringPosition between the margins (default left)
beforeintegerInsert before this paragraph (before its table, if it is in one)
bordersbooleanGrid lines (default true)
headerbooleanThe first row is a header: bold, and repeated at the top of each page the table runs onto
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword to open the file, only for encrypted (password-protected) documents
widthsarrayRelative 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.

ParameterTypeDescription
action *string
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
table *integerTable number from read_document
beforeRowintegeradd_rows: put the new rows before this row (default: after the last row)
fromRowintegerdelete_rows: first row to delete
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword to open the file, only for encrypted (password-protected) documents
rowsarrayadd_rows: the new rows, each a list of cell texts
toRowintegerdelete_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,…

ParameterTypeDescription
from *integerFirst paragraph
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
formatstringbullet •, 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
levelintegerList level: 1 is the outermost, 2 is indented once, and so on
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword to open the file, only for encrypted (password-protected) documents
sameListAsintegerAdd the paragraphs to the list this paragraph is in, continuing its numbering
startintegerFirst number. Without format, restarts the numbering in the current format
tointegerLast 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.

ParameterTypeDescription
format *objectFormatting to apply; leave out what should not change, false turns a property off
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
allbooleanFormat every match of `text` instead of one (matches in locked regions are skipped)
occurrenceintegerWhich match of `text` to use, counting from 1 (default 1)
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
paragraphintegerParagraph number from read_document
passwordstringPassword to open the file, only for encrypted (password-protected) documents
textstringExact text to act on (case-sensitive). With `paragraph`, only that paragraph is searched

add_bookmark Add a bookmark

Add a bookmark (a named anchor that hyperlinks can point to) around a paragraph or a piece of text.

ParameterTypeDescription
name *stringBookmark name: starts with a letter; letters, digits and _ only; at most 40 characters
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
occurrenceintegerWhich match of `text` to use, counting from 1 (default 1)
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
paragraphintegerParagraph number from read_document
passwordstringPassword to open the file, only for encrypted (password-protected) documents
textstringExact 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.

ParameterTypeDescription
from *integerFirst paragraph
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
alignstring
directionstringText direction; rtl for Arabic, Hebrew, Persian, Urdu
indentFirstLinenumberFirst-line indent in points; negative for a hanging indent
indentLeftnumberLeft indent in points (72 = 1 inch)
indentRightnumberRight indent in points
keepLinesTogetherboolean
keepWithNextboolean
lineSpacingnumberLine spacing as a multiple: 1, 1.15, 1.5, 2
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
pageBreakBeforeboolean
passwordstringPassword to open the file, only for encrypted (password-protected) documents
spaceAfternumberSpace after in points
spaceBeforenumberSpace before in points
tointegerLast 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.

ParameterTypeDescription
find *stringExact text to replace (case-sensitive)
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
replace *stringNew text
story *stringStory id from read_headers_footers, e.g. "header1", "footnote2", "textbox1"
allbooleanReplace every match (default: only the first)
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword 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.

ParameterTypeDescription
image *stringPath of the picture file (inside the allowed folders)
paragraph *integerParagraph to put it in
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
afterstringPut it right after this text in the paragraph (default: at the end)
altstringAlternative text describing the picture, for accessibility
heightnumberHeight in points
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword to open the file, only for encrypted (password-protected) documents
widthnumberWidth 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).

ParameterTypeDescription
categories *arrayCategory labels, one per value of each series
paragraph *integerParagraph to put it in
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
series *arrayThe data: each series has a name and one value per category (null for none)
type *stringcolumn (vertical bars), bar (horizontal), line, area, pie, doughnut or scatter
afterstringPut it right after this text in the paragraph (default: at the end)
altstringAlternative text describing the chart, for accessibility
categoryTitlestringTitle of the category axis
heightnumberHeight in points
legendstringWhere the legend goes (default bottom; none hides it)
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword to open the file, only for encrypted (password-protected) documents
stackedstringStack the bars or areas (column, bar and area charts only)
titlestringChart title
valueTitlestringTitle of the value axis
widthnumberWidth 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.

ParameterTypeDescription
object *integerObject number of the chart
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
categoriesarrayAll category labels
categoryTitlestringTitle of the category axis (empty removes it)
legendstringWhere the legend goes (none hides it)
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword to open the file, only for encrypted (password-protected) documents
seriesarrayAll series, each with a name and one value per category
titlestringNew title (empty removes it)
valueTitlestringTitle 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…

ParameterTypeDescription
paragraph *integerParagraph to put it in
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
shape *stringWhat to insert
afterstringPut it right after this text in the paragraph (default: at the end)
altstringAlternative text describing it, for accessibility
fillFill colour as hex RGB, e.g. "FFF2CC", or "none"
fromstringFloating: what x and y count from (default: the paragraph)
heightnumberHeight in points
outlineOutline colour as hex RGB, or "none"
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword to open the file, only for encrypted (password-protected) documents
placementstringfloating (in front of, behind or beside the text) or inline (sits in the line of text, like a character)
textstringText inside it; "\n" starts a new paragraph. <b>, <i>, <u>, <s>, <sup> and <sub> tags format parts of it
widthnumberWidth in points (72 = 1 inch)
wrapstringFloating: how text flows around it (default: square)
xnumberFloating: points to the right of the `from` reference (72 = 1 inch)
ynumberFloating: 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…

ParameterTypeDescription
object *integerObject number
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
afterstringWith `paragraph`: put it right after this text (default: at the end)
altstringAlternative text for accessibility (empty removes it)
fromstringFloating: what x and y count from (left out: an object that already floats keeps its own; otherwise the paragraph)
heightnumberHeight in points
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
paragraphintegerMove it to this paragraph
passwordstringPassword to open the file, only for encrypted (password-protected) documents
placementstringfloating (in front of, behind or beside the text) or inline (sits in the line of text, like a character)
widthnumberWidth in points (72 = 1 inch)
wrapstringFloating: how text flows around it (left out: an object that already floats keeps its own; otherwise square)
xnumberFloating: points to the right of the `from` reference (72 = 1 inch). An object that already floats keeps its own when this is left out
ynumberFloating: 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).

ParameterTypeDescription
object *integerObject number
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword 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.

ParameterTypeDescription
paragraph *integerParagraph where the footnote number goes
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
text *stringThe footnote text
afterstringPut the number right after this text (default: end of the paragraph)
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword 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.

ParameterTypeDescription
on *boolean
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword 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.

ParameterTypeDescription
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
allbooleanEvery tracked change in the document
authorstringAll changes by this author
idsarrayChange ids from list_revisions
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword 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.

ParameterTypeDescription
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
allbooleanEvery tracked change in the document
authorstringAll changes by this author
idsarrayChange ids from list_revisions
outputstringSave the result to this .docx instead of changing the original
overwritebooleanAllow `output` to replace an existing file (default false)
passwordstringPassword 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.

ParameterTypeDescription
paragraphs *arrayThe paragraphs, in order
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
overwritebooleanAllow `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.

ParameterTypeDescription
path *stringThe .docx file: an absolute path, or a path relative to the first allowed folder
to *stringThe new file, a .docx inside the allowed folders
overwritebooleanAllow `to` to replace an existing file (default false)