Skip to main content
Glama
Google Workspace MCP Server - Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Forms & Drive

Google Workspace MCP Server - Control Gmail, Calendar, Docs, Sheets, Slides, Chat, Forms & Drive

Get Doc as Markdown

get_doc_as_markdown
Read-onlyIdempotent

Reads 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

NameRequiredDescriptionDefault
tab_idNoOptional 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.
headingNoText 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_idYesID 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_modeNoHow 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 includedinline
heading_levelNoOptional 1-6 heading level to narrow the heading match.
include_colorsNoFollow text that has an explicit RGB foreground color with "[color: #rrggbb]" (default: False). Theme colors are not shown.
include_commentsNoWhether to include comments (default: True)
include_resolvedNoWhether to include resolved comments (default: False)
user_google_emailYesUser's Google email address
suggestions_view_modeNoHow 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 rejectedDEFAULT_FOR_CURRENT_ACCESS

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv2.4.2
    • addedInput schema / properties / heading
      Added value: +{
      +  "default": null,
      +  "description": "Text of a body heading (case-insensitive, must match exactly one)\nwhose section to render instead of the whole document: the heading and\neverything below it up to the next heading of equal or shallower level.\nComments are listed as document-wide. tab_id is required when the doc\nhas multiple tabs.",
      +  "type": "string"
      +}
    • addedInput schema / properties / heading_level
      Added value: +{
      +  "default": null,
      +  "description": "Optional 1-6 heading level to narrow the heading match.",
      +  "type": "integer"
      +}
  2. Changed3 schema fields changedv2.2.0
    • changedInput schema / properties / document_id / description
      Previous value: -"ID of the Google Doc (or full URL)"New value: +"ID of the Google Doc (or full URL). When a full URL is provided\nand it contains a ?tab= query parameter, that tab is used automatically\nunless tab_id is also specified (explicit tab_id takes precedence)."
    • addedInput schema / properties / include_colors
      Added value: +{
      +  "default": false,
      +  "description": "Follow text that has an explicit RGB foreground color\nwith \"[color: #rrggbb]\" (default: False). Theme colors are not shown.",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / tab_id / description
      Previous value: -"Optional ID of a single tab to read (from inspect_doc_structure).\nWhen given, only that tab's content is rendered, without its child tabs\nand without a tab heading. When omitted, every tab is rendered."New value: +"Optional ID of a single tab to read (from inspect_doc_structure).\nWhen given, only that tab's content is rendered, without its child tabs\nand without a tab heading, and comments are listed as document-wide.\nWhen omitted, every tab is rendered. Pass \"\" to read every tab of a\nURL that carries ?tab=. This filters output only: the whole document\nis still fetched."
  3. Changed2 schema fields changedv1.28.0
    • removedInput schema / properties / tab_id / anyOf
      Removed value: -[
      -  {
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]
    • addedInput schema / properties / tab_id / type
      Added value: +"string"
  4. Changed1 schema field changedv1.26.0
    • addedInput schema / properties / tab_id
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Optional ID of a single tab to read (from inspect_doc_structure).\nWhen given, only that tab's content is rendered, without its child tabs\nand without a tab heading. When omitted, every tab is rendered."
      +}
  5. Addedv1.0.1

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false, so safety is covered. The description adds genuine behavioral context beyond them: that comments are included by default and that each comment's anchor text is preserved to give discussion context — a non-obvious output trait an agent needs when summarizing a doc.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three short paragraphs, front-loaded with the core purpose, then the sibling contrast, then the comment-context caveat. Slightly redundant in restating the comment default already implied by include_comments=true, but every sentence still carries useful information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With an output schema present and fully documented parameters, the description only needs to carry purpose, differentiation, and notable output traits — all of which it does. The filtering options (tab_id, heading) are thoroughly handled in the schema, so nothing an agent needs to call correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with detailed per-parameter docs for tab_id, heading, comment_mode, and suggestions_view_mode, so the baseline is 3. The description reinforces only the comment-inclusion default; it adds no syntax or precedence detail beyond what the schema already spells out.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Reads a Google Doc and returns it as clean Markdown") and explicitly contrasts with the sibling get_doc_content by naming the differentiator (formatting preserved vs. plain text). It even enumerates which constructs are preserved (headings, lists, tables), so an agent can distinguish the two tools without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Names the primary alternative, get_doc_content, and gives the selection criterion: use this one when Markdown formatting matters. It does not state explicit when-not-to-use cases or mention other relevant siblings (e.g., inspect_doc_structure for tab discovery), but the core routing decision is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools