Replace document with Markdown
import_markdownReplace all Google Doc content with Markdown via Drive conversion, converting headings, lists, tables, links, code blocks, and images into native Docs formatting.
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).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"document_id": "<document_id>",
"markdown": "<markdown>"
},
"name": "import_markdown"
}
}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. |