Skip to main content

add_comment

Add a comment or a threaded reply to a document.
  • To add a root comment, provide target_paragraph_id. Optionally, provide anchor_text to anchor the comment to a specific span of text within the paragraph. If anchor_text is omitted, the comment anchors to the entire paragraph.
  • To add a threaded reply, provide parent_comment_id with the ID of the comment you want to reply to.
This tool modifies the document in memory. Call save to persist the result to disk.
file_path
string
required
Path to the DOCX file.
target_paragraph_id
string
_bk_* paragraph ID to anchor the comment to. Required for root comments.
anchor_text
string
Text within the paragraph to anchor the comment highlight to. If omitted, the comment anchors to the entire paragraph.
parent_comment_id
number
ID of the parent comment. Provide this to add a threaded reply instead of a root comment.
author
string
required
Comment author name.
text
string
required
Comment body text.
initials
string
Author initials displayed in the comment balloon. Defaults to the first letter of author.

get_comments

Retrieve all comments from the document, including IDs, authors, creation dates, body text, and the paragraph IDs each comment is anchored to. Threaded replies are included and nested under their parent. Hints: readOnly — does not modify the document.
file_path
string
required
Path to the DOCX file.

delete_comment

Delete a comment and all of its threaded replies. Deletion cascades to all descendants of the target comment.
Deleting a comment also permanently removes all replies in its thread.
file_path
string
required
Path to the DOCX file.
comment_id
number
required
ID of the comment to delete. Retrieve comment IDs with get_comments.

get_footnotes

Retrieve all footnotes from the document, including IDs, display numbers, body text, and the paragraph IDs each footnote reference is anchored to. Hints: readOnly — does not modify the document.
file_path
string
required
Path to the DOCX file.

add_footnote

Add a footnote anchored to a paragraph. By default, the footnote reference is appended at the end of the paragraph. Use after_text to position the reference after a specific span of text.
This tool modifies the document in memory. Call save to persist the result to disk.
The [^N] markers you see in read_file output are display-only indicators. They are not part of the paragraph’s editable text and should not be included in old_string when calling replace_text.
file_path
string
required
Path to the DOCX file.
target_paragraph_id
string
required
_bk_* paragraph ID to anchor the footnote to.
after_text
string
Text after which to insert the footnote reference mark. If omitted, the reference is appended at the end of the paragraph.
text
string
required
Footnote body text.

update_footnote

Update the text content of an existing footnote.
This tool modifies the document in memory. Call save to persist the result to disk.
file_path
string
required
Path to the DOCX file.
note_id
number
required
ID of the footnote to update. Retrieve footnote IDs with get_footnotes.
new_text
string
required
New footnote body text.

delete_footnote

Delete a footnote and its reference mark from the document.
This tool modifies the document in memory. Call save to persist the result to disk.
file_path
string
required
Path to the DOCX file.
note_id
number
required
ID of the footnote to delete. Retrieve footnote IDs with get_footnotes.

Build docs developers (and LLMs) love