← Back to Google Docs docs

Google Docs — Tool Reference

Create and edit Google Docs

51 tools · auto-generated from the deployed toolkit

Your AI assistant discovers and invokes these tools through the MCP Server's meta tools — it calls execute_tool with the tool name and arguments below.

# append_styled_block write

Append one formatted text block and return insertion details, combining text insert with inline and named-style formatting.

Full description
Append text with formatting in a single operation.

This is a convenience tool that combines insert_text with style operations.
It replaces the broken append_text with blockType from v1.

If a named_style is specified and style preferences have been set for it,
the preferences will be applied as defaults. Explicit parameters (bold,
italic, etc.) will override the preferences.

Args:
    document_id: The Google Docs document ID
    text: Text to append
    named_style: Named style (TITLE, HEADING_1, etc.)
    bold: Apply bold formatting (overrides preferences)
    italic: Apply italic formatting (overrides preferences)
    font_size_pt: Font size in points (overrides preferences)
    text_color: Text color as hex string (#RRGGBB) (overrides preferences)
    as_bullet: Format as bullet list
    as_numbered: Format as numbered list

Returns:
    Information about the appended text including indices

Example: {"document_id": "abc123", "text": "Key Findings", "named_style": "HEADING_1", "bold": true}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
text string Yes Text to append
named_style string | null No Named style: TITLE, HEADING_1, etc.
bold boolean | null No Apply bold formatting
italic boolean | null No Apply italic formatting
font_size_pt number | null No Font size in points
text_color string | null No Text color as hex string (#RRGGBB)
link_url string | null No URL to link the text to
as_bullet boolean No Format as bullet list Default: false
as_numbered boolean No Format as numbered list. Use with nesting_level for hierarchical numbering (1, 1.1, 1.1.1) Default: false
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "text": {
      "description": "Text to append",
      "title": "Text",
      "type": "string"
    },
    "named_style": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Named style: TITLE, HEADING_1, etc.",
      "title": "Named Style"
    },
    "bold": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply bold formatting",
      "title": "Bold"
    },
    "italic": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply italic formatting",
      "title": "Italic"
    },
    "font_size_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Font size in points",
      "title": "Font Size Pt"
    },
    "text_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Text color as hex string (#RRGGBB)",
      "title": "Text Color"
    },
    "link_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "URL to link the text to",
      "title": "Link Url"
    },
    "as_bullet": {
      "default": false,
      "description": "Format as bullet list",
      "title": "As Bullet",
      "type": "boolean"
    },
    "as_numbered": {
      "default": false,
      "description": "Format as numbered list. Use with nesting_level for hierarchical numbering (1, 1.1, 1.1.1)",
      "title": "As Numbered",
      "type": "boolean"
    }
  },
  "required": [
    "document_id",
    "text"
  ],
  "title": "AppendStyledBlockParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "inserted_length": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of characters inserted",
      "title": "Inserted Length"
    },
    "start_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Start index of inserted text",
      "title": "Start Index"
    },
    "end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "End index of inserted text",
      "title": "End Index"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "AppendStyledBlockResult",
  "type": "object"
}

# append_styled_blocks write

Append multiple formatted text blocks efficiently and return placement results using batched document updates.

Full description
Append multiple styled text blocks to a document.

This is a batched version of append_styled_block that is much more efficient
when adding multiple sections to a document. For small payloads it makes only
2 API calls total (get document + batchUpdate). For larger payloads that would
exceed the Google Docs 100-operation limit, it automatically chunks the blocks
into multiple batchUpdate calls, re-fetching the document end index between
batches to account for index shifts from prior insertions.

Each block can have its own styling (named style, bold, italic, etc.).
Blocks are appended in order, each on its own line.

A block may also set right_text to render flush-right text on the same
visual line (e.g. a date opposite a job title) — emulating a right tab
stop, which the Docs API cannot create. The block's text/runs and styling
form the left side; right_text is right-aligned at the margin in
NORMAL_TEXT style. Internally this renders as a borderless two-column
table.

Example use case - building a document with title and sections:
    blocks = [
        {"text": "Report Title", "named_style": "TITLE"},
        {"text": "Executive Summary", "named_style": "HEADING_1"},
        {"text": "This report covers...", "named_style": "NORMAL_TEXT"},
        {"text": "Key Findings", "named_style": "HEADING_1"},
        {"text": "Finding 1\nFinding 2\nFinding 3", "as_bullet": True},
        {"runs": [{"text": "Acme — CTO", "bold": True}], "right_text": "2020 – present"},
    ]

Args:
    document_id: The Google Docs document ID
    blocks: List of styled blocks to append, each with:
        - text: Text content
        - named_style: Optional named style (TITLE, HEADING_1, etc.)
        - bold, italic, font_size_pt, text_color: Optional formatting
        - as_bullet, as_numbered: Optional list formatting
        - right_text: Optional flush-right text on the same visual line

Returns:
    Summary of appended blocks with indices for each

Example: {"document_id": "abc123", "blocks": [{"text": "Report Title", "named_style": "TITLE"}, {"text": "Introduction", "named_style": "HEADING_1"}, {"text": "This report covers Q1 results.", "named_style": "NORMAL_TEXT"}]}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
blocks array<StyledBlock> Yes List of styled blocks to append
Parameter schema (JSON)
{
  "$defs": {
    "StyledBlock": {
      "description": "A single block of styled text for batch append operations.\n\nSupply either ``text`` (simple), ``runs`` (multi-run), or ``block_type``\n(special element like pageBreak/horizontalRule/image).\n\nWhen ``runs`` is provided the block text is the concatenation of all run texts,\nand each run can carry its own character-level formatting.\n\nWhen ``block_type`` is set, text/runs are not needed (except image blocks\nwhich require ``image_url``).",
      "properties": {
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Text content for this block (use text OR runs, not both)",
          "title": "Text"
        },
        "runs": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/TextRun"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "List of text runs with per-run formatting (use text OR runs, not both)",
          "title": "Runs"
        },
        "block_type": {
          "anyOf": [
            {
              "enum": [
                "pageBreak",
                "horizontalRule",
                "image"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Special block type. 'image' requires image_url. 'pageBreak' and 'horizontalRule' need no extra fields.",
          "title": "Block Type"
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL for image block type (public URL)",
          "title": "Image Url"
        },
        "image_width_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Image width in points (default: auto)",
          "title": "Image Width Pt"
        },
        "image_height_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Image height in points (default: auto)",
          "title": "Image Height Pt"
        },
        "named_style": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Named style: TITLE, HEADING_1, etc.",
          "title": "Named Style"
        },
        "bold": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply bold formatting",
          "title": "Bold"
        },
        "italic": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply italic formatting",
          "title": "Italic"
        },
        "font_size_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Font size in points",
          "title": "Font Size Pt"
        },
        "text_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Text color as hex string (#RRGGBB)",
          "title": "Text Color"
        },
        "link_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL to link the text to (when using text, not runs)",
          "title": "Link Url"
        },
        "indent_start_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Left indent in points (72pt = 1 inch)",
          "title": "Indent Start Pt"
        },
        "indent_end_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Right indent in points",
          "title": "Indent End Pt"
        },
        "indent_first_line_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "First line indent in points",
          "title": "Indent First Line Pt"
        },
        "alignment": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Paragraph alignment: START, CENTER, END, JUSTIFIED",
          "title": "Alignment"
        },
        "shading_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Paragraph background color as hex (#RRGGBB) for callout boxes",
          "title": "Shading Color"
        },
        "as_bullet": {
          "default": false,
          "description": "Format as bullet list",
          "title": "As Bullet",
          "type": "boolean"
        },
        "as_numbered": {
          "default": false,
          "description": "Format as numbered list. Use with nesting_level for hierarchical numbering (1, 1.1, 1.1.1)",
          "title": "As Numbered",
          "type": "boolean"
        },
        "nesting_level": {
          "default": 0,
          "description": "List nesting level (0=top, 1=indented, 2=double). Only with as_bullet/as_numbered.",
          "title": "Nesting Level",
          "type": "integer"
        },
        "as_pull_quote": {
          "default": false,
          "description": "Style as a pull quote with left border, indentation, and italic text. Combine with text_color for colored border.",
          "title": "As Pull Quote",
          "type": "boolean"
        },
        "right_text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Text rendered flush right on the same visual line as the block's text/runs (e.g. a date opposite a job title). Rendered internally as a borderless two-column table since the Docs API cannot create tab stops; the block's styling fields apply to the left content, and right_text inherits NORMAL_TEXT styling. Not combinable with block_type, as_bullet/as_numbered, or as_pull_quote.",
          "title": "Right Text"
        }
      },
      "title": "StyledBlock",
      "type": "object",
      "additionalProperties": false
    },
    "TextRun": {
      "description": "A single run of text with its own formatting within a styled block.",
      "properties": {
        "text": {
          "description": "Text content for this run",
          "title": "Text",
          "type": "string"
        },
        "bold": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply bold formatting",
          "title": "Bold"
        },
        "italic": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply italic formatting",
          "title": "Italic"
        },
        "underline": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply underline formatting",
          "title": "Underline"
        },
        "text_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Hex color e.g. '#CC0000'",
          "title": "Text Color"
        },
        "background_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Hex color for text background",
          "title": "Background Color"
        },
        "font_family": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Font family name",
          "title": "Font Family"
        },
        "font_size_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Font size in points",
          "title": "Font Size Pt"
        },
        "link_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL to link this run to",
          "title": "Link Url"
        }
      },
      "required": [
        "text"
      ],
      "title": "TextRun",
      "type": "object",
      "additionalProperties": false
    }
  },
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "blocks": {
      "description": "List of styled blocks to append",
      "items": {
        "$ref": "#/$defs/StyledBlock"
      },
      "title": "Blocks",
      "type": "array"
    }
  },
  "required": [
    "document_id",
    "blocks"
  ],
  "title": "AppendStyledBlocksParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "$defs": {
    "BlockResult": {
      "description": "Result for a single block in batch append.",
      "properties": {
        "start_index": {
          "description": "Start index of this block",
          "title": "Start Index",
          "type": "integer"
        },
        "end_index": {
          "description": "End index of this block",
          "title": "End Index",
          "type": "integer"
        },
        "length": {
          "description": "Number of characters in this block",
          "title": "Length",
          "type": "integer"
        }
      },
      "required": [
        "start_index",
        "end_index",
        "length"
      ],
      "title": "BlockResult",
      "type": "object"
    }
  },
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "blocks_appended": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of blocks appended",
      "title": "Blocks Appended"
    },
    "total_length": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Total characters inserted",
      "title": "Total Length"
    },
    "blocks": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/BlockResult"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Details for each appended block",
      "title": "Blocks"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "AppendStyledBlocksResult",
  "type": "object"
}

# append_text write

Append plain text to the end of a document and return where the text was added.

Full description
Append text at the end of the document.

    This is a convenience wrapper around insert_text that automatically finds
    the document end position.

    Args:
        document_id: The Google Docs document ID
        text: Text to append

    Returns:
        Information about the appended text including start and end indices

    Example: {"document_id": "abc123", "text": "New paragraph at end.
"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
text string Yes Text to append
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "text": {
      "description": "Text to append",
      "title": "Text",
      "type": "string"
    }
  },
  "required": [
    "document_id",
    "text"
  ],
  "title": "AppendTextParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "inserted_length": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of characters inserted",
      "title": "Inserted Length"
    },
    "start_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Start index of inserted text",
      "title": "Start Index"
    },
    "end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "End index of inserted text",
      "title": "End Index"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "AppendTextResult",
  "type": "object"
}

# apply_named_style write

Apply a Google Docs named paragraph style to a range for proper headings, titles, and TOC-friendly structure.

Full description
Apply a named paragraph style to a range.

THIS IS THE CRITICAL TOOL for proper document formatting. Named styles
(HEADING_1, TITLE, etc.) render correctly in Google Docs and enable
automatic table of contents generation.

If style preferences have been set for this named style using
set_style_preferences, text style overrides (bold, color, font, etc.)
will be automatically applied in addition to the named style.

IMPORTANT:
- Style applies to entire paragraphs that overlap the range
- Named styles override manual formatting
- Proper heading hierarchy enables automatic table of contents
- Style preferences are applied after the named style

Valid styles:
- TITLE - Document title
- SUBTITLE - Document subtitle
- HEADING_1 through HEADING_6
- NORMAL_TEXT - Regular paragraph

Args:
    document_id: The Google Docs document ID
    start_index: Start of range (inclusive)
    end_index: End of range (exclusive)
    named_style: The style to apply (TITLE, HEADING_1, etc.)

Returns:
    The range that was formatted

Example: {"document_id": "abc123", "start_index": 1, "end_index": 24, "named_style": "HEADING_1"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
start_index integer Yes Start of range (1-based, inclusive)
end_index integer Yes End of range (1-based, exclusive)
named_style string Yes Style to apply: TITLE, SUBTITLE, HEADING_1 through HEADING_6, or NORMAL_TEXT
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "start_index": {
      "description": "Start of range (1-based, inclusive)",
      "title": "Start Index",
      "type": "integer"
    },
    "end_index": {
      "description": "End of range (1-based, exclusive)",
      "title": "End Index",
      "type": "integer"
    },
    "named_style": {
      "description": "Style to apply: TITLE, SUBTITLE, HEADING_1 through HEADING_6, or NORMAL_TEXT",
      "title": "Named Style",
      "type": "string"
    }
  },
  "required": [
    "document_id",
    "start_index",
    "end_index",
    "named_style"
  ],
  "title": "ApplyNamedStyleParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "range_formatted": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The range that was formatted (startIndex, endIndex)",
      "title": "Range Formatted"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "ApplyStyleResult",
  "type": "object"
}

# apply_paragraph_style write

Apply custom paragraph formatting like alignment, spacing, and indentation to a text range.

Full description
Apply custom paragraph formatting to a range.

Only specified parameters are changed; others retain current values.
72 points = 1 inch.

Args:
    document_id: The Google Docs document ID
    start_index: Start of range (inclusive)
    end_index: End of range (exclusive)
    alignment: START, CENTER, END, or JUSTIFIED
    line_spacing: Line spacing (1.0, 1.15, 1.5, 2.0)
    space_above_pt: Space above paragraph in points
    space_below_pt: Space below paragraph in points
    indent_start_pt: Left indent in points
    indent_end_pt: Right indent in points
    indent_first_line_pt: First line indent in points

Returns:
    The range that was formatted

Example: {"document_id": "abc123", "start_index": 1, "end_index": 50, "alignment": "CENTER", "line_spacing": 1.5}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
start_index integer Yes Start of range (1-based, inclusive)
end_index integer Yes End of range (1-based, exclusive)
alignment string | null No Alignment: START, CENTER, END, JUSTIFIED
line_spacing number | null No Line spacing: 1.0, 1.15, 1.5, 2.0
space_above_pt number | null No Space above paragraph in points
space_below_pt number | null No Space below paragraph in points
indent_start_pt number | null No Left indent in points (72 points = 1 inch)
indent_end_pt number | null No Right indent in points
indent_first_line_pt number | null No First line indent in points
tab_stops array<object> | null No Tab stops. Each dict: {offset_pt: float, alignment: 'START'|'CENTER'|'END'}
border_left object | null No Left paragraph border: {color: '#RRGGBB', widthPt: float, dashStyle: 'SOLID'|'DOT'|'DASH'}
border_right object | null No Right paragraph border: {color: '#RRGGBB', widthPt: float, dashStyle: 'SOLID'|'DOT'|'DASH'}
border_top object | null No Top paragraph border: {color: '#RRGGBB', widthPt: float, dashStyle: 'SOLID'|'DOT'|'DASH'}
border_bottom object | null No Bottom paragraph border: {color: '#RRGGBB', widthPt: float, dashStyle: 'SOLID'|'DOT'|'DASH'}
shading_color string | null No Paragraph background/shading color as hex string (#RRGGBB). Use for callout boxes and highlighted sections.
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "start_index": {
      "description": "Start of range (1-based, inclusive)",
      "title": "Start Index",
      "type": "integer"
    },
    "end_index": {
      "description": "End of range (1-based, exclusive)",
      "title": "End Index",
      "type": "integer"
    },
    "alignment": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Alignment: START, CENTER, END, JUSTIFIED",
      "title": "Alignment"
    },
    "line_spacing": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Line spacing: 1.0, 1.15, 1.5, 2.0",
      "title": "Line Spacing"
    },
    "space_above_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Space above paragraph in points",
      "title": "Space Above Pt"
    },
    "space_below_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Space below paragraph in points",
      "title": "Space Below Pt"
    },
    "indent_start_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Left indent in points (72 points = 1 inch)",
      "title": "Indent Start Pt"
    },
    "indent_end_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Right indent in points",
      "title": "Indent End Pt"
    },
    "indent_first_line_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "First line indent in points",
      "title": "Indent First Line Pt"
    },
    "tab_stops": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Tab stops. Each dict: {offset_pt: float, alignment: 'START'|'CENTER'|'END'}",
      "title": "Tab Stops"
    },
    "border_left": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Left paragraph border: {color: '#RRGGBB', widthPt: float, dashStyle: 'SOLID'|'DOT'|'DASH'}",
      "title": "Border Left"
    },
    "border_right": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Right paragraph border: {color: '#RRGGBB', widthPt: float, dashStyle: 'SOLID'|'DOT'|'DASH'}",
      "title": "Border Right"
    },
    "border_top": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Top paragraph border: {color: '#RRGGBB', widthPt: float, dashStyle: 'SOLID'|'DOT'|'DASH'}",
      "title": "Border Top"
    },
    "border_bottom": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Bottom paragraph border: {color: '#RRGGBB', widthPt: float, dashStyle: 'SOLID'|'DOT'|'DASH'}",
      "title": "Border Bottom"
    },
    "shading_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Paragraph background/shading color as hex string (#RRGGBB). Use for callout boxes and highlighted sections.",
      "title": "Shading Color"
    }
  },
  "required": [
    "document_id",
    "start_index",
    "end_index"
  ],
  "title": "ApplyParagraphStyleParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "range_formatted": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The range that was formatted (startIndex, endIndex)",
      "title": "Range Formatted"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "ApplyStyleResult",
  "type": "object"
}

# apply_text_style write

Apply inline text formatting like bold, italic, colors, fonts, and links to a character range.

Full description
Apply character-level formatting to a text range.

This tool applies inline formatting like bold, italic, colors, and links
to specific text ranges.

Args:
    document_id: The Google Docs document ID
    start_index: Start of range (inclusive)
    end_index: End of range (exclusive)
    bold: Apply bold formatting
    italic: Apply italic formatting
    underline: Apply underline formatting
    strikethrough: Apply strikethrough formatting
    font_family: Font family name (e.g., "Arial", "Times New Roman")
    font_size_pt: Font size in points
    text_color: Text color as hex string (#RRGGBB)
    background_color: Background color as hex string (#RRGGBB)
    link_url: URL to link the text to

Returns:
    The range that was formatted

Example: {"document_id": "abc123", "start_index": 1, "end_index": 12, "bold": true, "text_color": "#1a73e8"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
start_index integer Yes Start of range (1-based, inclusive)
end_index integer Yes End of range (1-based, exclusive)
bold boolean | null No Apply bold formatting
italic boolean | null No Apply italic formatting
underline boolean | null No Apply underline formatting
strikethrough boolean | null No Apply strikethrough formatting
font_family string | null No Font family name (e.g., 'Arial', 'Times New Roman')
font_size_pt number | null No Font size in points
text_color string | null No Text color as hex string (#RRGGBB)
background_color string | null No Background color as hex string (#RRGGBB)
link_url string | null No URL to link the text to
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "start_index": {
      "description": "Start of range (1-based, inclusive)",
      "title": "Start Index",
      "type": "integer"
    },
    "end_index": {
      "description": "End of range (1-based, exclusive)",
      "title": "End Index",
      "type": "integer"
    },
    "bold": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply bold formatting",
      "title": "Bold"
    },
    "italic": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply italic formatting",
      "title": "Italic"
    },
    "underline": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply underline formatting",
      "title": "Underline"
    },
    "strikethrough": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply strikethrough formatting",
      "title": "Strikethrough"
    },
    "font_family": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Font family name (e.g., 'Arial', 'Times New Roman')",
      "title": "Font Family"
    },
    "font_size_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Font size in points",
      "title": "Font Size Pt"
    },
    "text_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Text color as hex string (#RRGGBB)",
      "title": "Text Color"
    },
    "background_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Background color as hex string (#RRGGBB)",
      "title": "Background Color"
    },
    "link_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "URL to link the text to",
      "title": "Link Url"
    }
  },
  "required": [
    "document_id",
    "start_index",
    "end_index"
  ],
  "title": "ApplyTextStyleParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "range_formatted": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The range that was formatted (startIndex, endIndex)",
      "title": "Range Formatted"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "ApplyStyleResult",
  "type": "object"
}

# batch_apply_text_style write

Apply inline formatting to many noncontiguous ranges in one efficient batch update.

Full description
Apply text formatting to multiple non-contiguous ranges in a single API call.

More efficient than calling apply_text_style repeatedly. All formatting
operations are sent in one batchUpdate request.

Args:
    document_id: The Google Docs document ID
    styles: List of style operations, each with startIndex, endIndex, and
            formatting options (bold, italic, underline, strikethrough,
            foregroundColor, backgroundColor, fontSizePt, fontFamily, linkUrl)

Returns:
    Number of ranges formatted

Example: {"document_id": "abc123", "styles": [{"startIndex": 1, "endIndex": 5, "bold": true}, {"startIndex": 10, "endIndex": 20, "foregroundColor": "#cc0000"}]}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
styles array<object> Yes List of text style operations. Each dict has: 'startIndex', 'endIndex', and formatting options (bold, italic, underline, strikethrough, foregroundColor, backgroundColor, fontSizePt, fontFamily, linkUrl). Example: [{'startIndex': 1, 'endIndex': 10, 'bold': true}, {'startIndex': 20, 'endIndex': 30, 'foregroundColor': '#FF0000'}]
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "styles": {
      "description": "List of text style operations. Each dict has: 'startIndex', 'endIndex', and formatting options (bold, italic, underline, strikethrough, foregroundColor, backgroundColor, fontSizePt, fontFamily, linkUrl). Example: [{'startIndex': 1, 'endIndex': 10, 'bold': true}, {'startIndex': 20, 'endIndex': 30, 'foregroundColor': '#FF0000'}]",
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "title": "Styles",
      "type": "array"
    }
  },
  "required": [
    "document_id",
    "styles"
  ],
  "title": "BatchApplyTextStyleParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "ranges_formatted": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of ranges formatted",
      "title": "Ranges Formatted"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "BatchApplyTextStyleResult",
  "type": "object"
}

# batch_format_by_text_match write

Find multiple text patterns and format all matches in one batched operation.

Full description
Find and format multiple text patterns in a single API call.

Accepts an array of format specs, each with a findText and styling
options.  Searches the document once, builds all formatting requests,
and executes them in one batchUpdate call.

Args:
    document_id: The Google Docs document ID
    formats: Array of format specs, each with:
        - findText (required): Text to search for
        - matchCase: Case-sensitive search (default: False)
        - bold, italic, underline, strikethrough: Boolean formatting
        - foregroundColor, backgroundColor: Hex color (#RRGGBB)
        - linkUrl: URL to link the text to

Returns:
    Per-spec match counts and total

Example: {"document_id": "abc123", "formats": [{"findText": "WARNING", "bold": true, "foregroundColor": "#ea4335"}, {"findText": "NOTE", "italic": true, "foregroundColor": "#1a73e8"}]}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
formats array<object> Yes Array of format specs: [{findText, matchCase?, bold?, italic?, underline?, foregroundColor?, backgroundColor?, linkUrl?}]
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "formats": {
      "description": "Array of format specs: [{findText, matchCase?, bold?, italic?, underline?, foregroundColor?, backgroundColor?, linkUrl?}]",
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "title": "Formats",
      "type": "array"
    }
  },
  "required": [
    "document_id",
    "formats"
  ],
  "title": "BatchFormatByTextMatchParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "results": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Per-spec results: [{findText, matchesFormatted}]",
      "title": "Results"
    },
    "total_matches_formatted": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Total matches formatted across all specs",
      "title": "Total Matches Formatted"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "BatchFormatByTextMatchResult",
  "type": "object"
}

# batch_replace_and_format write

Replace multiple placeholders and format the inserted values in one template-friendly operation.

Full description
Replace text placeholders and format the replacement values in one tool call.

Combines batch_replace_text and batch_format_by_text_match into a single
atomic operation. First replaces all placeholders, then searches for the
replacement values and applies formatting.

Ideal for template/mail-merge workflows where you need to replace tokens
like {{NAME}} and format the result as bold, colored, etc.

Note: The replace step affects all segments (body, headers, footers) via
the Google API's replaceAllText. The format step only applies to the
document body. Replacements in headers/footers will be replaced but not
formatted.

Args:
    document_id: The Google Docs document ID
    replacements: Array of replace+format specs, each with:
        - find: Text to find
        - replace: Text to replace with
        - matchCase: Case-sensitive (default: False)
        - bold, italic, underline: Optional formatting
        - foregroundColor: Hex color (#RRGGBB)
        - backgroundColor: Hex color (#RRGGBB)
        - linkUrl: URL to link to

Returns:
    Total replacements and format operations applied

Example: {"document_id": "abc123", "replacements": [{"find": "{{NAME}}", "replace": "Alexandra Chen", "bold": true}, {"find": "{{STATUS}}", "replace": "Approved", "foregroundColor": "#34a853"}]}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
replacements array<object> Yes Array of replace+format specs: [{find, replace, matchCase?, bold?, italic?, underline?, foregroundColor?, backgroundColor?, linkUrl?}]. Example: [{'find': '{{NAME}}', 'replace': 'Alexandra Chen', 'bold': true}]
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "replacements": {
      "description": "Array of replace+format specs: [{find, replace, matchCase?, bold?, italic?, underline?, foregroundColor?, backgroundColor?, linkUrl?}]. Example: [{'find': '{{NAME}}', 'replace': 'Alexandra Chen', 'bold': true}]",
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "title": "Replacements",
      "type": "array"
    }
  },
  "required": [
    "document_id",
    "replacements"
  ],
  "title": "BatchReplaceAndFormatParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "total_replaced": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Total replacements made",
      "title": "Total Replaced"
    },
    "total_formatted": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Total format operations applied",
      "title": "Total Formatted"
    },
    "per_token": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Per-token results: [{find, replace, occurrences}]",
      "title": "Per Token"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "BatchReplaceAndFormatResult",
  "type": "object"
}

# batch_replace_text write

Replace multiple text patterns across a document in one efficient batch request.

Full description
Replace multiple text patterns in a single API call.

Accepts an array of {find, replace, matchCase?} pairs and executes all
replacements in one batchUpdate request.  Much more efficient than
calling replace_text multiple times — ideal for template/mail-merge
workflows.

Args:
    document_id: The Google Docs document ID
    replacements: Array of {find, replace, matchCase?} pairs

Returns:
    Per-replacement occurrence counts and total

Example: {"document_id": "abc123", "replacements": [{"find": "{{NAME}}", "replace": "Alice"}, {"find": "{{DATE}}", "replace": "2026-04-04"}]}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
replacements array<object> Yes Array of {find, replace, matchCase?} pairs
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "replacements": {
      "description": "Array of {find, replace, matchCase?} pairs",
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "title": "Replacements",
      "type": "array"
    }
  },
  "required": [
    "document_id",
    "replacements"
  ],
  "title": "BatchReplaceTextParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "results": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Per-replacement results: [{find, occurrencesChanged}]",
      "title": "Results"
    },
    "total_occurrences_changed": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Total replacements across all pairs",
      "title": "Total Occurrences Changed"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "BatchReplaceTextResult",
  "type": "object"
}

# batch_update write

Execute many document edits atomically in order, returning batch update results or failing as a unit.

Full description
Execute multiple operations atomically.

    All operations succeed together or fail together. Maximum 100 operations per batch.

    IMPORTANT - Index Calculation:
    Operations execute in order. Account for changes from earlier operations.

    Example - calculate indices based on prior operations:
        batch_update("doc-id", [
            {"insert_text": {"index": 1, "text": "Hello\n"}},      # Inserts 6 chars
            {"insert_text": {"index": 7, "text": "World\n"}}       # Correct: 1 + 6 = 7
        ])

    Alternative - insert in reverse order (end to start):
        batch_update("doc-id", [
            {"insert_text": {"index": 100, "text": "Second\n"}},   # Later content first
            {"insert_text": {"index": 1, "text": "First\n"}}       # Then earlier content
        ])

    Available operations (both camelCase and snake_case parameter names accepted):
    - insert_text: {"index": int, "text": str}
    - delete_content: {"startIndex": int, "endIndex": int}
    - apply_named_style: {"startIndex": int, "endIndex": int, "namedStyle": str}
    - apply_text_style: {"startIndex": int, "endIndex": int, "bold"?: bool, "italic"?: bool,
        "underline"?: bool, "strikethrough"?: bool, "fontFamily"?: str, "fontSizePt"?: float,
        "foregroundColor"?: str, "backgroundColor"?: str, "linkUrl"?: str}
    - apply_paragraph_style: {"startIndex": int, "endIndex": int, "alignment"?: str,
        "lineSpacing"?: float, "spaceAbovePt"?: float, "spaceBelowPt"?: float, "tabStops"?: list}
    - create_bullets: {"startIndex": int, "endIndex": int, "preset"?: str}
    - remove_bullets: {"startIndex": int, "endIndex": int}
    - insert_page_break: {"index": int}
    - insert_table: {"index": int, "rows": int, "columns": int}
    - insert_horizontal_rule: {"index": int}
    - insert_inline_image: {"index": int, "uri": str, "widthPt"?: float, "heightPt"?: float}
    - insert_section_break: {"index": int, "sectionType"?: str}
    - update_document_style: {"marginTop"?: float, "marginBottom"?: float, "marginLeft"?: float, "marginRight"?: float}

    Args:
        document_id: The Google Docs document ID
        operations: Array of operation objects

    Returns:
        Number of operations executed

    Example: {"document_id": "abc123", "operations": [{"insert_text": {"index": 1, "text": "Title
"}}, {"apply_named_style": {"startIndex": 1, "endIndex": 7, "namedStyle": "HEADING_1"}}]}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
operations array<object> Yes Array of operation objects. Each has one key mapping to params.
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "operations": {
      "description": "Array of operation objects. Each has one key mapping to params.",
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "title": "Operations",
      "type": "array"
    }
  },
  "required": [
    "document_id",
    "operations"
  ],
  "title": "BatchUpdateParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "operations_executed": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of operations executed",
      "title": "Operations Executed"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "BatchUpdateResult",
  "type": "object"
}

# create_bullets write

Apply bullet, numbered, or hierarchical list formatting to paragraphs in a range.

Full description
Apply bullet or numbered list formatting.

Available presets:
- Bullets: BULLET_DISC_CIRCLE_SQUARE, BULLET_DIAMONDX_ARROW3D_SQUARE, BULLET_CHECKBOX
- Numbered: NUMBERED_DECIMAL_ALPHA_ROMAN (1, a, i), NUMBERED_UPPERALPHA_ALPHA_ROMAN (A, a, i)
- Hierarchical: NUMBERED_DECIMAL_NESTED (1, 1.1, 1.1.1) — for legal/outline style

For hierarchical numbering (1 → 1.1 → 1.1.1), use NUMBERED_DECIMAL_NESTED
and indent sub-items with tab characters. When using append_styled_blocks,
set nestingLevel (0=top, 1=sub, 2=sub-sub) with asNumbered=true.

Args:
    document_id: The Google Docs document ID
    start_index: Start of range (inclusive)
    end_index: End of range (exclusive)
    preset: Bullet preset (default: BULLET_DISC_CIRCLE_SQUARE)

Returns:
    The range that was formatted

Example: {"document_id": "abc123", "start_index": 10, "end_index": 80, "preset": "BULLET_DISC_CIRCLE_SQUARE"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
start_index integer Yes Start of range (1-based, inclusive)
end_index integer Yes End of range (1-based, exclusive)
preset string No Bullet preset: BULLET_DISC_CIRCLE_SQUARE, BULLET_DIAMONDX_ARROW3D_SQUARE, BULLET_CHECKBOX, NUMBERED_DECIMAL_NESTED, NUMBERED_DECIMAL_ALPHA_ROMAN, NUMBERED_UPPERALPHA_ALPHA_ROMAN Default: "BULLET_DISC_CIRCLE_SQUARE"
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "start_index": {
      "description": "Start of range (1-based, inclusive)",
      "title": "Start Index",
      "type": "integer"
    },
    "end_index": {
      "description": "End of range (1-based, exclusive)",
      "title": "End Index",
      "type": "integer"
    },
    "preset": {
      "default": "BULLET_DISC_CIRCLE_SQUARE",
      "description": "Bullet preset: BULLET_DISC_CIRCLE_SQUARE, BULLET_DIAMONDX_ARROW3D_SQUARE, BULLET_CHECKBOX, NUMBERED_DECIMAL_NESTED, NUMBERED_DECIMAL_ALPHA_ROMAN, NUMBERED_UPPERALPHA_ALPHA_ROMAN",
      "title": "Preset",
      "type": "string"
    }
  },
  "required": [
    "document_id",
    "start_index",
    "end_index"
  ],
  "title": "CreateBulletsParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "range_formatted": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The range that was formatted (startIndex, endIndex)",
      "title": "Range Formatted"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "ApplyStyleResult",
  "type": "object"
}

# create_document write

Create a new Google Doc with optional folder placement, style preset, and page-number setup, returning document IDs.

Full description
Create a new Google Doc and return its identifiers.

This tool creates a new Google Doc with the given title. It optionally places
the document into a specific Google Drive folder if folder_id is provided.
If no folder is specified, the document is created in the default ToolforestDocs folder.

Style presets allow you to create documents with predefined named style definitions:
- "default": Uses Google Docs default styles (current behavior)
- "recommended": Professional styles with hierarchical sizing (20pt bold title, 14pt bold H1, etc.)
- "custom": Use your own style definitions via the custom_styles parameter

The recommended preset uses these styles:
- TITLE: 20pt, bold
- SUBTITLE: 13pt, italic
- HEADING_1: 14pt, bold
- HEADING_2: 12pt, bold
- HEADING_3: 11pt, bold
- HEADING_4: 11pt, bold italic
- HEADING_5: 10pt, bold
- HEADING_6: 10pt, italic
- NORMAL_TEXT: 11pt

Page numbers can be added at creation time using the page_numbers parameter.
This produces native auto-incrementing page numbers (via .docx import).
Requires style_preset="recommended" or "custom" (not "default").

IMPORTANT: Page numbers occupy either the header or footer segment. If you
also want custom text (e.g., "Confidential"), place it in the OTHER segment.
For example, use page_numbers in HEADER and set_footer for custom text, or
vice versa. Calling set_header/set_footer on the same segment as page_numbers
will replace the page numbers.

Example with page numbers in header + custom footer:
    create_document(
        title="Quarterly Report",
        style_preset="recommended",
        page_numbers={"position": "HEADER", "alignment": "END", "format": "PAGE_OF_TOTAL"}
    )
    # Then use set_footer for custom text in the footer

Typical uses:
- Creating a new weekly/monthly health report
- Starting a fresh note-taking doc for a project or meeting
- Generating a document to hold podcast or research summaries
- Creating documents with consistent professional styling
- Creating professional documents with auto-incrementing page numbers

Args:
    title: Human-readable title for the document
    folder_id: Optional Drive folder ID where the document should be created
    style_preset: Style preset to use ("default", "recommended", "custom")
    custom_styles: Custom style definitions when style_preset="custom".
        Each named style (TITLE, SUBTITLE, HEADING_1-6, NORMAL_TEXT) accepts
        font_size_pt, bold, italic, text_color, and font_family (e.g. "Arial")
    page_numbers: Optional page number config with position (HEADER/FOOTER),
        alignment (START/CENTER/END), and format (PAGE_ONLY or PAGE_OF_TOTAL).
        Only works with style_preset="recommended" or "custom".
        Note: occupies the header or footer segment — use the other segment
        for custom text via set_header/set_footer.

Returns:
    Information about the created document including ID, URL, and title

Example: {"title": "Weekly Health Report", "style_preset": "recommended"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
title string Yes The title of the new document
folder_id string | null No Optional Drive folder ID where the document should be created
folder_name string | null No Optional folder name. Searches My Drive top-level folders; creates if not found; errors on multiple matches. Ignored if folder_id is provided.
style_preset "default" | "recommended" | "custom" No Style preset for document creation. 'default' uses Google Docs defaults, 'recommended' applies professional styles (20pt bold title, 14pt bold H1, etc.), 'custom' uses the styles from custom_styles parameter Default: "default"
custom_styles object | null No Custom style definitions when style_preset='custom'. Map of named style to style attributes. Example: {"HEADING_1": {"font_size_pt": 16, "bold": true}, "HEADING_2": {"font_size_pt": 13, "bold": true, "italic": true}, "NORMAL_TEXT": {"font_size_pt": 11}}. Valid keys: TITLE, SUBTITLE, HEADING_1-6, NORMAL_TEXT. Valid attributes: font_size_pt (float), bold (bool), italic (bool), text_color (str, e.g. '#1a73e8'), font_family (str, e.g. 'Arial')
page_numbers PageNumberConfig | null No Add auto-incrementing page numbers. Requires style_preset='recommended' or 'custom' (uses DOCX import). Set position (HEADER/FOOTER), alignment (START/CENTER/END), and format (PAGE_ONLY or PAGE_OF_TOTAL).
Parameter schema (JSON)
{
  "$defs": {
    "PageNumberConfig": {
      "description": "Configuration for auto-incrementing page numbers at document creation.",
      "properties": {
        "position": {
          "default": "FOOTER",
          "description": "Where to place page numbers: HEADER or FOOTER",
          "enum": [
            "HEADER",
            "FOOTER"
          ],
          "title": "Position",
          "type": "string"
        },
        "alignment": {
          "default": "CENTER",
          "description": "Text alignment: START, CENTER, or END",
          "enum": [
            "START",
            "CENTER",
            "END"
          ],
          "title": "Alignment",
          "type": "string"
        },
        "format": {
          "default": "PAGE_ONLY",
          "description": "Format: PAGE_ONLY (just number) or PAGE_OF_TOTAL ('Page 1 of 3')",
          "enum": [
            "PAGE_ONLY",
            "PAGE_OF_TOTAL"
          ],
          "title": "Format",
          "type": "string"
        }
      },
      "title": "PageNumberConfig",
      "type": "object",
      "additionalProperties": false
    }
  },
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "title": {
      "description": "The title of the new document",
      "title": "Title",
      "type": "string"
    },
    "folder_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Drive folder ID where the document should be created",
      "title": "Folder Id"
    },
    "folder_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional folder name. Searches My Drive top-level folders; creates if not found; errors on multiple matches. Ignored if folder_id is provided.",
      "title": "Folder Name"
    },
    "style_preset": {
      "default": "default",
      "description": "Style preset for document creation. 'default' uses Google Docs defaults, 'recommended' applies professional styles (20pt bold title, 14pt bold H1, etc.), 'custom' uses the styles from custom_styles parameter",
      "enum": [
        "default",
        "recommended",
        "custom"
      ],
      "title": "Style Preset",
      "type": "string"
    },
    "custom_styles": {
      "anyOf": [
        {
          "additionalProperties": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Custom style definitions when style_preset='custom'. Map of named style to style attributes. Example: {\"HEADING_1\": {\"font_size_pt\": 16, \"bold\": true}, \"HEADING_2\": {\"font_size_pt\": 13, \"bold\": true, \"italic\": true}, \"NORMAL_TEXT\": {\"font_size_pt\": 11}}. Valid keys: TITLE, SUBTITLE, HEADING_1-6, NORMAL_TEXT. Valid attributes: font_size_pt (float), bold (bool), italic (bool), text_color (str, e.g. '#1a73e8'), font_family (str, e.g. 'Arial')",
      "title": "Custom Styles"
    },
    "page_numbers": {
      "anyOf": [
        {
          "$ref": "#/$defs/PageNumberConfig"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Add auto-incrementing page numbers. Requires style_preset='recommended' or 'custom' (uses DOCX import). Set position (HEADER/FOOTER), alignment (START/CENTER/END), and format (PAGE_ONLY or PAGE_OF_TOTAL)."
    }
  },
  "required": [
    "title"
  ],
  "title": "CreateDocumentParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "document_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The created document ID",
      "title": "Document Id"
    },
    "document_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Browser URL for the document",
      "title": "Document Url"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The final title of the document",
      "title": "Title"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "CreateDocumentResult",
  "type": "object"
}

# delete_content write

Delete content in a character range and return how many characters were removed.

Full description
Delete content in a specified range.

Args:
    document_id: The Google Docs document ID
    start_index: Beginning of range to delete (inclusive)
    end_index: End of range to delete (exclusive)

Returns:
    Number of characters deleted

Example: {"document_id": "abc123", "start_index": 10, "end_index": 25}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
start_index integer Yes Beginning of range to delete (1-based, inclusive)
end_index integer Yes End of range to delete (1-based, exclusive)
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "start_index": {
      "description": "Beginning of range to delete (1-based, inclusive)",
      "title": "Start Index",
      "type": "integer"
    },
    "end_index": {
      "description": "End of range to delete (1-based, exclusive)",
      "title": "End Index",
      "type": "integer"
    }
  },
  "required": [
    "document_id",
    "start_index",
    "end_index"
  ],
  "title": "DeleteContentParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "deleted_length": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of characters deleted",
      "title": "Deleted Length"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "DeleteContentResult",
  "type": "object"
}

# duplicate_document write

Copy an existing Google Doc as a new document, useful for template-based workflows.

Full description
Duplicate an existing Google Doc, optionally with a new title.

This tool is useful for creating new docs from templates, such as:
- Weekly health reports
- Recurring meeting notes
- Project status reports

Args:
    source_document_id: The document ID of the source document to copy
    new_title: Optional new title for the duplicated document

Returns:
    Information about the new document including ID, URL, and title

Example: {"source_document_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ", "new_title": "Weekly Report - Week 14"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
source_document_id string Yes The document ID to duplicate
new_title string | null No Optional new title for the duplicated document
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "source_document_id": {
      "description": "The document ID to duplicate",
      "title": "Source Document Id",
      "type": "string"
    },
    "new_title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional new title for the duplicated document",
      "title": "New Title"
    }
  },
  "required": [
    "source_document_id"
  ],
  "title": "DuplicateDocumentParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "document_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The new document ID",
      "title": "Document Id"
    },
    "document_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Browser URL for the new document",
      "title": "Document Url"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The final title of the new document",
      "title": "Title"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "DuplicateDocumentResult",
  "type": "object"
}

# fill_table write

Fill an existing table with 2D data and optionally style the header row.

Full description
Populate an existing table with data in a single operation.

Fills cells row by row from the provided 2D data array. Optionally
applies header styling (bold, background color) to the first row.

Args:
    document_id: The Google Docs document ID
    table_start_index: startIndex of the table element
    data: 2D array of cell text content (rows x columns)
    header_style: Optional first-row style: {bold, backgroundColor, foregroundColor}

Returns:
    Number of cells populated

Example: {"document_id": "abc123", "table_start_index": 55, "data": [["Name", "Score"], ["Alice", "95"], ["Bob", "87"]], "header_style": {"bold": true, "backgroundColor": "#4285f4", "foregroundColor": "#ffffff"}}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
table_start_index integer Yes startIndex of the table element (1-based)
data array<array<string>> Yes 2D array of cell text content (rows x columns)
header_style object | null No Style for first row: {bold?: bool, backgroundColor?: str, foregroundColor?: str}
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "table_start_index": {
      "description": "startIndex of the table element (1-based)",
      "title": "Table Start Index",
      "type": "integer"
    },
    "data": {
      "description": "2D array of cell text content (rows x columns)",
      "items": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "title": "Data",
      "type": "array"
    },
    "header_style": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Style for first row: {bold?: bool, backgroundColor?: str, foregroundColor?: str}",
      "title": "Header Style"
    }
  },
  "required": [
    "document_id",
    "table_start_index",
    "data"
  ],
  "title": "FillTableParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "cells_filled": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of cells populated",
      "title": "Cells Filled"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "FillTableResult",
  "type": "object"
}

# format_by_text_match write

Find matching text and apply formatting or named styles to the occurrences.

Full description
Find text and apply formatting to matches.

This tool searches the document for text and applies formatting to matches.
Useful for highlighting specific terms, names, or phrases.

By default, only searches the document body. Use the 'segments' parameter
to control which document segments are searched.

Args:
    document_id: The Google Docs document ID
    find_text: Text to search for
    match_case: Case-sensitive search (default: False)
    occurrence: Only format the N-th match (1-based), or all if None
    segments: Limit search to 'body' (default), 'header', 'footer', or 'all'
    named_style: Named style to apply (only works if match covers full paragraph)
    bold: Apply bold formatting
    italic: Apply italic formatting
    underline: Apply underline formatting
    text_color: Text color as hex string (#RRGGBB)
    background_color: Background color as hex string (#RRGGBB)
    link_url: URL to link the text to

Returns:
    Number of matches that were formatted

Example: {"document_id": "abc123", "find_text": "IMPORTANT", "bold": true, "text_color": "#ea4335"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
find_text string Yes Text to search for
match_case boolean No Case-sensitive search Default: false
occurrence integer | null No Only format the N-th match (1-based), or all if None
segments "body" | "header" | "footer" | "all" | null No Limit search to specific segments: 'body' (default — body only), 'header', 'footer', 'all'. When null or 'body', matches in headers/footers are excluded.
named_style string | null No Named style to apply (if match covers full paragraph)
bold boolean | null No Apply bold formatting
italic boolean | null No Apply italic formatting
underline boolean | null No Apply underline formatting
text_color string | null No Text color as hex string (#RRGGBB)
background_color string | null No Background color as hex string (#RRGGBB)
link_url string | null No URL to link the text to
paragraph_alignment string | null No Paragraph alignment: START, CENTER, END, JUSTIFIED
line_spacing number | null No Line spacing multiplier (1.0, 1.15, 1.5, 2.0)
space_above_pt number | null No Space above paragraph in points
space_below_pt number | null No Space below paragraph in points
indent_start_pt number | null No Left indent in points
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "find_text": {
      "description": "Text to search for",
      "title": "Find Text",
      "type": "string"
    },
    "match_case": {
      "default": false,
      "description": "Case-sensitive search",
      "title": "Match Case",
      "type": "boolean"
    },
    "occurrence": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Only format the N-th match (1-based), or all if None",
      "title": "Occurrence"
    },
    "segments": {
      "anyOf": [
        {
          "enum": [
            "body",
            "header",
            "footer",
            "all"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Limit search to specific segments: 'body' (default — body only), 'header', 'footer', 'all'. When null or 'body', matches in headers/footers are excluded.",
      "title": "Segments"
    },
    "named_style": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Named style to apply (if match covers full paragraph)",
      "title": "Named Style"
    },
    "bold": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply bold formatting",
      "title": "Bold"
    },
    "italic": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply italic formatting",
      "title": "Italic"
    },
    "underline": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply underline formatting",
      "title": "Underline"
    },
    "text_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Text color as hex string (#RRGGBB)",
      "title": "Text Color"
    },
    "background_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Background color as hex string (#RRGGBB)",
      "title": "Background Color"
    },
    "link_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "URL to link the text to",
      "title": "Link Url"
    },
    "paragraph_alignment": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Paragraph alignment: START, CENTER, END, JUSTIFIED",
      "title": "Paragraph Alignment"
    },
    "line_spacing": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Line spacing multiplier (1.0, 1.15, 1.5, 2.0)",
      "title": "Line Spacing"
    },
    "space_above_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Space above paragraph in points",
      "title": "Space Above Pt"
    },
    "space_below_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Space below paragraph in points",
      "title": "Space Below Pt"
    },
    "indent_start_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Left indent in points",
      "title": "Indent Start Pt"
    }
  },
  "required": [
    "document_id",
    "find_text"
  ],
  "title": "FormatByTextMatchParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "matches_formatted": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of matches that were formatted",
      "title": "Matches Formatted"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "FormatByTextMatchResult",
  "type": "object"
}

# get_document read

Read a document's metadata, text structure, and character indices for paragraphs, tables, and formatting ranges.

Full description
Get document metadata and content structure with character indices.

This is the foundational read operation. Returns the document's structure
as an array of elements (paragraphs, tables, etc.) with their start and
end indices. These indices are required for all formatting operations.

IMPORTANT INDEX INFORMATION:
- Index 1 is the start of document body (index 0 is reserved)
- end_index is exclusive (like Python slicing)
- Newline characters count as 1 index position each
- named_style values: TITLE, SUBTITLE, HEADING_1-6, NORMAL_TEXT

Example response body:
    [
        {"type": "paragraph", "start_index": 1, "end_index": 24, "text": "Japan Travel Itinerary", "named_style": "TITLE"},
        {"type": "paragraph", "start_index": 25, "end_index": 53, "text": "Wednesday, January 28, 2026", "named_style": "HEADING_1"},
        {"type": "table", "start_index": 121, "end_index": 250, "rows": 3, "columns": 2}
    ]

Args:
    document_id: The Google Docs document ID
    include_structure: Whether to include the full body structure with indices (default: True)

Returns:
    Document metadata and structure with character indices

Example: {"document_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
include_structure boolean No Whether to include the full body structure with indices Default: true
include_text_styles boolean No Whether to include inline text style details (bold, italic, color, etc.) per text run in each paragraph. Increases response size. Default: false
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "include_structure": {
      "default": true,
      "description": "Whether to include the full body structure with indices",
      "title": "Include Structure",
      "type": "boolean"
    },
    "include_text_styles": {
      "default": false,
      "description": "Whether to include inline text style details (bold, italic, color, etc.) per text run in each paragraph. Increases response size.",
      "title": "Include Text Styles",
      "type": "boolean"
    }
  },
  "required": [
    "document_id"
  ],
  "title": "GetDocumentParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "document_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The document ID",
      "title": "Document Id"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The document title",
      "title": "Title"
    },
    "revision_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The document revision ID",
      "title": "Revision Id"
    },
    "body": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Array of content elements with indices (if includeStructure=True)",
      "title": "Body"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "GetDocumentResult",
  "type": "object"
}

# get_style_definitions read

Read the document's current named style definitions like title and heading font settings.

Full description
Get the current namedStyles definitions for a document.

Returns the font size, bold, and italic settings for all named styles
(TITLE, SUBTITLE, HEADING_1-6, NORMAL_TEXT). This is useful for:

- Understanding the current formatting of a document
- Comparing against recommended styles before applying them
- Debugging style issues when formatting doesn't look right

The response includes both the document's current styles AND the
recommended styles for easy comparison.

Args:
    document_id: The Google Docs document ID

Returns:
    Current style definitions and recommended styles for reference

Example: {"document_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    }
  },
  "required": [
    "document_id"
  ],
  "title": "GetStyleDefinitionsParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "document_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The document ID",
      "title": "Document Id"
    },
    "styles": {
      "anyOf": [
        {
          "additionalProperties": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Map of named style (TITLE, HEADING_1, etc.) to style properties (font_size_pt, bold, italic, font_family, text_color)",
      "title": "Styles"
    },
    "recommended_styles": {
      "anyOf": [
        {
          "additionalProperties": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Reference: The recommended style definitions for comparison",
      "title": "Recommended Styles"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "GetStyleDefinitionsResult",
  "type": "object"
}

# get_style_preferences read

Get stored style preferences for a document.

Full description
Get stored style preferences for a document.

Returns the style overrides that have been set for named styles.
These preferences are automatically applied when using apply_named_style
or append_styled_block.

Args:
    document_id: The Google Docs document ID

Returns:
    Map of named style to style overrides

Example: {"document_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    }
  },
  "required": [
    "document_id"
  ],
  "title": "GetStylePreferencesParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "preferences": {
      "anyOf": [
        {
          "additionalProperties": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Map of namedStyle to style overrides",
      "title": "Preferences"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "GetStylePreferencesResult",
  "type": "object"
}

# insert_bookmark write

Create a named range bookmark anchor for internal links and document navigation.

Full description
Create a named range (bookmark) at the specified position.

Named ranges serve as anchors that other text can link to via
link_to_bookmark. Useful for creating internal document navigation
like "Back to Table of Contents" links.

Args:
    document_id: The Google Docs document ID
    start_index: Start index for the named range
    end_index: End index for the named range
    name: Name for the bookmark

Returns:
    The named range ID and name

Example: {"document_id": "abc123", "start_index": 1, "end_index": 24, "name": "table-of-contents"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
start_index integer Yes Start index for the named range anchor (1-based)
end_index integer Yes End index for the named range anchor (1-based)
name string Yes Name for the bookmark (used to identify it later)
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "start_index": {
      "description": "Start index for the named range anchor (1-based)",
      "title": "Start Index",
      "type": "integer"
    },
    "end_index": {
      "description": "End index for the named range anchor (1-based)",
      "title": "End Index",
      "type": "integer"
    },
    "name": {
      "description": "Name for the bookmark (used to identify it later)",
      "title": "Name",
      "type": "string"
    }
  },
  "required": [
    "document_id",
    "start_index",
    "end_index",
    "name"
  ],
  "title": "InsertBookmarkParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "named_range_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The created named range ID",
      "title": "Named Range Id"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The bookmark name",
      "title": "Name"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertBookmarkResult",
  "type": "object"
}

# insert_footnote write

Insert a footnote reference at a position and populate its footnote text.

Full description
Insert a footnote at the specified position.

Creates a footnote reference mark at the given index and populates the
footnote body with the provided text.

Args:
    document_id: The Google Docs document ID
    index: Position in the document body to place the footnote reference
    footnote_text: Text content for the footnote body

Returns:
    The footnote ID and insertion index

Example: {"document_id": "abc123", "index": 42, "footnote_text": "Source: WHO 2025 Global Health Report"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
index integer Yes Position in document body to place footnote reference (1-based)
footnote_text string Yes Text content of the footnote
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "index": {
      "description": "Position in document body to place footnote reference (1-based)",
      "title": "Index",
      "type": "integer"
    },
    "footnote_text": {
      "description": "Text content of the footnote",
      "title": "Footnote Text",
      "type": "string"
    }
  },
  "required": [
    "document_id",
    "index",
    "footnote_text"
  ],
  "title": "InsertFootnoteParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "footnote_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The created footnote ID",
      "title": "Footnote Id"
    },
    "inserted_at": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Index where footnote reference was inserted",
      "title": "Inserted At"
    },
    "new_end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "New document end index after insertion",
      "title": "New End Index"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertFootnoteResult",
  "type": "object"
}

# insert_footnote_after_text write

Find text and insert a footnote immediately after the match without needing indices.

Full description
Find text and insert a footnote at the end of the match.

Searches the document for the specified text and inserts a footnote
reference at the end of the match, without requiring the caller to
know the exact character index.  The footnote body is populated with
the provided text.

When multiple footnotes target the same document, call this tool from
last occurrence to first (highest occurrence number first) to avoid
index shifts.  Or simply call once per occurrence — the tool fetches
fresh indices each time.

Args:
    document_id: The Google Docs document ID
    find_text: Text to search for — footnote is inserted after this text
    footnote_text: Text content for the footnote body
    occurrence: Which occurrence to target (1-based, default: first)
    match_case: Case-sensitive search (default: False)

Returns:
    The footnote ID, insertion index, matched text, and new end index

Example: {"document_id": "abc123", "find_text": "global warming", "footnote_text": "IPCC AR6, 2023"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
find_text string Yes Text to search for — footnote is inserted after this text
footnote_text string Yes Text content for the footnote body
occurrence integer No Which occurrence to target (1-based, default: first match) Default: 1
match_case boolean No Case-sensitive search (default: False) Default: false
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "find_text": {
      "description": "Text to search for — footnote is inserted after this text",
      "minLength": 1,
      "title": "Find Text",
      "type": "string"
    },
    "footnote_text": {
      "description": "Text content for the footnote body",
      "title": "Footnote Text",
      "type": "string"
    },
    "occurrence": {
      "default": 1,
      "description": "Which occurrence to target (1-based, default: first match)",
      "title": "Occurrence",
      "type": "integer"
    },
    "match_case": {
      "default": false,
      "description": "Case-sensitive search (default: False)",
      "title": "Match Case",
      "type": "boolean"
    }
  },
  "required": [
    "document_id",
    "find_text",
    "footnote_text"
  ],
  "title": "InsertFootnoteAfterTextParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "footnote_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The created footnote ID",
      "title": "Footnote Id"
    },
    "inserted_at": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Document index where footnote was inserted",
      "title": "Inserted At"
    },
    "matched_text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The text that was matched",
      "title": "Matched Text"
    },
    "new_end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "New document end index after insertion",
      "title": "New End Index"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertFootnoteAfterTextResult",
  "type": "object"
}

# insert_horizontal_rule write

Insert a visual divider line at a paragraph boundary using bordered paragraph formatting.

Full description
Insert a horizontal rule (divider line) at the specified position.

Note: Google Docs doesn't have a direct horizontal rule element.
This inserts a paragraph with a bottom border as a visual divider.

The insertion index is automatically snapped to the nearest paragraph
boundary to avoid splitting text mid-paragraph.

Args:
    document_id: The Google Docs document ID
    index: Position to insert at (snapped to paragraph boundary)

Returns:
    Index where element was inserted

Example: {"document_id": "abc123", "index": 50}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
index integer Yes Position to insert at (1-based)
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "index": {
      "description": "Position to insert at (1-based)",
      "title": "Index",
      "type": "integer"
    }
  },
  "required": [
    "document_id",
    "index"
  ],
  "title": "InsertHorizontalRuleParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "inserted_at": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Index where element was inserted",
      "title": "Inserted At"
    },
    "new_end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "New document end index after insertion (use for subsequent operations)",
      "title": "New End Index"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertElementResult",
  "type": "object"
}

# insert_image write

Insert an inline image into a Google Doc at a position or near matching text, from either a public URL or encoded image bytes.

Full description
Insert an inline image at the specified position.

Provide either:
- image_url: a publicly accessible HTTPS URL that returns an image directly
- image_data + media_type: encoded image bytes with MIME type

Set image_encoding to control how image_data is decoded:
- "hex" (default, recommended): hexadecimal encoding (e.g. "89504e47...").
  Strongly recommended for chatbot/LLM callers — base64 strings often
  trigger API-key or credential content filters in message pipelines.
- "base64": standard base64 encoding

When using image_data, the image is temporarily uploaded to S3 with a
presigned URL, inserted via the Google Docs API, then auto-expired
by a lifecycle rule.

Optionally specify width and/or height in points (72 points = 1 inch).
If only one dimension is given, the other scales proportionally.

Position can be specified by index, after_text, or before_text.

Limits when using image_data:
- max 1 MB decoded
- allowed media_type: image/png, image/jpeg, image/gif, image/webp

URL compatibility notes (when using image_url):
- Direct image URLs work (e.g., https://example.com/photo.png)
- Wikipedia/Wikimedia Commons URLs often fail silently (redirects)
- Google Drive: use https://drive.google.com/uc?export=view&id=FILE_ID
  (file must be shared as "Anyone with the link can view")
- URLs that redirect or require authentication will fail silently

Args:
    document_id: The Google Docs document ID
    index: Position to insert at (use index OR after_text/before_text)
    after_text: Insert after first occurrence of this text
    before_text: Insert before first occurrence of this text
    segment_id: Optional header/footer segment ID
    image_url: Publicly accessible HTTPS image URL (mutually exclusive with image_data)
    image_data: Encoded image bytes (mutually exclusive with image_url)
    image_encoding: Encoding format — 'hex' (default, recommended) or 'base64'
    media_type: MIME type when using image_data (e.g. 'image/png', 'image/jpeg')
    width_pt: Optional image width in points
    height_pt: Optional image height in points
    caption: Optional caption text to insert below the image
    caption_style: Optional caption styling

Returns:
    Index where image was inserted

Example: {"document_id": "abc123", "index": 25, "image_url": "https://example.com/photo.png", "width_pt": 300}
Example (bytes): {"document_id": "abc123", "index": 25, "image_data": "89504e47...", "media_type": "image/png", "width_pt": 300}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
index integer | null No Position to insert at (1-based, use index OR after_text/before_text)
after_text string | null No Insert after first occurrence of this text (alternative to index)
before_text string | null No Insert before first occurrence of this text (alternative to index)
segment_id string | null No Header/footer segment ID to insert into. If omitted, inserts in document body.
image_url string | null No Publicly accessible HTTPS image URL (mutually exclusive with image_data)
image_data string | null No Encoded image bytes (mutually exclusive with image_url). Hex encoding is strongly recommended for chatbot/LLM callers to avoid content-filter false positives on base64 strings.
image_encoding string | null No Encoding of image_data: 'hex' (default, recommended) or 'base64' Default: "hex"
media_type string | null No MIME type when using image_data, e.g. 'image/png', 'image/jpeg'
width_pt number | null No Image width in points (72pt = 1 inch)
height_pt number | null No Image height in points
caption string | null No Caption text to insert below the image
caption_style object | null No Style for caption: {italic: bool, fontSize: float, alignment: 'CENTER'|'START'|'END'}
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Position to insert at (1-based, use index OR after_text/before_text)",
      "title": "Index"
    },
    "after_text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Insert after first occurrence of this text (alternative to index)",
      "title": "After Text"
    },
    "before_text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Insert before first occurrence of this text (alternative to index)",
      "title": "Before Text"
    },
    "segment_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Header/footer segment ID to insert into. If omitted, inserts in document body.",
      "title": "Segment Id"
    },
    "image_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Publicly accessible HTTPS image URL (mutually exclusive with image_data)",
      "title": "Image Url"
    },
    "image_data": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Encoded image bytes (mutually exclusive with image_url). Hex encoding is strongly recommended for chatbot/LLM callers to avoid content-filter false positives on base64 strings.",
      "title": "Image Data"
    },
    "image_encoding": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "hex",
      "description": "Encoding of image_data: 'hex' (default, recommended) or 'base64'",
      "title": "Image Encoding"
    },
    "media_type": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "MIME type when using image_data, e.g. 'image/png', 'image/jpeg'",
      "title": "Media Type"
    },
    "width_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Image width in points (72pt = 1 inch)",
      "title": "Width Pt"
    },
    "height_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Image height in points",
      "title": "Height Pt"
    },
    "caption": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Caption text to insert below the image",
      "title": "Caption"
    },
    "caption_style": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Style for caption: {italic: bool, fontSize: float, alignment: 'CENTER'|'START'|'END'}",
      "title": "Caption Style"
    }
  },
  "required": [
    "document_id"
  ],
  "title": "InsertImageParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "inserted_at": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Index where image was inserted",
      "title": "Inserted At"
    },
    "new_end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "New document end index after insertion",
      "title": "New End Index"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertImageResult",
  "type": "object"
}

# insert_multi_column write

Insert a multi-column layout by creating a borderless table and filling each column's content.

Full description
Insert a multi-column layout using a borderless table.

Since Google Docs doesn't support native columns via the API, this
creates a 1-row N-column table and populates each cell. When borderless
is True (default), cell borders are removed for a clean column appearance.

Limitation: Text does NOT flow between columns. Each column's content
is independent — long text in column 1 won't wrap into column 2. For
flowing text, manually split content across columns.

Args:
    document_id: The Google Docs document ID
    index: Position to insert at
    columns: Number of columns (2-4)
    column_contents: Text content for each column (must match column count)
    borderless: Remove table borders (default: True)

Returns:
    Start index of the inserted table

Example: {"document_id": "abc123", "index": 1, "columns": 2, "column_contents": ["Left column text", "Right column text"]}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
index integer Yes Position to insert the multi-column layout (1-based)
columns integer No Number of columns (2-4) Default: 2
column_contents array<object> Yes Content for each column. Each element is either a plain string OR an array of styled text specs: [{text, bold?, italic?, foregroundColor?}, ...]. Example: ["Plain text", [{"text": "Bold title\n", "bold": true}, {"text": "Body text"}]]
borderless boolean No Remove visible table borders for a clean column look Default: true
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "index": {
      "description": "Position to insert the multi-column layout (1-based)",
      "title": "Index",
      "type": "integer"
    },
    "columns": {
      "default": 2,
      "description": "Number of columns (2-4)",
      "title": "Columns",
      "type": "integer"
    },
    "column_contents": {
      "description": "Content for each column. Each element is either a plain string OR an array of styled text specs: [{text, bold?, italic?, foregroundColor?}, ...]. Example: [\"Plain text\", [{\"text\": \"Bold title\\n\", \"bold\": true}, {\"text\": \"Body text\"}]]",
      "items": {},
      "title": "Column Contents",
      "type": "array"
    },
    "borderless": {
      "default": true,
      "description": "Remove visible table borders for a clean column look",
      "title": "Borderless",
      "type": "boolean"
    }
  },
  "required": [
    "document_id",
    "index",
    "column_contents"
  ],
  "title": "InsertMultiColumnParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "table_start_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Start index of the inserted table",
      "title": "Table Start Index"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertMultiColumnResult",
  "type": "object"
}

# insert_page_break write

Insert a page break at a specified document position.

Full description
Insert a page break at the specified position.

If the index equals the document end index, it is automatically adjusted
to end_index - 1 (the last valid insertion point).

Args:
    document_id: The Google Docs document ID
    index: Position to insert at (use end_index - 1 to append at end)

Returns:
    Index where element was inserted

Example: {"document_id": "abc123", "index": 50}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
index integer Yes Position to insert at (1-based)
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "index": {
      "description": "Position to insert at (1-based)",
      "title": "Index",
      "type": "integer"
    }
  },
  "required": [
    "document_id",
    "index"
  ],
  "title": "InsertPageBreakParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "inserted_at": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Index where element was inserted",
      "title": "Inserted At"
    },
    "new_end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "New document end index after insertion (use for subsequent operations)",
      "title": "New End Index"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertElementResult",
  "type": "object"
}

# insert_populated_table write

Insert a new table, populate it with data, and optionally style headers in one operation.

Full description
Insert a new table and populate it with data in one operation.

Combines insert_table + fill_table. Creates the table, then fills all
cells from the provided 2D data array. Optionally applies header styling.

Args:
    document_id: The Google Docs document ID
    index: Position to insert the table at
    data: 2D array of cell text (rows x columns)
    header_style: Optional first-row style: {bold, backgroundColor, foregroundColor}

Returns:
    Table start/end indices and cells filled

Example: {"document_id": "abc123", "index": 1, "data": [["Q1", "Q2", "Q3"], ["$1.2M", "$1.5M", "$1.8M"]], "header_style": {"bold": true, "backgroundColor": "#34a853"}}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
index integer Yes Position to insert the table at (1-based)
data array<array<string>> Yes 2D array of cell text (rows x columns). Row count = rows, column count = columns.
header_style object | null No Style for first row: {bold?: bool, backgroundColor?: str, foregroundColor?: str}
column_widths array<number> | null No Optional column widths in points (72pt = 1 inch). Must match column count if provided.
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "index": {
      "description": "Position to insert the table at (1-based)",
      "title": "Index",
      "type": "integer"
    },
    "data": {
      "description": "2D array of cell text (rows x columns). Row count = rows, column count = columns.",
      "items": {
        "items": {
          "type": "string"
        },
        "type": "array"
      },
      "title": "Data",
      "type": "array"
    },
    "header_style": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Style for first row: {bold?: bool, backgroundColor?: str, foregroundColor?: str}",
      "title": "Header Style"
    },
    "column_widths": {
      "anyOf": [
        {
          "items": {
            "type": "number"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional column widths in points (72pt = 1 inch). Must match column count if provided.",
      "title": "Column Widths"
    }
  },
  "required": [
    "document_id",
    "index",
    "data"
  ],
  "title": "InsertPopulatedTableParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "table_start_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Start index of the table",
      "title": "Table Start Index"
    },
    "table_end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "End index of the table",
      "title": "Table End Index"
    },
    "new_end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "New document end index after insertion",
      "title": "New End Index"
    },
    "cells_filled": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of cells populated",
      "title": "Cells Filled"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertPopulatedTableResult",
  "type": "object"
}

# insert_section_break write

Insert a section break to enable different page layout settings in parts of a document.

Full description
Insert a section break at the specified position.

Section breaks allow different page formatting (margins, headers/footers,
orientation) in different parts of the same document.

Args:
    document_id: The Google Docs document ID
    index: Position to insert at
    section_type: NEXT_PAGE (starts new page) or CONTINUOUS (same page)

Returns:
    Index where section break was inserted

Example: {"document_id": "abc123", "index": 100, "section_type": "NEXT_PAGE"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
index integer Yes Position to insert at (1-based)
section_type string No Section type: NEXT_PAGE or CONTINUOUS Default: "NEXT_PAGE"
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "index": {
      "description": "Position to insert at (1-based)",
      "title": "Index",
      "type": "integer"
    },
    "section_type": {
      "default": "NEXT_PAGE",
      "description": "Section type: NEXT_PAGE or CONTINUOUS",
      "title": "Section Type",
      "type": "string"
    }
  },
  "required": [
    "document_id",
    "index"
  ],
  "title": "InsertSectionBreakParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "inserted_at": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Index where section break was inserted",
      "title": "Inserted At"
    },
    "new_end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "New document end index after insertion",
      "title": "New End Index"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertSectionBreakResult",
  "type": "object"
}

# insert_styled_blocks write

Insert multiple formatted text blocks at a specific position or near matched text.

Full description
Insert styled blocks at a specific position in the document.

Similar to append_styled_blocks but inserts at a given index instead of
appending at the end. Position can be specified by index, after_text, or
before_text. Blocks support the same fields as append_styled_blocks,
including right_text for left/flush-right split lines.

For larger payloads that exceed the Google Docs 100-operation limit, it
automatically chunks the blocks and re-fetches the document between
batches to adjust the insertion index.

Args:
    document_id: The Google Docs document ID
    index: 1-based position to insert at (use index OR after_text/before_text)
    after_text: Insert after first occurrence of this text
    before_text: Insert before first occurrence of this text
    blocks: List of styled blocks to insert

Returns:
    Summary of inserted blocks

Example: {"document_id": "abc123", "after_text": "Introduction", "blocks": [{"text": "New section content", "named_style": "NORMAL_TEXT"}]}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
index integer | null No 1-based position to insert at (use index OR after_text/before_text)
after_text string | null No Insert after first occurrence of this text (alternative to index)
before_text string | null No Insert before first occurrence of this text (alternative to index)
blocks array<StyledBlock> Yes Styled blocks to insert at the given position
Parameter schema (JSON)
{
  "$defs": {
    "StyledBlock": {
      "description": "A single block of styled text for batch append operations.\n\nSupply either ``text`` (simple), ``runs`` (multi-run), or ``block_type``\n(special element like pageBreak/horizontalRule/image).\n\nWhen ``runs`` is provided the block text is the concatenation of all run texts,\nand each run can carry its own character-level formatting.\n\nWhen ``block_type`` is set, text/runs are not needed (except image blocks\nwhich require ``image_url``).",
      "properties": {
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Text content for this block (use text OR runs, not both)",
          "title": "Text"
        },
        "runs": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/TextRun"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "List of text runs with per-run formatting (use text OR runs, not both)",
          "title": "Runs"
        },
        "block_type": {
          "anyOf": [
            {
              "enum": [
                "pageBreak",
                "horizontalRule",
                "image"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Special block type. 'image' requires image_url. 'pageBreak' and 'horizontalRule' need no extra fields.",
          "title": "Block Type"
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL for image block type (public URL)",
          "title": "Image Url"
        },
        "image_width_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Image width in points (default: auto)",
          "title": "Image Width Pt"
        },
        "image_height_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Image height in points (default: auto)",
          "title": "Image Height Pt"
        },
        "named_style": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Named style: TITLE, HEADING_1, etc.",
          "title": "Named Style"
        },
        "bold": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply bold formatting",
          "title": "Bold"
        },
        "italic": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply italic formatting",
          "title": "Italic"
        },
        "font_size_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Font size in points",
          "title": "Font Size Pt"
        },
        "text_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Text color as hex string (#RRGGBB)",
          "title": "Text Color"
        },
        "link_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL to link the text to (when using text, not runs)",
          "title": "Link Url"
        },
        "indent_start_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Left indent in points (72pt = 1 inch)",
          "title": "Indent Start Pt"
        },
        "indent_end_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Right indent in points",
          "title": "Indent End Pt"
        },
        "indent_first_line_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "First line indent in points",
          "title": "Indent First Line Pt"
        },
        "alignment": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Paragraph alignment: START, CENTER, END, JUSTIFIED",
          "title": "Alignment"
        },
        "shading_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Paragraph background color as hex (#RRGGBB) for callout boxes",
          "title": "Shading Color"
        },
        "as_bullet": {
          "default": false,
          "description": "Format as bullet list",
          "title": "As Bullet",
          "type": "boolean"
        },
        "as_numbered": {
          "default": false,
          "description": "Format as numbered list. Use with nesting_level for hierarchical numbering (1, 1.1, 1.1.1)",
          "title": "As Numbered",
          "type": "boolean"
        },
        "nesting_level": {
          "default": 0,
          "description": "List nesting level (0=top, 1=indented, 2=double). Only with as_bullet/as_numbered.",
          "title": "Nesting Level",
          "type": "integer"
        },
        "as_pull_quote": {
          "default": false,
          "description": "Style as a pull quote with left border, indentation, and italic text. Combine with text_color for colored border.",
          "title": "As Pull Quote",
          "type": "boolean"
        },
        "right_text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Text rendered flush right on the same visual line as the block's text/runs (e.g. a date opposite a job title). Rendered internally as a borderless two-column table since the Docs API cannot create tab stops; the block's styling fields apply to the left content, and right_text inherits NORMAL_TEXT styling. Not combinable with block_type, as_bullet/as_numbered, or as_pull_quote.",
          "title": "Right Text"
        }
      },
      "title": "StyledBlock",
      "type": "object",
      "additionalProperties": false
    },
    "TextRun": {
      "description": "A single run of text with its own formatting within a styled block.",
      "properties": {
        "text": {
          "description": "Text content for this run",
          "title": "Text",
          "type": "string"
        },
        "bold": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply bold formatting",
          "title": "Bold"
        },
        "italic": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply italic formatting",
          "title": "Italic"
        },
        "underline": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply underline formatting",
          "title": "Underline"
        },
        "text_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Hex color e.g. '#CC0000'",
          "title": "Text Color"
        },
        "background_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Hex color for text background",
          "title": "Background Color"
        },
        "font_family": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Font family name",
          "title": "Font Family"
        },
        "font_size_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Font size in points",
          "title": "Font Size Pt"
        },
        "link_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL to link this run to",
          "title": "Link Url"
        }
      },
      "required": [
        "text"
      ],
      "title": "TextRun",
      "type": "object",
      "additionalProperties": false
    }
  },
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "1-based position to insert at (use index OR after_text/before_text)",
      "title": "Index"
    },
    "after_text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Insert after first occurrence of this text (alternative to index)",
      "title": "After Text"
    },
    "before_text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Insert before first occurrence of this text (alternative to index)",
      "title": "Before Text"
    },
    "blocks": {
      "description": "Styled blocks to insert at the given position",
      "items": {
        "$ref": "#/$defs/StyledBlock"
      },
      "title": "Blocks",
      "type": "array"
    }
  },
  "required": [
    "document_id",
    "blocks"
  ],
  "title": "InsertStyledBlocksParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "blocks_inserted": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of blocks inserted",
      "title": "Blocks Inserted"
    },
    "total_length": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Total characters inserted",
      "title": "Total Length"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertStyledBlocksResult",
  "type": "object"
}

# insert_table write

Insert an empty table at a specified position and return its table range indices.

Full description
Insert an empty table at the specified position.

Args:
    document_id: The Google Docs document ID
    index: Position to insert at
    rows: Number of rows (min: 1, max: 20)
    columns: Number of columns (min: 1, max: 20)

Returns:
    Start and end indices of the inserted table

Example: {"document_id": "abc123", "index": 1, "rows": 3, "columns": 4}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
index integer Yes Position to insert at (1-based)
rows integer Yes Number of rows (min: 1, max: 20)
columns integer Yes Number of columns (min: 1, max: 20)
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "index": {
      "description": "Position to insert at (1-based)",
      "title": "Index",
      "type": "integer"
    },
    "rows": {
      "description": "Number of rows (min: 1, max: 20)",
      "title": "Rows",
      "type": "integer"
    },
    "columns": {
      "description": "Number of columns (min: 1, max: 20)",
      "title": "Columns",
      "type": "integer"
    }
  },
  "required": [
    "document_id",
    "index",
    "rows",
    "columns"
  ],
  "title": "InsertTableParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "table_start_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Start index of the inserted table",
      "title": "Table Start Index"
    },
    "table_end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "End index of the inserted table",
      "title": "Table End Index"
    },
    "new_end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "New document end index after insertion",
      "title": "New End Index"
    },
    "cells": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Cell details: [{row, col, start_index, end_index}]",
      "title": "Cells"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertTableResult",
  "type": "object"
}

# insert_table_of_contents write

Generate and insert a linked table of contents from document headings as static text.

Full description
Generate and insert a Table of Contents from document headings.

Reads the document structure, finds all headings up to max_depth,
and inserts a formatted TOC with clickable links using heading IDs.

Note: This generates a "soft" TOC — static text with links, NOT a native
Google Docs TOC. It will NOT auto-update when headings are added, removed,
or renamed. This is a Google Docs API limitation — native TOC can only be
inserted via the Docs UI. Re-run this tool to regenerate the TOC after
structural changes.

Args:
    document_id: The Google Docs document ID
    index: Position to insert the TOC at
    max_depth: Include headings up to this level (1-6, default: 3)
    title: Title text for the TOC, or None to omit

Returns:
    Number of headings found and total TOC length

Example: {"document_id": "abc123", "index": 1, "max_depth": 3, "title": "Table of Contents"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
index integer Yes Position to insert the TOC at (1-based)
max_depth integer No Include headings up to this level (1-6) Default: 3
title string | null No Title text for the TOC, or None to omit Default: "Table of Contents"
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "index": {
      "description": "Position to insert the TOC at (1-based)",
      "title": "Index",
      "type": "integer"
    },
    "max_depth": {
      "default": 3,
      "description": "Include headings up to this level (1-6)",
      "title": "Max Depth",
      "type": "integer"
    },
    "title": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "Table of Contents",
      "description": "Title text for the TOC, or None to omit",
      "title": "Title"
    }
  },
  "required": [
    "document_id",
    "index"
  ],
  "title": "InsertTableOfContentsParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "headings_found": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of headings found",
      "title": "Headings Found"
    },
    "toc_length": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Total characters inserted for the TOC",
      "title": "Toc Length"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertTableOfContentsResult",
  "type": "object"
}

# insert_text write

Insert plain text at an exact character index and return insertion information.

Full description
Insert text at a specific position in the document.

    IMPORTANT:
    - Index 1 = start of document body
    - Use end_index from get_document() to append at the end
    - After insertion, all subsequent indices shift by inserted_length
    - If performing multiple insertions, work from end to start, or use batch_update

    Args:
        document_id: The Google Docs document ID
        index: Position to insert at (index 1 = start of document body)
        text: Text to insert. Use \n for line breaks.

    Returns:
        Information about the insertion including start and end indices

    Example: {"document_id": "abc123", "index": 1, "text": "Hello World
"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
index integer Yes Position to insert at (1-based, index 1 = start of document body)
text string Yes Text to insert. Use \n for line breaks.
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "index": {
      "description": "Position to insert at (1-based, index 1 = start of document body)",
      "title": "Index",
      "type": "integer"
    },
    "text": {
      "description": "Text to insert. Use \\n for line breaks.",
      "title": "Text",
      "type": "string"
    }
  },
  "required": [
    "document_id",
    "index",
    "text"
  ],
  "title": "InsertTextParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "inserted_length": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of characters inserted",
      "title": "Inserted Length"
    },
    "start_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Start index of inserted text",
      "title": "Start Index"
    },
    "end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "End index of inserted text",
      "title": "End Index"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "InsertTextResult",
  "type": "object"
}

Link a text range to an internal heading or bookmark for in-document navigation.

Full description
Make a text range link to an internal document location.

Use heading_id to link to a heading (most common — get heading_id from
get_document output). Use bookmark_id only for native UI-created bookmarks.

Args:
    document_id: The Google Docs document ID
    start_index: Start of text range to make into a link
    end_index: End of text range
    heading_id: Heading ID to link to (from get_document's heading_id field)
    bookmark_id: Native bookmark ID (for UI-created bookmarks only)

Returns:
    Whether the operation was successful

Example: {"document_id": "abc123", "start_index": 5, "end_index": 25, "heading_id": "h.abc123def456"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
start_index integer Yes Start of text range to make into a link (1-based)
end_index integer Yes End of text range to make into a link (1-based)
heading_id string | null No Heading ID to link to (from get_document heading_id field)
bookmark_id string | null No Native document bookmark ID to link to (rare — most use cases should use headingId)
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "start_index": {
      "description": "Start of text range to make into a link (1-based)",
      "title": "Start Index",
      "type": "integer"
    },
    "end_index": {
      "description": "End of text range to make into a link (1-based)",
      "title": "End Index",
      "type": "integer"
    },
    "heading_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Heading ID to link to (from get_document heading_id field)",
      "title": "Heading Id"
    },
    "bookmark_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Native document bookmark ID to link to (rare — most use cases should use headingId)",
      "title": "Bookmark Id"
    }
  },
  "required": [
    "document_id",
    "start_index",
    "end_index"
  ],
  "title": "LinkToBookmarkParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "LinkToBookmarkResult",
  "type": "object"
}

# list_accounts read

List the Google accounts the user has connected for Google Docs. Returns each account's email, name, and whether it's the current default for this MCP client. Use when the user mentions "my work docs" / "my personal docs" or asks which accounts are available — then pass `account=<email>` to target a non-default account on Docs tools. `account=<email>` is supported on all Google Docs tools.

Full description
Return the user's connected Google accounts for the current MCP client.

Returns:
    ListAccountsResult with one entry per connected Google account, including the
    account's email, display name (when available), and a boolean flag indicating
    which account is the current default for this user + MCP client.

When the user has multiple Google accounts connected, this tool is the canonical
way to discover what's available before invoking other Google Docs tools with an
explicit `account=...` override.

No parameters.

Parameter schema (JSON)
{
  "description": "Parameters for list_accounts.",
  "properties": {},
  "title": "ListAccountsParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "$defs": {
    "ConnectedAccount": {
      "description": "A single connected Google account.",
      "properties": {
        "email": {
          "default": "",
          "title": "Email",
          "type": "string"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Name"
        },
        "is_default": {
          "default": false,
          "title": "Is Default",
          "type": "boolean"
        }
      },
      "title": "ConnectedAccount",
      "type": "object"
    }
  },
  "description": "Result of list_accounts.",
  "properties": {
    "accounts": {
      "items": {
        "$ref": "#/$defs/ConnectedAccount"
      },
      "title": "Accounts",
      "type": "array"
    }
  },
  "title": "ListAccountsResult",
  "type": "object"
}

# list_documents read

List Google Docs accessible to this toolkit, returning IDs, titles, and folder paths.

Full description
List Google Docs accessible to this toolkit.

Uses a "Discovery & Adoption" model: lists ALL documents accessible to the user
(not just toolkit-created ones), and lazily tags untagged files with sourceApp
on first discovery. This allows users to work with existing documents without
requiring explicit registration via the picker.

Typical uses:
- Finding recently edited documents
- Browsing all accessible documents
- Locating documents by folder path
- Discovering existing documents before creating new ones

Args:
    folder_id: Optional folder ID to filter by. If not provided, searches all accessible folders
    max_results: Maximum number of documents to return (default: 20)

Returns:
    List of documents with id, title, url, createdTime, modifiedTime, folderPath.
    Note: Timestamps (createdTime, modifiedTime) are in UTC format (ISO 8601 with 'Z' suffix).

Example: {"max_results": 10}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
folder_id string | null No Optional folder ID to list documents from. If not provided, searches all accessible folders
max_results integer | null No Maximum number of documents to return (default: 20) Default: 20
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "folder_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional folder ID to list documents from. If not provided, searches all accessible folders",
      "title": "Folder Id"
    },
    "max_results": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": 20,
      "description": "Maximum number of documents to return (default: 20)",
      "title": "Max Results"
    }
  },
  "title": "ListDocumentsParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "data": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "List of documents with id, title, url, createdTime, modifiedTime, folderPath",
      "title": "Data"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "ListDocumentsResult",
  "type": "object"
}

# merge_table_cells write

Merge a rectangular range of cells within an existing table.

Full description
Merge a range of table cells.

Merges cells from (start_row, start_column) to (end_row, end_column).
End values are exclusive (like Python slicing).

Args:
    document_id: The Google Docs document ID
    table_start_index: startIndex of the table element
    start_row: Start row (0-based, inclusive)
    start_column: Start column (0-based, inclusive)
    end_row: End row (0-based, exclusive)
    end_column: End column (0-based, exclusive)

Returns:
    Whether the operation was successful

Example: {"document_id": "abc123", "table_start_index": 55, "start_row": 0, "start_column": 0, "end_row": 1, "end_column": 3}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
table_start_index integer Yes startIndex of the table element (1-based)
start_row integer Yes Start row (0-based, inclusive)
start_column integer Yes Start column (0-based, inclusive)
end_row integer Yes End row (0-based, exclusive)
end_column integer Yes End column (0-based, exclusive)
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "table_start_index": {
      "description": "startIndex of the table element (1-based)",
      "title": "Table Start Index",
      "type": "integer"
    },
    "start_row": {
      "description": "Start row (0-based, inclusive)",
      "title": "Start Row",
      "type": "integer"
    },
    "start_column": {
      "description": "Start column (0-based, inclusive)",
      "title": "Start Column",
      "type": "integer"
    },
    "end_row": {
      "description": "End row (0-based, exclusive)",
      "title": "End Row",
      "type": "integer"
    },
    "end_column": {
      "description": "End column (0-based, exclusive)",
      "title": "End Column",
      "type": "integer"
    }
  },
  "required": [
    "document_id",
    "table_start_index",
    "start_row",
    "start_column",
    "end_row",
    "end_column"
  ],
  "title": "MergeTableCellsParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "MergeTableCellsResult",
  "type": "object"
}

# move_document_to_trash write

Move a Google Doc to Drive trash for later restore or eventual deletion.

Full description
Move a Google Doc to the trash.

This operation moves the document to the user's Google Drive trash.
The document can be restored from trash within 30 days. After 30 days,
it will be permanently deleted.

Note: This operation requires edit access to the document.

Args:
    document_id: The Google Docs document ID to move to trash

Returns:
    Confirmation of the trash operation with the document ID

Example: {"document_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID to move to trash
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID to move to trash",
      "title": "Document Id",
      "type": "string"
    }
  },
  "required": [
    "document_id"
  ],
  "title": "MoveDocumentToTrashParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "document_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The ID of the trashed document",
      "title": "Document Id"
    },
    "message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Success message",
      "title": "Message"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "MoveDocumentToTrashResult",
  "type": "object"
}

# remove_bullets write

Remove bullet or numbered list formatting from paragraphs in a range.

Full description
Remove bullet or numbered list formatting from paragraphs.

Args:
    document_id: The Google Docs document ID
    start_index: Start of range (inclusive)
    end_index: End of range (exclusive)

Returns:
    The range that was modified

Example: {"document_id": "abc123", "start_index": 10, "end_index": 80}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
start_index integer Yes Start of range (1-based, inclusive)
end_index integer Yes End of range (1-based, exclusive)
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "start_index": {
      "description": "Start of range (1-based, inclusive)",
      "title": "Start Index",
      "type": "integer"
    },
    "end_index": {
      "description": "End of range (1-based, exclusive)",
      "title": "End Index",
      "type": "integer"
    }
  },
  "required": [
    "document_id",
    "start_index",
    "end_index"
  ],
  "title": "RemoveBulletsParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "range_formatted": {
      "anyOf": [
        {
          "additionalProperties": {
            "type": "integer"
          },
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The range that was formatted (startIndex, endIndex)",
      "title": "Range Formatted"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "ApplyStyleResult",
  "type": "object"
}

# replace_section write

Find a section by heading and replace that section's content with new styled blocks.

Full description
Find a section by heading text and replace it with new styled blocks.

Locates a heading paragraph by its text, determines the section boundaries
(from that heading to the next heading of equal or higher level), deletes
the section content, and inserts the replacement blocks in its place.

Args:
    document_id: The Google Docs document ID
    heading_text: Text of the heading to find
    blocks: Replacement styled blocks
    include_heading: If True (default), replace the heading and its content.
        If False, keep the heading and only replace the content below it.
    match_case: Case-sensitive heading match (default: False)

Returns:
    Information about the replacement operation

Example: {"document_id": "abc123", "heading_text": "Key Findings", "blocks": [{"text": "Key Findings", "named_style": "HEADING_1"}, {"text": "Updated analysis results.", "named_style": "NORMAL_TEXT"}]}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
heading_text string Yes Text of the heading to find
blocks array<StyledBlock> Yes Replacement blocks
include_heading boolean No Whether to replace the heading itself or just content below it Default: true
match_case boolean No Case-sensitive heading match Default: false
Parameter schema (JSON)
{
  "$defs": {
    "StyledBlock": {
      "description": "A single block of styled text for batch append operations.\n\nSupply either ``text`` (simple), ``runs`` (multi-run), or ``block_type``\n(special element like pageBreak/horizontalRule/image).\n\nWhen ``runs`` is provided the block text is the concatenation of all run texts,\nand each run can carry its own character-level formatting.\n\nWhen ``block_type`` is set, text/runs are not needed (except image blocks\nwhich require ``image_url``).",
      "properties": {
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Text content for this block (use text OR runs, not both)",
          "title": "Text"
        },
        "runs": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/TextRun"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "List of text runs with per-run formatting (use text OR runs, not both)",
          "title": "Runs"
        },
        "block_type": {
          "anyOf": [
            {
              "enum": [
                "pageBreak",
                "horizontalRule",
                "image"
              ],
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Special block type. 'image' requires image_url. 'pageBreak' and 'horizontalRule' need no extra fields.",
          "title": "Block Type"
        },
        "image_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL for image block type (public URL)",
          "title": "Image Url"
        },
        "image_width_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Image width in points (default: auto)",
          "title": "Image Width Pt"
        },
        "image_height_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Image height in points (default: auto)",
          "title": "Image Height Pt"
        },
        "named_style": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Named style: TITLE, HEADING_1, etc.",
          "title": "Named Style"
        },
        "bold": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply bold formatting",
          "title": "Bold"
        },
        "italic": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply italic formatting",
          "title": "Italic"
        },
        "font_size_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Font size in points",
          "title": "Font Size Pt"
        },
        "text_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Text color as hex string (#RRGGBB)",
          "title": "Text Color"
        },
        "link_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL to link the text to (when using text, not runs)",
          "title": "Link Url"
        },
        "indent_start_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Left indent in points (72pt = 1 inch)",
          "title": "Indent Start Pt"
        },
        "indent_end_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Right indent in points",
          "title": "Indent End Pt"
        },
        "indent_first_line_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "First line indent in points",
          "title": "Indent First Line Pt"
        },
        "alignment": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Paragraph alignment: START, CENTER, END, JUSTIFIED",
          "title": "Alignment"
        },
        "shading_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Paragraph background color as hex (#RRGGBB) for callout boxes",
          "title": "Shading Color"
        },
        "as_bullet": {
          "default": false,
          "description": "Format as bullet list",
          "title": "As Bullet",
          "type": "boolean"
        },
        "as_numbered": {
          "default": false,
          "description": "Format as numbered list. Use with nesting_level for hierarchical numbering (1, 1.1, 1.1.1)",
          "title": "As Numbered",
          "type": "boolean"
        },
        "nesting_level": {
          "default": 0,
          "description": "List nesting level (0=top, 1=indented, 2=double). Only with as_bullet/as_numbered.",
          "title": "Nesting Level",
          "type": "integer"
        },
        "as_pull_quote": {
          "default": false,
          "description": "Style as a pull quote with left border, indentation, and italic text. Combine with text_color for colored border.",
          "title": "As Pull Quote",
          "type": "boolean"
        },
        "right_text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Text rendered flush right on the same visual line as the block's text/runs (e.g. a date opposite a job title). Rendered internally as a borderless two-column table since the Docs API cannot create tab stops; the block's styling fields apply to the left content, and right_text inherits NORMAL_TEXT styling. Not combinable with block_type, as_bullet/as_numbered, or as_pull_quote.",
          "title": "Right Text"
        }
      },
      "title": "StyledBlock",
      "type": "object",
      "additionalProperties": false
    },
    "TextRun": {
      "description": "A single run of text with its own formatting within a styled block.",
      "properties": {
        "text": {
          "description": "Text content for this run",
          "title": "Text",
          "type": "string"
        },
        "bold": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply bold formatting",
          "title": "Bold"
        },
        "italic": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply italic formatting",
          "title": "Italic"
        },
        "underline": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Apply underline formatting",
          "title": "Underline"
        },
        "text_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Hex color e.g. '#CC0000'",
          "title": "Text Color"
        },
        "background_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Hex color for text background",
          "title": "Background Color"
        },
        "font_family": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Font family name",
          "title": "Font Family"
        },
        "font_size_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Font size in points",
          "title": "Font Size Pt"
        },
        "link_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "URL to link this run to",
          "title": "Link Url"
        }
      },
      "required": [
        "text"
      ],
      "title": "TextRun",
      "type": "object",
      "additionalProperties": false
    }
  },
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "heading_text": {
      "description": "Text of the heading to find",
      "title": "Heading Text",
      "type": "string"
    },
    "blocks": {
      "description": "Replacement blocks",
      "items": {
        "$ref": "#/$defs/StyledBlock"
      },
      "title": "Blocks",
      "type": "array"
    },
    "include_heading": {
      "default": true,
      "description": "Whether to replace the heading itself or just content below it",
      "title": "Include Heading",
      "type": "boolean"
    },
    "match_case": {
      "default": false,
      "description": "Case-sensitive heading match",
      "title": "Match Case",
      "type": "boolean"
    }
  },
  "required": [
    "document_id",
    "heading_text",
    "blocks"
  ],
  "title": "ReplaceSectionParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "section_found": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether the section heading was found",
      "title": "Section Found"
    },
    "deleted_range": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Range that was deleted",
      "title": "Deleted Range"
    },
    "blocks_inserted": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of replacement blocks inserted",
      "title": "Blocks Inserted"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "ReplaceSectionResult",
  "type": "object"
}

# replace_styled_text write

Find text, replace it, and apply formatting to the replacement text in one step.

Full description
Find text and replace it with styled replacement text.

Searches the document for occurrences of find_text and replaces each with
replace_text, optionally applying formatting to the replacement. Matches
are processed in reverse document order to preserve indices.

Args:
    document_id: The Google Docs document ID
    find_text: Text to search for
    replace_text: Replacement text
    match_case: Case-sensitive search (default: False)
    bold: Apply bold to replacement text
    italic: Apply italic to replacement text
    text_color: Text color as hex string (#RRGGBB)
    font_family: Font family name
    font_size_pt: Font size in points
    link_url: URL to link the replacement text to

Returns:
    Number of occurrences replaced

Example: {"document_id": "abc123", "find_text": "TBD", "replace_text": "Confirmed", "bold": true, "text_color": "#34a853"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
find_text string Yes Text to search for
replace_text string Yes Replacement text
match_case boolean No Case-sensitive search Default: false
bold boolean | null No Apply bold to replacement text
italic boolean | null No Apply italic to replacement text
text_color string | null No Text color as hex string (#RRGGBB)
font_family string | null No Font family name
font_size_pt number | null No Font size in points
link_url string | null No URL to link the replacement text to
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "find_text": {
      "description": "Text to search for",
      "title": "Find Text",
      "type": "string"
    },
    "replace_text": {
      "description": "Replacement text",
      "title": "Replace Text",
      "type": "string"
    },
    "match_case": {
      "default": false,
      "description": "Case-sensitive search",
      "title": "Match Case",
      "type": "boolean"
    },
    "bold": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply bold to replacement text",
      "title": "Bold"
    },
    "italic": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply italic to replacement text",
      "title": "Italic"
    },
    "text_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Text color as hex string (#RRGGBB)",
      "title": "Text Color"
    },
    "font_family": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Font family name",
      "title": "Font Family"
    },
    "font_size_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Font size in points",
      "title": "Font Size Pt"
    },
    "link_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "URL to link the replacement text to",
      "title": "Link Url"
    }
  },
  "required": [
    "document_id",
    "find_text",
    "replace_text"
  ],
  "title": "ReplaceStyledTextParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "occurrences_replaced": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of occurrences replaced",
      "title": "Occurrences Replaced"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "ReplaceStyledTextResult",
  "type": "object"
}

# replace_text write

Find and replace text throughout the document across body, headers, and footers.

Full description
Find and replace text throughout the document.

Note: Replaces across ALL segments (body, headers, footers). The Google
Docs API does not support scoping replaceAllText to a specific segment.
Use specific find_text strings to avoid unintended matches.

Args:
    document_id: The Google Docs document ID
    find_text: Text to search for
    replace_text: Text to replace with. Can be empty string to delete.
    match_case: Whether search is case-sensitive (default: False)

Returns:
    Number of replacements made

Example: {"document_id": "abc123", "find_text": "draft", "replace_text": "final", "match_case": true}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
find_text string Yes Text to search for
replace_text string Yes Text to replace with. Can be empty string to delete.
match_case boolean No Whether search is case-sensitive Default: false
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "find_text": {
      "description": "Text to search for",
      "title": "Find Text",
      "type": "string"
    },
    "replace_text": {
      "description": "Text to replace with. Can be empty string to delete.",
      "title": "Replace Text",
      "type": "string"
    },
    "match_case": {
      "default": false,
      "description": "Whether search is case-sensitive",
      "title": "Match Case",
      "type": "boolean"
    }
  },
  "required": [
    "document_id",
    "find_text",
    "replace_text"
  ],
  "title": "ReplaceTextParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "occurrences_replaced": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Number of replacements made",
      "title": "Occurrences Replaced"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "ReplaceTextResult",
  "type": "object"
}

# search_text read

Search document text and return match locations with context, without modifying content.

Full description
Search for text in a document and return match locations.

Returns match positions and surrounding context without modifying the
document.  Useful for validating that replacements worked (e.g. "are
there any remaining {{placeholders}}?") or finding insertion points.

Supports plain text or regex search.  Searches body text and table
cell content.

Args:
    document_id: The Google Docs document ID
    find_text: Text or regex pattern to search for
    match_case: Case-sensitive search (default: False)
    regex: Treat find_text as a regex pattern (default: False)

Returns:
    List of matches with text, startIndex, endIndex, and surrounding context

Example: {"document_id": "abc123", "find_text": "{{placeholder}}", "match_case": true}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
find_text string Yes Text or regex pattern to search for
match_case boolean No Case-sensitive search (default: False) Default: false
regex boolean No Treat findText as a regex pattern (default: False) Default: false
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "find_text": {
      "description": "Text or regex pattern to search for",
      "title": "Find Text",
      "type": "string"
    },
    "match_case": {
      "default": false,
      "description": "Case-sensitive search (default: False)",
      "title": "Match Case",
      "type": "boolean"
    },
    "regex": {
      "default": false,
      "description": "Treat findText as a regex pattern (default: False)",
      "title": "Regex",
      "type": "boolean"
    }
  },
  "required": [
    "document_id",
    "find_text"
  ],
  "title": "SearchTextParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "matches": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": true,
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "List of matches with text, startIndex, endIndex, context",
      "title": "Matches"
    },
    "total_matches": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Total number of matches found",
      "title": "Total Matches"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "SearchTextResult",
  "type": "object"
}

Create, replace, or append footer text with alignment options for default or first-page footers.

Full description
Set or replace the document footer text.

Creates a footer if none exists, or replaces existing footer content.
Use mode='append' to add text alongside existing content (e.g., to
add custom text without overwriting page numbers).

Supports DEFAULT (all pages) and FIRST_PAGE footer types.

Args:
    document_id: The Google Docs document ID
    text: Text content for the footer
    type: DEFAULT (all pages) or FIRST_PAGE
    alignment: Optional text alignment (START, CENTER, END)
    mode: 'replace' (default) or 'append'

Returns:
    The footer segment ID

Example: {"document_id": "abc123", "text": "Confidential", "alignment": "END", "mode": "append"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
text string Yes Text content for the footer
type string No Footer type: DEFAULT (all pages) or FIRST_PAGE Default: "DEFAULT"
alignment string | null No Text alignment: START, CENTER, or END
mode "replace" | "append" | null No 'replace' (default) clears existing content first. 'append' adds text after existing content (preserves page numbers, etc.). Default: "replace"
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "text": {
      "description": "Text content for the footer",
      "title": "Text",
      "type": "string"
    },
    "type": {
      "default": "DEFAULT",
      "description": "Footer type: DEFAULT (all pages) or FIRST_PAGE",
      "title": "Type",
      "type": "string"
    },
    "alignment": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Text alignment: START, CENTER, or END",
      "title": "Alignment"
    },
    "mode": {
      "anyOf": [
        {
          "enum": [
            "replace",
            "append"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "replace",
      "description": "'replace' (default) clears existing content first. 'append' adds text after existing content (preserves page numbers, etc.).",
      "title": "Mode"
    }
  },
  "required": [
    "document_id",
    "text"
  ],
  "title": "SetFooterParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "segment_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The header/footer segment ID",
      "title": "Segment Id"
    },
    "warning": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Warning message about potential side effects",
      "title": "Warning"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "SetHeaderFooterResult",
  "type": "object"
}

# set_header write

Create, replace, or append header text with alignment options for default or first-page headers.

Full description
Set or replace the document header text.

Creates a header if none exists, or replaces existing header content.
Supports DEFAULT (all pages) and FIRST_PAGE header types.

Args:
    document_id: The Google Docs document ID
    text: Text content for the header
    type: DEFAULT (all pages) or FIRST_PAGE
    alignment: Optional text alignment (START, CENTER, END)

Returns:
    The header segment ID

Example: {"document_id": "abc123", "text": "Quarterly Report 2026", "alignment": "CENTER"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
text string Yes Text content for the header
type string No Header type: DEFAULT (all pages) or FIRST_PAGE Default: "DEFAULT"
alignment string | null No Text alignment: START, CENTER, or END
mode "replace" | "append" | null No 'replace' (default) clears existing content first. 'append' adds text after existing content (preserves page numbers, etc.). Default: "replace"
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "text": {
      "description": "Text content for the header",
      "title": "Text",
      "type": "string"
    },
    "type": {
      "default": "DEFAULT",
      "description": "Header type: DEFAULT (all pages) or FIRST_PAGE",
      "title": "Type",
      "type": "string"
    },
    "alignment": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Text alignment: START, CENTER, or END",
      "title": "Alignment"
    },
    "mode": {
      "anyOf": [
        {
          "enum": [
            "replace",
            "append"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": "replace",
      "description": "'replace' (default) clears existing content first. 'append' adds text after existing content (preserves page numbers, etc.).",
      "title": "Mode"
    }
  },
  "required": [
    "document_id",
    "text"
  ],
  "title": "SetHeaderParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "segment_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The header/footer segment ID",
      "title": "Segment Id"
    },
    "warning": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Warning message about potential side effects",
      "title": "Warning"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "SetHeaderFooterResult",
  "type": "object"
}

# set_page_margins write

Update document page margins, returning the applied layout changes.

Full description
Set custom page margins for the document.

Standard margins are 72pt (1 inch). Cover pages often use narrower margins.
Specify any combination of margins to update.

Args:
    document_id: The Google Docs document ID
    margin_top_pt: Top margin in points (72pt = 1 inch)
    margin_bottom_pt: Bottom margin in points
    margin_left_pt: Left margin in points
    margin_right_pt: Right margin in points

Returns:
    Whether the operation was successful

Example: {"document_id": "abc123", "margin_top_pt": 36, "margin_bottom_pt": 36}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
margin_top_pt number | null No Top margin in points (72pt = 1 inch)
margin_bottom_pt number | null No Bottom margin in points
margin_left_pt number | null No Left margin in points
margin_right_pt number | null No Right margin in points
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "margin_top_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Top margin in points (72pt = 1 inch)",
      "title": "Margin Top Pt"
    },
    "margin_bottom_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Bottom margin in points",
      "title": "Margin Bottom Pt"
    },
    "margin_left_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Left margin in points",
      "title": "Margin Left Pt"
    },
    "margin_right_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Right margin in points",
      "title": "Margin Right Pt"
    }
  },
  "required": [
    "document_id"
  ],
  "title": "SetPageMarginsParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "SetPageMarginsResult",
  "type": "object"
}

# set_page_size write

Set the document page size using standard presets or custom dimensions.

Full description
Set the document page size.

Use a preset (LETTER, LEGAL, A4, A3, TABLOID) or specify custom
dimensions in points (72 points = 1 inch).

Args:
    document_id: The Google Docs document ID
    preset: Standard page size (LETTER, LEGAL, A4, A3, TABLOID)
    width_pt: Custom width in points (use instead of preset)
    height_pt: Custom height in points (use instead of preset)

Returns:
    Whether the operation was successful

Example: {"document_id": "abc123", "preset": "A4"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
preset "LETTER" | "LEGAL" | "A4" | "A3" | "TABLOID" | null No Standard page size preset. Use this OR widthPt/heightPt.
width_pt number | null No Custom page width in points (72pt = 1 inch)
height_pt number | null No Custom page height in points
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "preset": {
      "anyOf": [
        {
          "enum": [
            "LETTER",
            "LEGAL",
            "A4",
            "A3",
            "TABLOID"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Standard page size preset. Use this OR widthPt/heightPt.",
      "title": "Preset"
    },
    "width_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Custom page width in points (72pt = 1 inch)",
      "title": "Width Pt"
    },
    "height_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Custom page height in points",
      "title": "Height Pt"
    }
  },
  "required": [
    "document_id"
  ],
  "title": "SetPageSizeParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "SetPageSizeResult",
  "type": "object"
}

# set_style_preferences write

Store named-style preference overrides for an existing document without changing current content.

Full description
Store style preferences for named styles in an EXISTING document.

IMPORTANT: This tool is for existing documents only. It stores text formatting
preferences that the toolkit will apply as overrides when using apply_named_style
or append_styled_block. It does NOT modify the document's actual namedStyles
definitions in Google Docs.

For new documents with pre-defined named style definitions, use create_document
with the style_preset parameter instead:
    create_document(title="My Doc", style_preset="recommended")

Style preferences are text style overrides that will be automatically applied
whenever apply_named_style or append_styled_block uses the corresponding named style.
Preferences are stored in Drive appProperties and persist across sessions.

Example: Set HEADING_1 to always use blue color and bold:
    set_style_preferences("doc-id", {
        "HEADING_1": {"foregroundColor": "#1a73e8", "bold": True},
        "HEADING_2": {"foregroundColor": "#5f6368", "italic": True}
    })

After setting, any call to apply_named_style with HEADING_1 will automatically
apply the blue color and bold formatting in addition to the named style.

Supported style overrides:
- bold: bool
- italic: bool
- foregroundColor: hex string (#RRGGBB)
- fontFamily: string (e.g., "Arial", "Roboto")
- fontSizePt: float (e.g., 14.0)

Args:
    document_id: The Google Docs document ID
    preferences: Map of named style to style overrides

Returns:
    List of named styles that were set

Example: {"document_id": "abc123", "preferences": {"HEADING_1": {"text_color": "#1a73e8", "bold": true}, "HEADING_2": {"text_color": "#5f6368", "italic": true}}}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
preferences object Yes Map of namedStyle (HEADING_1, TITLE, etc.) to style overrides
Parameter schema (JSON)
{
  "$defs": {
    "StylePreference": {
      "description": "A single style preference for a named style.",
      "properties": {
        "bold": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Override bold formatting",
          "title": "Bold"
        },
        "italic": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Override italic formatting",
          "title": "Italic"
        },
        "text_color": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Override text color (#RRGGBB)",
          "title": "Text Color"
        },
        "font_family": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Override font family",
          "title": "Font Family"
        },
        "font_size_pt": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "description": "Override font size in points",
          "title": "Font Size Pt"
        }
      },
      "title": "StylePreference",
      "type": "object",
      "additionalProperties": false
    }
  },
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "preferences": {
      "additionalProperties": {
        "$ref": "#/$defs/StylePreference"
      },
      "description": "Map of namedStyle (HEADING_1, TITLE, etc.) to style overrides",
      "title": "Preferences",
      "type": "object"
    }
  },
  "required": [
    "document_id",
    "preferences"
  ],
  "title": "SetStylePreferencesParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "styles_set": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "List of named styles that were set",
      "title": "Styles Set"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "SetStylePreferencesResult",
  "type": "object"
}

# set_table_column_width write

Set a table column's width or distribution mode in an existing table.

Full description
Set the width of a table column.

Args:
    document_id: The Google Docs document ID
    table_start_index: startIndex of the table element
    column_index: 0-based column index
    width_pt: Column width in points (72pt = 1 inch)
    width_type: FIXED_WIDTH or EVENLY_DISTRIBUTED

Returns:
    Whether the operation was successful

Example: {"document_id": "abc123", "table_start_index": 55, "column_index": 0, "width_pt": 144}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
table_start_index integer Yes startIndex of the table element (1-based)
column_index integer Yes 0-based column index
width_pt number Yes Column width in points (72pt = 1 inch)
width_type string No Width type: FIXED_WIDTH or EVENLY_DISTRIBUTED Default: "FIXED_WIDTH"
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "table_start_index": {
      "description": "startIndex of the table element (1-based)",
      "title": "Table Start Index",
      "type": "integer"
    },
    "column_index": {
      "description": "0-based column index",
      "title": "Column Index",
      "type": "integer"
    },
    "width_pt": {
      "description": "Column width in points (72pt = 1 inch)",
      "title": "Width Pt",
      "type": "number"
    },
    "width_type": {
      "default": "FIXED_WIDTH",
      "description": "Width type: FIXED_WIDTH or EVENLY_DISTRIBUTED",
      "title": "Width Type",
      "type": "string"
    }
  },
  "required": [
    "document_id",
    "table_start_index",
    "column_index",
    "width_pt"
  ],
  "title": "SetTableColumnWidthParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "SetTableColumnWidthResult",
  "type": "object"
}

# share_document write

Share a document with recipients or link sharing and return sharing status details.

Full description
Share a document with specific users and/or enable link sharing.

Supports two sharing modes (can be combined):
1. Named recipients: Share with specific email addresses
2. Link sharing: Make accessible to anyone with the link (no Google account required)

Args:
    document_id: The Google Docs document ID (required)
    recipients: List of dicts with 'email_address' and 'role' (optional).
        Roles: 'reader', 'writer', 'commenter'
    link_sharing: Enable "anyone with the link" access (optional).
        Valid values: 'reader', 'writer', 'commenter'.
        When set, returns a shareable link in the response.
    send_notification: Whether to send notification emails for named recipients (default true)

Returns:
    ShareDocumentResult with shared_with list, link_sharing_role, and shareable_link

Example: {"document_id": "1aBcDeFgHiJkLmNoPqRsTuVwXyZ", "link_sharing": "reader"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
recipients array<object> | null No List of dicts with 'email_address' and 'role' (reader, writer, commenter)
link_sharing "reader" | "writer" | "commenter" | null No Enable 'anyone with the link' access. Valid values: reader, writer, commenter
send_notification boolean | null No Whether to send notification emails for named recipients Default: true
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "recipients": {
      "anyOf": [
        {
          "items": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "List of dicts with 'email_address' and 'role' (reader, writer, commenter)",
      "title": "Recipients"
    },
    "link_sharing": {
      "anyOf": [
        {
          "enum": [
            "reader",
            "writer",
            "commenter"
          ],
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Enable 'anyone with the link' access. Valid values: reader, writer, commenter",
      "title": "Link Sharing"
    },
    "send_notification": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": true,
      "description": "Whether to send notification emails for named recipients",
      "title": "Send Notification"
    }
  },
  "required": [
    "document_id"
  ],
  "title": "ShareDocumentParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "data": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Raw API response data",
      "title": "Data"
    },
    "link_sharing_role": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Link sharing role set (reader, writer, or commenter)",
      "title": "Link Sharing Role"
    },
    "shareable_link": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "URL for sharing when link_sharing is enabled",
      "title": "Shareable Link"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if operation failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "ShareDocumentResult",
  "type": "object"
}

# update_table_cell write

Update one table cell's text and styling, with optional clearing and background formatting.

Full description
Insert text and apply styling to a specific table cell.

Locates the cell by table startIndex, row, and column (all 0-based).
Optionally clears existing content first (default: True).
Can apply text formatting and cell background color.

Args:
    document_id: The Google Docs document ID
    table_start_index: startIndex of the table element
    row: 0-based row number
    column: 0-based column number
    text: Text to insert into the cell
    clear_first: Clear existing cell content before inserting (default: True)
    bold: Apply bold formatting
    italic: Apply italic formatting
    font_size_pt: Font size in points
    text_color: Text color as hex (#RRGGBB)
    background_color: Cell background color as hex (#RRGGBB)

Returns:
    Cell content start and end indices

Example: {"document_id": "abc123", "table_start_index": 55, "row": 0, "column": 1, "text": "Revenue", "bold": true, "background_color": "#e8f0fe"}
Parameter Type Required Description
account string | null No Optional Google account override (email, e.g. "alice.work@company.com"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.
document_id string Yes The Google Docs document ID
table_start_index integer Yes startIndex of the table element in the document (1-based)
row integer Yes 0-based row number
column integer Yes 0-based column number
text string | null No Text to insert into the cell
clear_first boolean No Clear existing cell content before inserting Default: true
bold boolean | null No Apply bold formatting to inserted text
italic boolean | null No Apply italic formatting
font_size_pt number | null No Font size in points
text_color string | null No Text color as hex (#RRGGBB)
background_color string | null No Cell background color as hex (#RRGGBB)
Parameter schema (JSON)
{
  "properties": {
    "account": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Optional Google account override (email, e.g. \"alice.work@company.com\"). Omit to use the user's default Google account. Call list_accounts to see which accounts are connected.",
      "title": "Account"
    },
    "document_id": {
      "description": "The Google Docs document ID",
      "title": "Document Id",
      "type": "string"
    },
    "table_start_index": {
      "description": "startIndex of the table element in the document (1-based)",
      "title": "Table Start Index",
      "type": "integer"
    },
    "row": {
      "description": "0-based row number",
      "title": "Row",
      "type": "integer"
    },
    "column": {
      "description": "0-based column number",
      "title": "Column",
      "type": "integer"
    },
    "text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Text to insert into the cell",
      "title": "Text"
    },
    "clear_first": {
      "default": true,
      "description": "Clear existing cell content before inserting",
      "title": "Clear First",
      "type": "boolean"
    },
    "bold": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply bold formatting to inserted text",
      "title": "Bold"
    },
    "italic": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Apply italic formatting",
      "title": "Italic"
    },
    "font_size_pt": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Font size in points",
      "title": "Font Size Pt"
    },
    "text_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Text color as hex (#RRGGBB)",
      "title": "Text Color"
    },
    "background_color": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Cell background color as hex (#RRGGBB)",
      "title": "Background Color"
    }
  },
  "required": [
    "document_id",
    "table_start_index",
    "row",
    "column"
  ],
  "title": "UpdateTableCellParams",
  "type": "object",
  "additionalProperties": false
}
Result schema (JSON)
{
  "properties": {
    "success": {
      "description": "Whether the operation was successful",
      "title": "Success",
      "type": "boolean"
    },
    "cell_start_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Start index of the cell content",
      "title": "Cell Start Index"
    },
    "cell_end_index": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "End index of the cell content",
      "title": "Cell End Index"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Error message if failed",
      "title": "Error"
    }
  },
  "required": [
    "success"
  ],
  "title": "UpdateTableCellResult",
  "type": "object"
}