Word Formatting and Styles
word_formatApply or define Word styles, character and paragraph formatting, heading levels, and manuscript conventions to shape how text looks without changing its wording.
Instructions
How text looks: apply or define styles, character and paragraph formatting, heading levels and manuscript format. To change the words themselves use word_edit. Every edit backs the file up first and saves atomically. format_text (formatting, not case) and set_paragraph_format edit a document open in Word live; the other ops refuse it. Ops, one per line, as name(required; opt optional): what it does. file_path, live and backup are not repeated; word_help shows them:
define_style(style_id; opt name style_type based_on next_style character_formatting paragraph_formatting): Create a paragraph or character style, or update one in place, replacing only the properties given. style_id is the style's id (Heading1, Normal, Title), not its display name, so a built-in style can be restyled without reading the style list first.
apply_style(style; opt range target): Apply a paragraph style to a range of paragraphs, or a character style to the text that target matches.
format_text(opt formatting case range find occurrence): Apply character formatting or change case.
set_paragraph_format(opt indices formatting start end): Set paragraph formatting on a batch: indices (0-based list) OR start/end (inclusive range), exactly one form.
change_heading_level(delta; opt heading_text paragraph_index subtree): Promote (delta=-1) or demote (delta=1) a heading, addressed by exact heading_text or paragraph_index.
apply_manuscript_format(style; opt running_head author_last_name): Apply a style guide's page conventions (apa7, apa7-professional, mla9, chicago17); choices the guides leave open are listed, not applied.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| op | Yes | The operation to run: one of the ops listed in this tool's description. | |
| 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. |