Insert content at a position
insert_contentInsert new markdown content into a Google Doc at the end, top, or after a unique text snippet, no anchor text required—use it to append to an empty doc or add a paragraph after a table.
Instructions
Insert NEW markdown-rendered content at a structural position — no anchor text required. at: "end" (default, the end of the doc/tab) · "top" · a unique text snippet to insert immediately after. Use this where edit_doc can’t reach: adding a paragraph after a table that ends the doc (a table’s cells can’t anchor an insert outside the table, and the trailing empty paragraph has no text to match), or appending to an empty doc. Use edit_doc instead when you are replacing or extending existing text. Content is full markdown (headings, lists, tables, images), same renderer as create_doc. A direct edit, not a tracked suggestion.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| at | No | "end" (default) | "top" | a unique text snippet to insert right after | |
| tab | No | Target a specific tab by tabId or title (from list_tabs). Defaults to the first tab. | |
| page | No | which header/footer, when a doc defines more than one (default-page, first-page, even-page). Omit to use whichever exists. | |
| account | No | Google account email to use. Defaults to GDOCS_DEFAULT_ACCOUNT, or the sole account. | |
| baseDir | No | absolute dir to resolve relative local image paths against | |
| content | No | markdown content to insert (or use contentFile) | |
| segment | No | which content tree to target: body (default), or the page header/footer. Header/footer content is invisible to a body read — a letterhead logo lives there. | |
| documentId | Yes | ||
| contentFile | No | path to a local markdown/text file to insert, read directly by the server — preferred for long content. Absolute, or relative to baseDir. Mutually exclusive with content. | |
| createSegment | No | when segment is header/footer and the doc has none, create it first (the letterhead case). Only the default header/footer can be created via the API. |