Style text in a doc
set_styleApply formatting to Google Docs text in place: bold, italic, color, font size, link, alignment, or paragraph spacing. Target a text selection using unique snippets or style the whole document.
Instructions
Apply styling to existing text in place (no content change), the way you select text in Docs and apply formatting. Pick ONE target: from (+ optional to) to style a selection — from the start of the unique from snippet to the end of the unique to snippet (omit to to style just from); or whole_document: true to style the entire doc/tab (e.g. one font throughout, without per-paragraph calls). Styles: bold/italic/underline/strikethrough, color (hex), fontSize (pt), fontFamily, link, paragraph alignment, and paragraph spacing (spaceBefore/spaceAfter in pt, lineSpacing %). Use inspect_style first to read current spacing/fonts. NOTE: a direct style change, not a tracked suggestion.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | No | optional end anchor: a unique snippet; styles the whole span from the start of `from` to the end of `to` (a selection). Must appear after `from`. | |
| tab | No | Target a specific tab by tabId or title (from list_tabs). Defaults to the first tab. | |
| from | No | start anchor: a unique text snippet to style from (quote a slice from read_doc). Required unless whole_document is set. | |
| style | Yes | styles to apply | |
| account | No | Google account email to use. Defaults to GDOCS_DEFAULT_ACCOUNT, or the sole account. | |
| documentId | Yes | Google Doc id | |
| whole_document | No | style the entire document (or tab) instead of a selection — e.g. to set one font throughout. Mutually exclusive with from/to. |