Read Word Document
word_readInspects, searches, lists, counts, and checks .docx files read-only, so you can review document content and structure before making any changes.
Instructions
Read-only: inspect, search, list, count and check a .docx before changing it. Never changes a file. To change anything use word_edit, word_format, word_structure, word_media, word_review, word_references, word_document or word_app. get_document_info, get_outline, get_text, find_text, get_comments and word_count read a document open in Word live; get_document_view reads its last saved state; the other reads of a file need it closed in Word. Ops, one per line, as name(required; opt optional): what it does. file_path, live and backup are not repeated; word_help shows them:
get_text(opt start end contains include_textboxes textbox): Read body paragraphs as [{index, text, style, ...}]; start and end are paragraph numbers, end exclusive.
get_document_view(opt scope detail include): Read the document as an anchored markdown projection, the low-token alternative to get_text for orientation and bulk editing. detail="full" shows revisions and comments.
find_text(opt query regex context_chars include_textboxes formatting scope max_results): Find text in paragraphs and table cells; returns locations plus context.
list_elements(type; opt filter): List one kind of element (tables, images, charts, bookmarks, notes, fields, lists, sources, ...) with the ids other ops take.
get_headers_footers(): Read every header and footer in every section: its text, its type, and whether it holds a page-number field.
get_document_info(): Read a one-call overview: paragraph, table, note, comment and revision counts, sections and package parts.
com_word_status(): Check whether Word is ready, busy or blocked by a dialog, and which open documents have unsaved changes; use before live edits.
validate(opt checks options): Run read-only check batteries (checks, default ['core']; also accessibility, notes, citation_parity and more) and return one report. More ops follow, in the same format, in the op parameter's description.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | The operation to run: an op listed in this tool's description, or one of these, in the same format: - diagnose_document(): Report the saved file's structural health (relationships, fields, notes, styles, bookmarks): the deeper companion to validate. - get_workflows(opt task): Recommended tool sequences for common multi-step tasks, with a one-line why per step. - get_styles(opt names type include_formatting): List the document's styles with their explicitly set formatting, in the shape define_style accepts. names, type and include_formatting=false narrow the list; a list over the output limit comes back cut, with a note of what was left out. - get_outline(opt detect_formatted offset): List every heading with its paragraph index and level. - get_table(table_index; opt nested): Read one table in full: every cell's text, the merge map, and column widths. - get_comments(opt author): Read comments with author, anchored text, replies and resolved state; author filters to one reviewer. - get_tracked_changes(opt author limit offset): List every tracked change with its type, author, date, text and paragraph; author filters to one reviewer. - get_server_info(opt include_licensee): Report build, edition, license status, tool surface, Word availability, sandbox shape, host and update state. - structured_diff(old_path, new_path; opt detail_cap): Compare two saved drafts paragraph by paragraph without Word; not a redline (com_multi_document compare makes one). - get_paragraph_format(start; opt end): Read the effective paragraph formatting of paragraphs start to end (inclusive), each value with where it comes from. - word_count(opt by_section exclusions): Count words, characters, and paragraphs; totals only unless by_section=true, which adds a count under each heading (one entry per heading, so long for a manuscript). - get_revision_report(opt mode): Summarize tracked changes by author and type (mode='summary'), or by author and section in detail (mode='analytics'). - comment_report(files; opt include_resolved): Build the reviewer matrix of comment threads for one file, or merged across copies of one draft (files is a list). - get_protection(): Read the document's editing restriction: its mode, whether a password is set, and formatting restrictions. - detect_citation_system(): Detect which citation systems the document uses (Word, Zotero, Mendeley, EndNote or plain text); run it before citation work. - parse_references(opt style_hint): Parse the reference list and in-text citations into a structured model, with a parse confidence for each entry. | |
| args | No | The op's arguments as an object. Include file_path (the absolute .docx path) unless the op's line names other paths or the op reads no document; unknown keys are refused. word_help lists every argument. |