batch_update_doc
Batch multiple Google Docs edits—insert or delete text, format paragraphs, replace words, insert tables, manage tabs—into one atomic update.
Instructions
Executes multiple document operations in a single atomic batch update.
Args: user_google_email: User's Google email address document_id: ID of the document to update operations: List of operation dicts. Each operation MUST have a 'type' field. All operations accept an optional 'tab_id' to target a specific tab.
Supported operation types and their parameters:
insert_text - required: index (int), text (str) delete_text - required: start_index (int), end_index (int) replace_text - required: start_index (int), end_index (int), text (str) format_text - required: start_index (int), end_index (int) optional: bold, italic, underline, font_size, font_family, text_color, background_color, link_url update_paragraph_style - required: start_index (int), end_index (int) optional: heading_level (0-6, 0=normal), alignment (START/CENTER/END/JUSTIFIED), line_spacing, indent_first_line, indent_start, indent_end, space_above, space_below insert_table - required: index (int), rows (int), columns (int) insert_page_break- required: index (int) find_replace - required: find_text (str), replace_text (str) optional: match_case (bool, default false) create_bullet_list - required: start_index (int), end_index (int) optional: list_type ('UNORDERED'|'ORDERED'|'NONE', default UNORDERED), nesting_level (0-8), paragraph_start_indices (list[int]) Use list_type='NONE' to remove existing bullet/list formatting insert_doc_tab - required: title (str), index (int) optional: parent_tab_id (str) delete_doc_tab - required: tab_id (str) update_doc_tab - required: tab_id (str), title (str)
Example operations: [ {"type": "insert_text", "index": 1, "text": "Hello World"}, {"type": "format_text", "start_index": 1, "end_index": 12, "bold": true}, {"type": "update_paragraph_style", "start_index": 1, "end_index": 12, "heading_level": 1, "alignment": "CENTER"}, {"type": "find_replace", "find_text": "foo", "replace_text": "bar"}, {"type": "insert_table", "index": 20, "rows": 2, "columns": 3}, {"type": "insert_doc_tab", "title": "Appendix", "index": 1} ]
Returns: str: Confirmation message with batch operation results
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operations | Yes | ||
| document_id | Yes | ||
| user_google_email | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |