Skip to main content
Safe Docx treats comments and footnotes as first-class operations. You can add, retrieve, update, and delete both — all without opening Word.

Comments

Add a comment

Use add_comment to anchor a comment to a specific paragraph or a specific run of text within a paragraph:

Add a threaded reply

To reply to an existing comment, provide parent_comment_id instead of target_paragraph_id:
Replies are nested under the parent comment and returned together by get_comments.

Get all comments

Use get_comments to retrieve all comments and replies with their IDs, authors, dates, text, and anchored paragraph IDs:

Delete a comment

Use delete_comment with the comment’s integer ID. Deleting a root comment cascade-deletes all its threaded replies:
Deleting a root comment permanently removes all its replies. There is no partial deletion — use get_comments first to inspect the thread if needed.

Footnotes

Add a footnote

Use add_footnote to insert a footnote reference into a paragraph. By default the reference appends at the end of the paragraph; use after_text to position it after a specific word or phrase:
Footnote markers like [^1] in read_file output are display-only. They are not part of the editable paragraph text and cannot be used as old_string in replace_text. Use get_footnotes to find footnote IDs for update and delete operations.

Get all footnotes

Use get_footnotes to list all footnotes with their IDs, display numbers, body text, and the paragraph IDs they are anchored to:

Update a footnote

Use update_footnote with the footnote’s integer note_id to change its body text:

Delete a footnote

Use delete_footnote with the footnote’s integer note_id to remove the footnote and its reference marker from the document:

Golden prompt: comment and footnote workflow

This prompt reliably adds a comment and footnote to a document and returns their IDs:

Editing documents

Make surgical text edits with formatting preservation.

Golden prompts

All known-good prompt patterns in one place.