style_doc_range
Apply paragraph and text styles to specific index ranges in a Google Doc, and style multiple ranges in one batched request.
Instructions
Apply paragraph and/or text styles to one or more index ranges in a Google Doc.
Use get_doc_structure to obtain the startIndex and endIndex for each target range. Multiple ranges can be styled in a single call; all batchUpdate requests are sent together.
Args: doc_id: The Google Doc file ID. ranges: List of range dicts. Each dict must include start_index and end_index, plus any combination of the style fields below:
Paragraph style:
named_style_type (str): NORMAL_TEXT, HEADING_1 … HEADING_6,
TITLE, SUBTITLE
Text style:
bold (bool), italic (bool), underline (bool), strikethrough (bool)
font_size (float): size in points
font_family (str): font family name (e.g. "Courier New", "Consolas")
foreground_color (dict): {"red": 0-1, "green": 0-1, "blue": 0-1}
link_url (str | null): set a hyperlink (null to clear)Returns: Confirmation with docId and count of batchUpdate requests sent.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"doc_id": "<doc_id>",
"ranges": "<ranges>"
},
"name": "style_doc_range"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| ranges | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||