Overwrite a doc (guarded)
overwrite_docReplace the entire body of a Google Doc with markdown content. Prevents data loss by verifying the title and refusing when comments/suggestions are present unless force is enabled.
Instructions
Replace the entire body of a doc (or one tab) with markdown-rendered content. Refuses if comments/suggestions are present (would orphan them) unless force=true. Pass expectTitle (the doc’s title) — shown for confirmation and verified against the live doc before replacing. For long documents, pass contentFile instead of content so the server reads the body directly (retyping a long doc inline can silently drop text). A direct edit, not a tracked suggestion.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab | No | Target a specific tab by tabId or title (from list_tabs). Defaults to the first tab. | |
| force | No | proceed even if comments/suggestions would be lost | |
| 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 (e.g. the markdown file’s folder) | |
| content | No | markdown content (or use contentFile) | |
| documentId | Yes | ||
| contentFile | No | path to a local markdown/text file to use as the new body, read directly by the server — preferred for long documents so the body is passed through mechanically rather than retyped inline (which can silently drop text). Absolute, or relative to baseDir. Mutually exclusive with content. | |
| expectTitle | No | the doc’s title; verified before overwriting so a wrong id is refused |