Get Doc as Markdown
get_doc_as_markdownReads a Google Doc and converts it to clean Markdown, preserving headings, links, lists, tables and formatting, with optional comment context and anchor text for review.
Instructions
Reads a Google Doc and returns it as clean Markdown with optional comment context.
Unlike get_doc_content which returns plain text, this tool preserves document formatting as Markdown: headings, bold/italic/strikethrough, links, code spans, ordered/unordered lists with nesting, and tables.
When comments are included (the default), each comment's anchor text — the specific text the comment was attached to — is preserved, giving full context for the discussion.
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": {
"user_google_email": "<user_google_email>",
"document_id": "<document_id>"
},
"name": "get_doc_as_markdown"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tab_id | No | Optional ID of a single tab to read (from inspect_doc_structure). When given, only that tab's content is rendered, without its child tabs and without a tab heading, and comments are listed as document-wide. When omitted, every tab is rendered. Pass "" to read every tab of a URL that carries ?tab=. This filters output only: the whole document is still fetched. | |
| heading | No | Text of a body heading (case-insensitive, must match exactly one) whose section to render instead of the whole document: the heading and everything below it up to the next heading of equal or shallower level. Comments are listed as document-wide. tab_id is required when the doc has multiple tabs. | |
| document_id | Yes | ID of the Google Doc (or full URL). When a full URL is provided and it contains a ?tab= query parameter, that tab is used automatically unless tab_id is also specified (explicit tab_id takes precedence). | |
| comment_mode | No | How to display comments: - "inline": Footnote-style references placed at the anchor text location (default) - "appendix": All comments grouped at the bottom with blockquoted anchor text - "none": No comments included | inline |
| heading_level | No | Optional 1-6 heading level to narrow the heading match. | |
| include_colors | No | Follow text that has an explicit RGB foreground color with "[color: #rrggbb]" (default: False). Theme colors are not shown. | |
| include_comments | No | Whether to include comments (default: True) | |
| include_resolved | No | Whether to include resolved comments (default: False) | |
| user_google_email | Yes | User's Google email address | |
| suggestions_view_mode | No | How to render suggestions in the returned content: - "DEFAULT_FOR_CURRENT_ACCESS": Default based on user's access level - "SUGGESTIONS_INLINE": Suggested changes appear inline in the document - "PREVIEW_SUGGESTIONS_ACCEPTED": Preview as if all suggestions were accepted - "PREVIEW_WITHOUT_SUGGESTIONS": Preview as if all suggestions were rejected | DEFAULT_FOR_CURRENT_ACCESS |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |