Replace document with Markdown
import_markdownImport Markdown by replacing the entire Google Doc content, converting headings, lists, tables, code blocks, and links into native Docs formatting. Content not expressed in the Markdown is removed.
Instructions
REPLACES the ENTIRE document content with the given Markdown via Drive conversion — the Markdown round-trip writer paired with export_document format=markdown. Supported Markdown (headings, bold/italic/strikethrough, links, ordered/unordered lists, tables, code blocks, images by URL) becomes native Docs formatting. Everything not expressed in the Markdown is LOST: existing text, comment anchors (comments survive but detach), positioned objects, headers/footers and extra tabs. For surgical edits use replace_range/style tools instead. Returns the Drive file resource (id, name, modifiedTime).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| markdown | Yes | The full new document content as Markdown. | |
| document_id | Yes | The document id — the long id from the document URL (docs.google.com/document/d/<documentId>/edit) or from create_document output. |